修改订单,添加假删字段

This commit is contained in:
huangdeliang
2021-02-24 08:55:33 +08:00
parent df52ea8f2d
commit 62e2d22d24
14 changed files with 783 additions and 544 deletions

View File

@ -31,7 +31,7 @@
<sql id="groupAmountVo">
SELECT ${column} AS user_id, ${postId} AS post_id, SUM(amount) AS amount
FROM sys_order
WHERE ${column} IS NOT NULL AND ${column} &lt;&gt; 0
WHERE ${column} IS NOT NULL AND ${column} &lt;&gt; 0 AND del_flag = 0
AND review_status = 'yes'
<if test="beginTime != null and beginTime != ''">AND date_format(order_time,'%y%m%d') &gt;=
date_format(${beginTime},'%y%m%d')

View File

@ -90,6 +90,7 @@
and 0 > amount
</if>
</if>
<if test="true">and del_flag = 0</if>
</where>
</select>
@ -126,6 +127,7 @@
and 0 > amount
</if>
</if>
<if test="true">and del_flag = 0</if>
</where>
order by order_time desc
</select>
@ -246,14 +248,14 @@
</update>
<delete id="deleteSysOrderById" parameterType="Long">
delete from sys_order where order_id = #{orderId}
update sys_order set del_flag = 1 where order_id = #{orderId}
</delete>
<delete id="deleteSysOrderByIds" parameterType="String">
delete from sys_order where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
<!-- delete from sys_order where order_id in-->
<!-- <foreach item="orderId" collection="array" open="(" separator="," close=")">-->
<!-- #{orderId}-->
<!-- </foreach>-->
</delete>
<resultMap type="SysOrder" id="SysOrderResultExtended">
@ -323,7 +325,7 @@
from sys_order o
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
left join sys_user su_nutritionist on su_nutritionist.user_id = o.nutritionist_id and su_nutritionist.del_flag = 0
where review_status = 'yes' and o.order_time >= '2021-01-01'
where review_status = 'yes' and o.order_time >= '2021-01-01' and del_flag = 0
<if test="userId != null">
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
</if>

View File

@ -31,12 +31,13 @@
</resultMap>
<sql id="selectSysRecipesPlanVo">
select id, order_id, start_date, end_date, recipes_id, send_flag, send_time, create_time, create_by, update_time, update_by, del_flag from sys_recipes_plan
select id, order_id, cus_id, start_date, end_date, recipes_id, send_flag, send_time, create_time, create_by, update_time, update_by, del_flag from sys_recipes_plan
</sql>
<select id="selectSysRecipesPlanList" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
<include refid="selectSysRecipesPlanVo"/> where del_flag = 0
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="cusId != null "> and cus_id = #{cusId}</if>
<if test="startDate != null "> and start_date = #{startDate}</if>
<if test="endDate != null "> and end_date = #{endDate}</if>
<if test="recipesId != null "> and recipes_id = #{recipesId}</if>
@ -53,6 +54,7 @@
insert into sys_recipes_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="cusId != null">cus_id,</if>
<if test="startDate != null">start_date,</if>
<if test="endDate != null">end_date,</if>
<if test="recipesId != null">recipes_id,</if>
@ -66,6 +68,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="cusId != null">#{cusId},</if>
<if test="startDate != null">#{startDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="recipesId != null">#{recipesId},</if>
@ -83,6 +86,7 @@
update sys_recipes_plan
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="cusId != null">cus_id = #{cusId},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="recipesId != null">recipes_id = #{recipesId},</if>
@ -111,10 +115,10 @@
<!-- 批量插入食谱计划 -->
<insert id="insertBatch">
INSERT INTO sys_recipes_plan
(order_id, start_date, end_date, send_flag, send_time, recipes_id)
(order_id, cus_id, start_date, end_date, send_flag, send_time, recipes_id)
VALUES
<foreach collection ="list" item="plan" separator =",">
(#{plan.orderId}, #{plan.startDate}, #{plan.endDate}, #{plan.sendFlag}, #{plan.sendTime}, #{plan.recipesId})
(#{plan.orderId}, #{plan.cusId}, #{plan.startDate}, #{plan.endDate}, #{plan.sendFlag}, #{plan.sendTime}, #{plan.recipesId})
</foreach >
</insert>