|
|
@ -45,6 +45,8 @@ |
|
|
<result column="ai_flag" jdbcType="INTEGER" property="aiFlag" /> |
|
|
<result column="ai_flag" jdbcType="INTEGER" property="aiFlag" /> |
|
|
<result column="ai_result" jdbcType="VARCHAR" property="aiResult" /> |
|
|
<result column="ai_result" jdbcType="VARCHAR" property="aiResult" /> |
|
|
<result column="ai_not_recognition" jdbcType="VARCHAR" property="aiNotRecognition" /> |
|
|
<result column="ai_not_recognition" jdbcType="VARCHAR" property="aiNotRecognition" /> |
|
|
|
|
|
<result column="print_count" jdbcType="INTEGER" property="printCount" /> |
|
|
|
|
|
<result column="distribution_flag" jdbcType="VARCHAR" property="distributionFlag" /> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
<sql id="Example_Where_Clause"> |
|
|
<sql id="Example_Where_Clause"> |
|
|
<where> |
|
|
<where> |
|
|
@ -107,7 +109,7 @@ |
|
|
<sql id="Base_Column_List"> |
|
|
<sql id="Base_Column_List"> |
|
|
id, create_by, create_by_name, create_time, del_flag, update_by, update_by_name, update_time, user_id, user_name, shop_id, shop_name, total_amount, discount, |
|
|
id, create_by, create_by_name, create_time, del_flag, update_by, update_by_name, update_time, user_id, user_name, shop_id, shop_name, total_amount, discount, |
|
|
discount_amount, real_amount, debt_deduction_amount, sale_deduction_amount, balance_deduction_amount, already_earn, no_earn, pay_status,pay_type, status, other_expense, transport_type, share_address, receive_address, province, city, area, |
|
|
discount_amount, real_amount, debt_deduction_amount, sale_deduction_amount, balance_deduction_amount, already_earn, no_earn, pay_status,pay_type, status, other_expense, transport_type, share_address, receive_address, province, city, area, |
|
|
trans_company, company_name, product_count, remark, sale_name, company_phone, create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition |
|
|
trans_company, company_name, product_count, remark, sale_name, company_phone, create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition,print_count,distribution_flag |
|
|
|
|
|
|
|
|
</sql> |
|
|
</sql> |
|
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.SaleExample" resultMap="BaseResultMap"> |
|
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.SaleExample" resultMap="BaseResultMap"> |
|
|
@ -148,7 +150,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
already_earn, no_earn, pay_status,pay_type, |
|
|
already_earn, no_earn, pay_status,pay_type, |
|
|
status, transport_type, share_address, |
|
|
status, transport_type, share_address, |
|
|
receive_address, province, city, |
|
|
receive_address, province, city, |
|
|
area,sale_name,remark,other_expense,trans_company,company_name,company_phone,product_count,create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition) |
|
|
area,sale_name,remark,other_expense,trans_company,company_name,company_phone,product_count,create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition,print_count,distribution_flag) |
|
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},#{createByName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},#{createByName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR},#{updateByName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR},#{updateByName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|
|
#{userId,jdbcType=VARCHAR},#{userName,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, |
|
|
#{userId,jdbcType=VARCHAR},#{userName,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, |
|
|
@ -160,7 +162,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
#{area,jdbcType=VARCHAR}, #{saleName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, |
|
|
#{area,jdbcType=VARCHAR}, #{saleName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, |
|
|
#{otherExpense,jdbcType=VARCHAR},#{transCompany,jdbcType=VARCHAR},#{companyName,jdbcType=VARCHAR},#{companyPhone,jdbcType=VARCHAR}, |
|
|
#{otherExpense,jdbcType=VARCHAR},#{transCompany,jdbcType=VARCHAR},#{companyName,jdbcType=VARCHAR},#{companyPhone,jdbcType=VARCHAR}, |
|
|
#{productCount,jdbcType=INTEGER},#{createByPhone,jdbcType=VARCHAR},#{modeOfService,jdbcType=VARCHAR}, |
|
|
#{productCount,jdbcType=INTEGER},#{createByPhone,jdbcType=VARCHAR},#{modeOfService,jdbcType=VARCHAR}, |
|
|
#{aiFlag,jdbcType=VARCHAR},#{aiResult,jdbcType=VARCHAR},#{aiNotRecognition,jdbcType=VARCHAR}) |
|
|
#{aiFlag,jdbcType=VARCHAR},#{aiResult,jdbcType=VARCHAR},#{aiNotRecognition,jdbcType=VARCHAR},#{printCount,jdbcType=INTEGER},#{distributionFlag,jdbcType=VARCHAR}) |
|
|
</insert> |
|
|
</insert> |
|
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Sale"> |
|
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Sale"> |
|
|
insert into t_sale |
|
|
insert into t_sale |
|
|
@ -276,6 +278,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
<if test="aiNotRecognition != null"> |
|
|
<if test="aiNotRecognition != null"> |
|
|
ai_not_recognition, |
|
|
ai_not_recognition, |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="printCount != null"> |
|
|
|
|
|
print_count, |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="distributionFlag != null"> |
|
|
|
|
|
distribution_flag, |
|
|
|
|
|
</if> |
|
|
</trim> |
|
|
</trim> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<if test="id != null"> |
|
|
<if test="id != null"> |
|
|
@ -386,6 +394,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
<if test="aiNotRecognition != null"> |
|
|
<if test="aiNotRecognition != null"> |
|
|
#{aiNotRecognition,jdbcType=VARCHAR}, |
|
|
#{aiNotRecognition,jdbcType=VARCHAR}, |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="printCount != null"> |
|
|
|
|
|
#{printCount,jdbcType=INTEGER}, |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="distributionFlag != null"> |
|
|
|
|
|
#{distributionFlag,jdbcType=VARCHAR}, |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
</trim> |
|
|
</trim> |
|
|
</insert> |
|
|
</insert> |
|
|
@ -509,6 +523,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
<if test="record.aiNotRecognition != null"> |
|
|
<if test="record.aiNotRecognition != null"> |
|
|
ai_not_recognition = #{record.aiNotRecognition,jdbcType=VARCHAR}, |
|
|
ai_not_recognition = #{record.aiNotRecognition,jdbcType=VARCHAR}, |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="record.printCount != null"> |
|
|
|
|
|
print_count = #{record.printCount,jdbcType=INTEGER}, |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="record.distributionFlag != null"> |
|
|
|
|
|
distribution_flag = #{record.distributionFlag,jdbcType=VARCHAR}, |
|
|
|
|
|
</if> |
|
|
</set> |
|
|
</set> |
|
|
<if test="_parameter != null"> |
|
|
<if test="_parameter != null"> |
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
@ -552,7 +572,9 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
mode_of_service = #{record.modeOfService,jdbcType=VARCHAR}, |
|
|
mode_of_service = #{record.modeOfService,jdbcType=VARCHAR}, |
|
|
ai_flag = #{record.aiFlag,jdbcType=INTEGER}, |
|
|
ai_flag = #{record.aiFlag,jdbcType=INTEGER}, |
|
|
ai_result = #{record.aiResult,jdbcType=VARCHAR}, |
|
|
ai_result = #{record.aiResult,jdbcType=VARCHAR}, |
|
|
ai_not_recognition = #{record.aiNotRecognition,jdbcType=VARCHAR} |
|
|
ai_not_recognition = #{record.aiNotRecognition,jdbcType=VARCHAR}, |
|
|
|
|
|
print_count = #{record.printCount,jdbcType=INTEGER}, |
|
|
|
|
|
distribution_flag = #{record.distributionFlag,jdbcType=VARCHAR} |
|
|
<if test="_parameter != null"> |
|
|
<if test="_parameter != null"> |
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
</if> |
|
|
</if> |
|
|
@ -668,6 +690,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
<if test="aiNotRecognition != null"> |
|
|
<if test="aiNotRecognition != null"> |
|
|
ai_not_recognition = #{aiNotRecognition,jdbcType=VARCHAR}, |
|
|
ai_not_recognition = #{aiNotRecognition,jdbcType=VARCHAR}, |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="printCount != null"> |
|
|
|
|
|
print_count = #{printCount,jdbcType=INTEGER}, |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="distributionFlag != null"> |
|
|
|
|
|
distribution_flag = #{distributionFlag,jdbcType=VARCHAR}, |
|
|
|
|
|
</if> |
|
|
</set> |
|
|
</set> |
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
</update> |
|
|
</update> |
|
|
@ -708,7 +736,9 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
mode_of_service = #{modeOfService,jdbcType=VARCHAR}, |
|
|
mode_of_service = #{modeOfService,jdbcType=VARCHAR}, |
|
|
ai_flag = #{aiFlag,jdbcType=INTEGER}, |
|
|
ai_flag = #{aiFlag,jdbcType=INTEGER}, |
|
|
ai_result = #{aiResult,jdbcType=VARCHAR}, |
|
|
ai_result = #{aiResult,jdbcType=VARCHAR}, |
|
|
ai_not_recognition = #{aiNotRecognition,jdbcType=VARCHAR} |
|
|
ai_not_recognition = #{aiNotRecognition,jdbcType=VARCHAR}, |
|
|
|
|
|
print_count = #{printCount,jdbcType=INTEGER}, |
|
|
|
|
|
distribution_flag = #{distributionFlag,jdbcType=VARCHAR} |
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
</update> |
|
|
</update> |
|
|
<select id="saleSumAndCount" parameterType="cc.hiver.mall.entity.SaleExample" resultType="cc.hiver.mall.pojo.vo.SaleAllVO"> |
|
|
<select id="saleSumAndCount" parameterType="cc.hiver.mall.entity.SaleExample" resultType="cc.hiver.mall.pojo.vo.SaleAllVO"> |
|
|
@ -754,7 +784,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
ts.shop_id,ts.shop_name,ts.total_amount,ts.discount,ts.discount_amount,ts.real_amount,ts.debt_deduction_amount,ts.sale_deduction_amount,ts.balance_deduction_amount ,ts.already_earn,ts.no_earn,ts.pay_status, |
|
|
ts.shop_id,ts.shop_name,ts.total_amount,ts.discount,ts.discount_amount,ts.real_amount,ts.debt_deduction_amount,ts.sale_deduction_amount,ts.balance_deduction_amount ,ts.already_earn,ts.no_earn,ts.pay_status, |
|
|
ts.pay_type,ts.status,ts.other_expense,ts.transport_type,ts.share_address,ts.receive_address,ts.province,ts.city,ts.area, |
|
|
ts.pay_type,ts.status,ts.other_expense,ts.transport_type,ts.share_address,ts.receive_address,ts.province,ts.city,ts.area, |
|
|
ts.trans_company,ts.company_name,ts.product_count,ts.remark,ts.sale_name,ts.company_phone,ts.create_by_phone,ts.mode_of_service, |
|
|
ts.trans_company,ts.company_name,ts.product_count,ts.remark,ts.sale_name,ts.company_phone,ts.create_by_phone,ts.mode_of_service, |
|
|
ts.ai_flag,ts.ai_result,ts.ai_not_recognition, |
|
|
ts.ai_flag,ts.ai_result,ts.ai_not_recognition,ts.print_count,ts.distribution_flag, |
|
|
ss.return_sale_product_count,ss.return_sale_amount |
|
|
ss.return_sale_product_count,ss.return_sale_amount |
|
|
from |
|
|
from |
|
|
t_sale ts |
|
|
t_sale ts |
|
|
@ -822,7 +852,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
ts.sale_deduction_amount,ts.balance_deduction_amount ,ts.already_earn,ts.no_earn,ts.pay_status,ts.pay_type,ts.status, |
|
|
ts.sale_deduction_amount,ts.balance_deduction_amount ,ts.already_earn,ts.no_earn,ts.pay_status,ts.pay_type,ts.status, |
|
|
ts.other_expense,ts.transport_type,ts.share_address,ts.receive_address,ts.province,ts.city,ts.area, |
|
|
ts.other_expense,ts.transport_type,ts.share_address,ts.receive_address,ts.province,ts.city,ts.area, |
|
|
ts.trans_company,ts.company_name,ts.product_count,ts.remark,ts.sale_name,ts.company_phone,ts.create_by_phone,ts.mode_of_service, |
|
|
ts.trans_company,ts.company_name,ts.product_count,ts.remark,ts.sale_name,ts.company_phone,ts.create_by_phone,ts.mode_of_service, |
|
|
ts.ai_flag,ts.ai_result,ts.ai_not_recognition, |
|
|
ts.ai_flag,ts.ai_result,ts.ai_not_recognition,ts.print_count,ts.distribution_flag, |
|
|
trs.return_sale_total_amount ,trs.return_sale_product_count, |
|
|
trs.return_sale_total_amount ,trs.return_sale_product_count, |
|
|
tdr.last_debt_amount |
|
|
tdr.last_debt_amount |
|
|
FROM |
|
|
FROM |
|
|
@ -858,7 +888,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
</if> |
|
|
</if> |
|
|
) |
|
|
) |
|
|
</if> |
|
|
</if> |
|
|
<if test='saleVO.fromWhere=="2"'> |
|
|
<if test='saleVO.fromWhere=="2" and saleVO.status != null '> |
|
|
and ts.status = #{saleVO.status} |
|
|
and ts.status = #{saleVO.status} |
|
|
</if> |
|
|
</if> |
|
|
</if> |
|
|
</if> |
|
|
@ -872,7 +902,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
<if test='saleVO.status != null and saleVO.status.trim() neq ""'> |
|
|
<if test='saleVO.status != null and saleVO.status.trim() neq ""'> |
|
|
and ts.status = #{saleVO.status} |
|
|
and ts.status = #{saleVO.status} |
|
|
</if> |
|
|
</if> |
|
|
<if test='saleVO.transportType!=null'> |
|
|
<if test='saleVO.transportType!=null' > |
|
|
and ts.transport_type = #{saleVO.transportType} |
|
|
and ts.transport_type = #{saleVO.transportType} |
|
|
</if> |
|
|
</if> |
|
|
<if test='saleVO.userId!=null'> |
|
|
<if test='saleVO.userId!=null'> |
|
|
@ -882,13 +912,32 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr |
|
|
<if test='saleVO.startTime!=null'> |
|
|
<if test='saleVO.startTime!=null'> |
|
|
and ts.create_time BETWEEN #{saleVO.startTime} AND #{saleVO.endTime} |
|
|
and ts.create_time BETWEEN #{saleVO.startTime} AND #{saleVO.endTime} |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test='saleVO.distributionFlag!=null'> |
|
|
|
|
|
and ts.distribution_flag = #{saleVO.distributionFlag} |
|
|
|
|
|
</if> |
|
|
<if test='saleVO.searchStr!=null'> |
|
|
<if test='saleVO.searchStr!=null'> |
|
|
and (ts.user_name like concat('%',#{saleVO.searchStr},'%') |
|
|
and (ts.user_name like concat('%',#{saleVO.searchStr},'%') |
|
|
or ts.create_by_name like concat('%',#{saleVO.searchStr},'%') |
|
|
or ts.create_by_name like concat('%',#{saleVO.searchStr},'%') |
|
|
or ts.id like concat('%',#{saleVO.searchStr},'%')) |
|
|
or ts.id like concat('%',#{saleVO.searchStr},'%')) |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
order by ts.create_time desc |
|
|
<if test='saleVO.timeOrder != null'> |
|
|
|
|
|
<choose> |
|
|
|
|
|
<when test='saleVO.timeOrder == "0"'> |
|
|
|
|
|
order by ts.create_time desc |
|
|
|
|
|
</when> |
|
|
|
|
|
<when test='saleVO.timeOrder == "1"'> |
|
|
|
|
|
order by ts.create_time asc |
|
|
|
|
|
</when> |
|
|
|
|
|
<!-- 可以在这里添加更多的when分支来处理其他情况 --> |
|
|
|
|
|
<otherwise> |
|
|
|
|
|
order by ts.create_time desc <!-- 默认降序 --> |
|
|
|
|
|
</otherwise> |
|
|
|
|
|
</choose> |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test='saleVO.timeOrder == null'> |
|
|
|
|
|
order by ts.create_time desc <!-- 默认情况 --> |
|
|
|
|
|
</if> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="getCustomerBuyProductLog" resultType="cc.hiver.mall.pojo.vo.CustomerBuyProductLogVo"> |
|
|
<select id="getCustomerBuyProductLog" resultType="cc.hiver.mall.pojo.vo.CustomerBuyProductLogVo"> |
|
|
@ -1453,4 +1502,18 @@ GROUP BY |
|
|
GROUP BY |
|
|
GROUP BY |
|
|
dd.product_id |
|
|
dd.product_id |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<update id="updateDistributionFlag" > |
|
|
|
|
|
update t_sale |
|
|
|
|
|
set |
|
|
|
|
|
distribution_flag = #{distributionFlag,jdbcType=VARCHAR} |
|
|
|
|
|
where id = #{saleId,jdbcType=VARCHAR} |
|
|
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<update id="updatePrintCount" > |
|
|
|
|
|
update t_sale |
|
|
|
|
|
set |
|
|
|
|
|
print_count = COALESCE(print_count, 0) + 1 |
|
|
|
|
|
where id = #{saleId,jdbcType=VARCHAR} |
|
|
|
|
|
</update> |
|
|
</mapper> |
|
|
</mapper> |