| | |
| | | </resultMap> |
| | | |
| | | |
| | | <delete id="deleteDelivery"> |
| | | delete from sd.delivery where delivery_id=#{deliveryId} |
| | | </delete> |
| | | <update id="updateDeliveryToExamine"> |
| | | update sd.delivery set delivery_state=#{deliveryState} where delivery_id=#{deliveryId} |
| | | </update> |
| | | |
| | | <update id="updatedelivery"> |
| | | update sd.delivery set area=#{area},quantity=#{quantity},money=#{money} where delivery_id=#{oddNumber} |
| | | </update> |
| | | |
| | | |
| | | <select id="getmaximum" > |
| | | select count(*) from sd.delivery where date(create_time)=CURDATE() |
| | | </select> |
| | | |
| | | <select id="getDeliveryConut" > |
| | | select count(*) from sd.delivery where delivery_id=#{deliveryId} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertDelivery" useGeneratedKeys="true" > |
| | | insert into sd.delivery(delivery_state,stock_state,delivery_id,order_id,project,customer_id,customer_name, |
| | | insert into sd.delivery(delivery_state,stock_state,payment_terms,delivery_id,order_id,project,customer_id,customer_name, |
| | | delivery_date,pay_method,pay_date,salesman_id,salesman,creator_id,creator,contacts,contact_number,delivery_address, |
| | | area,quantity,money,remarks,create_time) |
| | | values ( |
| | | 0,0,#{number} ,#{orderId},#{delivery.project},#{delivery.customerId},#{delivery.customerName},#{delivery.deliveryDate},#{delivery.payMethod}, |
| | | 0,0,#{delivery.paymentTerms},#{number} ,#{orderId},#{delivery.project},#{delivery.customerId},#{delivery.customerName},#{delivery.deliveryDate},#{delivery.payMethod}, |
| | | #{delivery.payDate},#{delivery.salesmanId},#{delivery.salesman},#{delivery.creatorId},#{delivery.creator},#{delivery.contacts},#{delivery.contactNumber},#{delivery.deliveryAddress}, |
| | | 0,0,0,#{delivery.remarks},now() |
| | | ) |
| | |
| | | from sd.`order` o |
| | | left join mm.finished_goods_inventory fgi on o.order_id = fgi.order_id |
| | | <where> |
| | | fgi.quantity_available > 0 |
| | | fgi.quantity_available > 0 and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | | <if test="order.orderId != null and order.orderId != ''"> |
| | | and o.order_id REGEXP #{order.orderId} |
| | | </if> |
| | |
| | | and o.batch REGEXP #{order.batch} |
| | | </if> |
| | | <if test="order.money != null and order.money != ''"> |
| | | and o.money REGEXP #{order.money} |
| | | and o.money REGEXP REGEXP_REPLACE(#{order.money},'\\.0+$','') |
| | | </if> |
| | | <if test="order.area != null and order.area != ''"> |
| | | and o.area REGEXP #{order.area} |
| | | and o.area REGEXP REGEXP_REPLACE(#{order.area},'\\.0+$','') |
| | | </if> |
| | | <if test="order.packType != null and order.packType != ''"> |
| | | and o.pack_type REGEXP #{order.packType} |
| | |
| | | and fgi.quantity_available REGEXP #{order.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | </where> |
| | | group by o.order_id |
| | | group by o.order_id order by o.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectOrderInventoryPageTotal" > |
| | | select CEILING(count(zu.order_id)/#{pageSize}) from |
| | | select CEILING(count(zu.order_id)/#{pageSize}) as 'pageTotal', |
| | | count(zu.order_id) as 'total' from |
| | | (select o.create_order,o.process_review,o.order_review,o.production_order, |
| | | o.processing_card,o.warehousing,o.delivery,o.order_id,o.customer_id, |
| | | o.customer_name,o.quantity,sum(fgi.quantity_available),o.project,o.batch, |
| | | o.money,o.area,o.create_time,o.pack_type,o.order_type,o.creator |
| | | from sd.`order` o left join mm.finished_goods_inventory fgi on o.order_id=fgi.order_id |
| | | <where> |
| | | fgi.quantity_available > 0 |
| | | fgi.quantity_available > 0 and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | | <if test="order.orderId != null and order.orderId != ''"> |
| | | and o.order_id REGEXP #{order.orderId} |
| | | </if> |
| | |
| | | and o.batch REGEXP #{order.batch} |
| | | </if> |
| | | <if test="order.money != null and order.money != ''"> |
| | | and o.money REGEXP #{order.money} |
| | | and o.money REGEXP REGEXP_REPLACE(#{order.money},'\\.0+$','') |
| | | </if> |
| | | <if test="order.area != null and order.area != ''"> |
| | | and o.area REGEXP #{order.area} |
| | | and o.area REGEXP REGEXP_REPLACE(#{order.area},'\\.0+$','') |
| | | </if> |
| | | <if test="order.packType != null and order.packType != ''"> |
| | | and o.pack_type REGEXP #{order.packType} |
| | |
| | | and fgi.quantity_available REGEXP #{order.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | </where> |
| | | group by o.order_id) as zu |
| | | limit #{offset},#{pageSize}; |
| | | group by o.order_id limit #{offset},#{pageSize}) as zu; |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrderDetaildelivery" > |
| | | <select id="getSelectShippingOrderDetailDelivery" > |
| | | select |
| | | d.delivery_state,d.stock_state,d.payment_terms, |
| | | d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number, |
| | | d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id |
| | | from sd.delivery d |
| | |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <select id="getSelectShippingOrderDetailDeliveryPrinting" > |
| | | select |
| | | d.delivery_id,d.quantity,d.money,d.area, |
| | | d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number, |
| | | d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id |
| | | from sd.delivery d |
| | | <where> |
| | | <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''"> |
| | | and d.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%') |
| | | </if> |
| | | |
| | | <select id="getseletShippingOrderDetaildeliverys" > |
| | | select customer_id,customer_name,project,salesman,salesman_id from sd.`order` |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="getSelectShippingOrderDetailDeliverys" > |
| | | select customer_id,customer_name,project,salesman,salesman_id,contacts,contact_number,delivery_address from sd.`order` |
| | | <where> |
| | | <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> |
| | | and order_id regexp #{orderDetail.orderId} |
| | |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrder"> |
| | | <select id="getSelectShippingOrder"> |
| | | select * from sd.delivery d |
| | | <where> |
| | | date(d.create_time)>=#{startDate} and date(d.create_time) <= #{endDate} |
| | | <if test="delivery.deliveryId != null and delivery.deliveryId != ''"> |
| | | and d.delivery_id regexp #{delivery.deliveryId} |
| | | </if> |
| | |
| | | and d.quantity regexp #{delivery.quantity} |
| | | </if> |
| | | <if test="delivery.area != null and delivery.area != ''"> |
| | | and d.area regexp #{delivery.area} |
| | | and d.area regexp REGEXP_REPLACE(#{delivery.area},'\\.0+$','') |
| | | </if> |
| | | </where> |
| | | |
| | | </where> |
| | | order by d.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrderPageTotal"> |
| | | <select id="getSelectShippingOrderPageTotal"> |
| | | select |
| | | CEILING(count(id)/#{pageSize}) |
| | | from sd.delivery |
| | | CEILING(count(id)/#{pageSize}) as 'pageTotal', |
| | | count(id) as 'total' |
| | | from sd.delivery d |
| | | <where> |
| | | date(d.create_time)>=#{startDate} and date(d.create_time) <= #{endDate} |
| | | <if test="delivery.deliveryId != null and delivery.deliveryId != ''"> |
| | | and d.delivery_id regexp #{delivery.deliveryId} |
| | | </if> |
| | | <if test="delivery.creator != null and delivery.creator != ''"> |
| | | and d.creator regexp #{delivery.creator} |
| | | </if> |
| | | <if test="delivery.deliveryDate != null and delivery.deliveryDate != ''"> |
| | | and d.delivery_date regexp #{delivery.deliveryDate} |
| | | </if> |
| | | <if test="delivery.customerId != null and delivery.customerId != ''"> |
| | | and d.customer_id regexp #{delivery.customerId} |
| | | </if> |
| | | <if test="delivery.customerName != null and delivery.customerName != ''"> |
| | | and d.customer_name regexp #{delivery.customerName} |
| | | </if> |
| | | <if test="delivery.project != null and delivery.project != ''"> |
| | | and d.project regexp #{delivery.project} |
| | | </if> |
| | | <if test="delivery.orderId != null and delivery.orderId != ''"> |
| | | and d.order_id regexp #{delivery.orderId} |
| | | </if> |
| | | <if test="delivery.payMethod != null and delivery.payMethod != ''"> |
| | | and d.pay_method regexp #{delivery.payMethod} |
| | | </if> |
| | | <if test="delivery.quantity != null and delivery.quantity != ''"> |
| | | and d.quantity regexp #{delivery.quantity} |
| | | </if> |
| | | <if test="delivery.area != null and delivery.area != ''"> |
| | | and d.area regexp REGEXP_REPLACE(#{delivery.area},'\\.0+$','') |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | </mapper> |