食谱计划生成修改,根据客户ID重新生成,暂停记录不需要加订单ID

This commit is contained in:
xiezhijun
2021-04-01 18:45:41 +08:00
parent e8b0ae2cd7
commit 5d95de3a2a
15 changed files with 231 additions and 114 deletions

View File

@ -372,7 +372,7 @@
<!-- 非持久化字段 -->
<result property="afterSale" column="afterSale_name"></result><!-- 售后名称 -->
<result property="nutritionist" column="nutritionist_name"></result><!-- 营养师名称 -->
<association property="orderPauseList" column="order_id" select="getOrderPauseByOrderId"/>
<!--<association property="orderPauseList" column="order_id" select="getOrderPauseByOrderId"/>-->
</resultMap>
<resultMap type="SysOrderPause" id="SysOrderPauseResult">
@ -476,4 +476,9 @@
</if>
</select>
<!-- 根据客户ID查询该客户下所有订单 -->
<select id="getAllOrderByCusId" parameterType="Long" resultMap="SysOrderResult">
select * from sys_order where del_flag = 0 and cus_id = #{cusId} order by order_id asc
</select>
</mapper>

View File

@ -144,4 +144,18 @@
where sop.del_flag = 0 and sop.order_id = #{orderId} order by sop.pause_start_date asc
</select>
<!-- 根据客户ID或订单ID获取暂停记录客户ID、订单ID不能都为空 -->
<select id="getPauseListByCusIdAndOrderId" parameterType="SysOrderPause" resultMap="SysOrderPauseResult">
<include refid="selectSysOrderPauseVo"></include>
where sop.del_flag = 0
<if test="cusId != null and orderId == null">
and sop.cus_id = #{cusId}
</if>
<if test="cusId == null and orderId != null">
and sop.order_id = #{orderId}
</if>
<if test="cusId != null and orderId != null">
and (sop.cus_id = #{cusId} or sop.order_id = #{orderId})
</if>
</select>
</mapper>

View File

@ -62,10 +62,10 @@
where id = #{id} and del_flag = 0
</select>
<!-- 根据用户ID查询是否存在该用户最后一食谱 -->
<!-- 根据用户ID查询是否存在该用户该订单之前的最后一食谱 -->
<select id="getLastDayRecipesPlan" resultMap="SysRecipesPlanResult" parameterType="Long">
<include refid="selectSysRecipesPlanVo"/>
where cus_id = #{customerId} and del_flag = 0 order by end_num_day DESC limit 1
where cus_id = #{customerId} and del_flag = 0 and #{orderId} > order_id order by end_num_day DESC limit 1
</select>
<insert id="insertSysRecipesPlan" parameterType="SysRecipesPlan" useGeneratedKeys="true" keyProperty="id">