src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -110,4 +110,14 @@ WHERE create_time >= #{startDate} AND create_time <= #{endDate} AND complete_quantity < quantity </select> <update id="addCompleteQtyIfNotExceed"> update product_order set complete_quantity = complete_quantity + #{delta}, start_time = ifnull(start_time, now()), end_time = case when (complete_quantity + #{delta}) = quantity then now() else end_time end where id = #{id} and (complete_quantity + #{delta}) <![CDATA[ <= ]]> quantity </update> </mapper>