| | |
| | | |
| | | <select id="selectMaxOrderId"> |
| | | select |
| | | ifnull(SUBSTR(max(order_id) from 9),0) |
| | | ifnull(SUBSTR(max(right(order_id,8)) from 7),0) |
| | | from |
| | | `order` as a |
| | | where |
| | | date(a.create_time) = curdate() |
| | | order by id desc,order_id desc limit 1 |
| | | /*order by order_id desc,order_id desc limit 1*/ |
| | | </select> |
| | | |
| | | <select id="selectMaxOrderIdByMonth"> |
| | | select |
| | | ifnull(SUBSTR(order_id from 7),0) |
| | | ifnull(SUBSTR(max(right(order_id,8)) from 5),0) |
| | | from |
| | | `order` as a |
| | | where |
| | | date(a.create_time) BETWEEN DATE_FORMAT(DATE(NOW()), '%Y-%m-01') AND DATE(NOW()) |
| | | order by id desc limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectMaxOrderIdByYear"> |
| | | select |
| | | ifnull(SUBSTR(max(right(order_id,8)) from 3),0) |
| | | from |
| | | `order` as a |
| | | where |
| | | year(a.create_time) = year(now()) |
| | | and a.id>400 |
| | | </select> |
| | | |
| | | <select id="selectOrderIdMin"> |
| | | select count(*) from sd.`order` where SUBSTR(order_id,3,11)>#{substringInt} |
| | | </select> |
| | | |
| | | <select id="selectOrderIdIs"> |
| | | select count(*) from sd.`order` where SUBSTR(order_id,3,11)=#{substringInt} |
| | | </select> |
| | | |
| | | <select id="selectOrderIdDay"> |
| | | select count(*) from sd.`order` where order_id=#{oldOrderId} and SUBSTR(#{oldOrderId},9,2)=01 |
| | | </select> |
| | | |
| | | <select id="selectOrderIdMonth"> |
| | | select count(*) from sd.`order` where order_id=#{oldOrderId} and SUBSTR(#{oldOrderId},7,4)=0001 |
| | | </select> |
| | | |
| | | <select id="selectOrderIdYear"> |
| | | select count(*) from sd.`order` where order_id=#{oldOrderId} and SUBSTR(#{oldOrderId},5,2)=000001 |
| | | </select> |
| | | |
| | | <select id="selectOrderId"> |
| | | select * from sd.`order` where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <update id="updateOrderId"> |
| | | update sd.`order` set order_id=#{newOrderId} where order_id=#{oldOrderId} |
| | | </update> |
| | | |
| | | <update id="updateOrderParameter"> |
| | | update `order` o |
| | |
| | | *, |
| | | ifnull(sum(fgi.quantity_available),0) as goodsQuantity |
| | | from |
| | | `order` as o |
| | | sd.`order` as o |
| | | left join mm.finished_goods_inventory as fgi |
| | | on o.order_id = fgi.order_id |
| | | where date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | |
| | | and o.salesman REGEXP #{order.salesman} |
| | | </if> |
| | | |
| | | <if test="order.creator != null and order.creator != ''"> |
| | | and o.creator REGEXP #{order.creator} |
| | | </if> |
| | | |
| | | <if test="order.verifier != null and order.verifier != ''"> |
| | | and o.verifier REGEXP #{order.verifier} |
| | | </if> |
| | | |
| | | <if test="order.perimeter != null and order.perimeter != ''"> |
| | | and o.perimeter REGEXP #{order.perimeter} |
| | | </if> |
| | |
| | | <if test="order.deliveryAddress != null and order.deliveryAddress != ''"> |
| | | and o.delivery_address REGEXP #{order.deliveryAddress} |
| | | </if> |
| | | <if test="order.delivery != null "> |
| | | and o.delivery = #{order.delivery} |
| | | </if> |
| | | <if test="order.processReview != null "> |
| | | and o.process_review = #{order.processReview} |
| | | </if> |
| | | <if test="order.orderReview != null "> |
| | | and o.order_review = #{order.orderReview} |
| | | </if> |
| | | <if test="order.productionOrder != null "> |
| | | and o.production_order = #{order.productionOrder} |
| | | </if> |
| | | <if test="order.processingCard != null "> |
| | | and o.processing_card = #{order.processingCard} |
| | | </if> |
| | | <if test="order.warehousing != null "> |
| | | and o.warehousing = #{order.warehousing} |
| | | </if> |
| | | <if test="order.processingNote != null and order.processingNote != ''"> |
| | | and o.processing_note REGEXP #{order.processingNote} |
| | | </if> |
| | | group by o.id |
| | | order by o.id desc |
| | | limit #{offset},#{pageSize} |
| | |
| | | from |
| | | `order` as o |
| | | where date (o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | | <if test="orderType!= null and orderType != ''"> |
| | | <if test="orderType!= null and orderType != 0"> |
| | | and o.create_order = #{orderType} |
| | | </if> |
| | | |
| | |
| | | and o.salesman REGEXP #{order.salesman} |
| | | </if> |
| | | |
| | | <if test="order.creator != null and order.creator != ''"> |
| | | and o.creator REGEXP #{order.creator} |
| | | </if> |
| | | |
| | | <if test="order.verifier != null and order.verifier != ''"> |
| | | and o.verifier REGEXP #{order.verifier} |
| | | </if> |
| | | |
| | | <if test="order.perimeter != null and order.perimeter != ''"> |
| | | and o.perimeter REGEXP #{order.perimeter} |
| | | </if> |
| | |
| | | <if test="order.deliveryAddress != null and order.deliveryAddress != ''"> |
| | | and o.delivery_address REGEXP #{order.deliveryAddress} |
| | | </if> |
| | | <if test="order.delivery != null "> |
| | | and o.delivery = #{order.delivery} |
| | | </if> |
| | | <if test="order.processReview != null "> |
| | | and o.process_review = #{order.processReview} |
| | | </if> |
| | | <if test="order.orderReview != null "> |
| | | and o.order_review = #{order.orderReview} |
| | | </if> |
| | | <if test="order.productionOrder != null "> |
| | | and o.production_order = #{order.productionOrder} |
| | | </if> |
| | | <if test="order.processingCard != null "> |
| | | and o.processing_card = #{order.processingCard} |
| | | </if> |
| | | <if test="order.warehousing != null "> |
| | | and o.warehousing = #{order.warehousing} |
| | | </if> |
| | | <if test="order.processingNote != null and order.processingNote != ''"> |
| | | and o.processing_note REGEXP #{order.processingNote} |
| | | </if> |
| | | order by o.id desc |
| | | </select> |
| | | |
| | |
| | | </update> |
| | | |
| | | <update id="updateMoney"> |
| | | update `order` set money = #{order.money},calculate_type = #{order.calculateType} where order_id = #{order.orderId} |
| | | update `order` set money = #{order.money},calculate_type = #{order.calculateType},other_money=#{order.otherMoney} where order_id = #{order.orderId} |
| | | </update> |
| | | |
| | | <update id="cancelOrder"> |