| | |
| | | <result column="remarks" property="remarks"/> |
| | | <result column="is_state" property="isState"/> |
| | | <result column="process_id" property="processId"/> |
| | | <result column="money" property="money"/> |
| | | <result column="area" property="area"/> |
| | | |
| | | <result column="width" property="orderDetail.width"/> |
| | | <result column="height" property="orderDetail.height"/> |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | <result column="product_name" property="orderDetail.productName"/> |
| | | <result column="price" property="orderDetail.price"/> |
| | | |
| | | <result column="project" property="order.project"/> |
| | | <result column="customer_name" property="order.customerName"/> |
| | | <result column="delivery_address" property="order.deliveryAddress"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="customer_name" property="order.customerName"/> |
| | | <result column="customer_Id" property="order.customerId"/> |
| | | <result column="order_type" property="order.orderType"/> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | fol.reviewed, |
| | | fol.reviewed_time, |
| | | fol.type, |
| | | fol.remarks |
| | | fol.remarks, |
| | | fol.area, |
| | | fol.money, |
| | | o.customer_name, |
| | | o.project, |
| | | od.price, |
| | | CASE |
| | | WHEN #{type} = '入库' THEN |
| | | if(fgi.quantity_available>fol.quantity,fol.quantity,fgi.quantity_available) |
| | | ELSE |
| | | 0 |
| | | END AS quantity_available, |
| | | CASE |
| | | WHEN #{type} = '入库' THEN |
| | | if(fgi.quantity_available>fol.quantity,fol.quantity,fgi.quantity_available) |
| | | ELSE |
| | | 0 |
| | | END AS cancelAvailable |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = #{type} and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join mm.finished_goods_inventory fgi on fgi.order_id = fol.order_id and fol.operation_number = fgi.order_number and fgi.box_no=fol.remarks |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''"> |
| | |
| | | <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''"> |
| | | and fol.quantity regexp #{finishedOperateLog.quantity} |
| | | </if> |
| | | <if test="finishedOperateLog.processId != null and finishedOperateLog.processId != ''"> |
| | | and fol.process_id regexp #{finishedOperateLog.processId} |
| | | </if> |
| | | <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''"> |
| | | and fol.operator regexp #{finishedOperateLog.operator} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.price != null and finishedOperateLog.orderDetail.price != ''"> |
| | | and od.price regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.price},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | |
| | | and fol.type regexp #{finishedOperateLog.type} |
| | | </if> |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | and fol.remarks regexp #{finishedOperateLog.remarks} |
| | | </if> |
| | | <if test="finishedOperateLog.area != null and finishedOperateLog.area != ''"> |
| | | and fol.area regexp REGEXP_REPLACE(#{finishedOperateLog.area},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.money != null and finishedOperateLog.money != ''"> |
| | | and fol.money regexp REGEXP_REPLACE(#{finishedOperateLog.money},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')"> |
| | | and o.customer_name regexp #{finishedOperateLog.order.customerName} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')"> |
| | | and o.project regexp #{finishedOperateLog.order.project} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | | group by fol.order_id,fol.operation_number,fol.remarks |
| | | order by fol.operate_time desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectStorageRecordLogPageTotal"> |
| | | select CEILING(count(fol.id)/#{pageSize}) as 'pageTotal', |
| | | count(fol.id) as 'total' |
| | | select |
| | | CEILING(count(zu.id)/#{pageSize}) as 'pageTotal', |
| | | count(zu.id) as 'total' from ( |
| | | select fol.id |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = #{type} and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join mm.finished_goods_inventory fgi on fgi.order_id = fol.order_id and fol.operation_number = fgi.order_number and fgi.box_no=fol.remarks |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''"> |
| | |
| | | <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''"> |
| | | and fol.quantity regexp #{finishedOperateLog.quantity} |
| | | </if> |
| | | <if test="finishedOperateLog.processId != null and finishedOperateLog.processId != ''"> |
| | | and fol.process_id regexp #{finishedOperateLog.processId} |
| | | </if> |
| | | <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''"> |
| | | and fol.operator regexp #{finishedOperateLog.operator} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.price != null and finishedOperateLog.orderDetail.price != ''"> |
| | | and od.price regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.price},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | |
| | | and fol.type regexp #{finishedOperateLog.type} |
| | | </if> |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | and fol.remarks regexp #{finishedOperateLog.remarks} |
| | | </if> |
| | | <if test="finishedOperateLog.area != null and finishedOperateLog.area != ''"> |
| | | and fol.area regexp REGEXP_REPLACE(#{finishedOperateLog.area},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.money != null and finishedOperateLog.money != ''"> |
| | | and fol.money regexp REGEXP_REPLACE(#{finishedOperateLog.money},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')"> |
| | | and o.customer_name regexp #{finishedOperateLog.order.customerName} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')"> |
| | | and o.project regexp #{finishedOperateLog.order.project} |
| | | </if> |
| | | </where> |
| | | group by fol.order_id,fol.operation_number,fol.remarks |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | ) as zu |
| | | </select> |
| | | |
| | | <update id="updateToExamine"> |
| | |
| | | |
| | | <update id="updateFinishedOperateLogState"> |
| | | update mm.finished_operate_log set status=#{type} where id=#{finishedOperateLog.id}; |
| | | </update> |
| | | |
| | | <update id="updateFinishedOperateLogQuantity"> |
| | | update mm.finished_operate_log set quantity=quantity-#{finishedOperateLog.cancelAvailable}, |
| | | area=area-#{deliveryDetailArea},money=money-#{deliveryDetailMoney} where id=#{finishedOperateLog.id}; |
| | | </update> |
| | | |
| | | <select id="getSelectOperateRecord" resultMap="selectFinishedGoodsInventory"> |
| | |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectAllocateFinishedOperateLog" resultMap="selectFinishedGoodsInventory" > |
| | |
| | | and fol.operate_time regexp #{finishedOperateLog.operateTime} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | |
| | | fol.reviewed, |
| | | fol.reviewed_time, |
| | | fol.type, |
| | | fol.remarks |
| | | fol.remarks, |
| | | fol.area, |
| | | fol.money, |
| | | o.customer_name, |
| | | o.project, |
| | | od.price, |
| | | o.order_type |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} and fol.operate_type=#{type} |
| | | <if test="finishedOperateLog.operateType != null and finishedOperateLog.operateType != ''"> |
| | | and fol.operate_type regexp #{finishedOperateLog.operateType} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | <if test="finishedOperateLog.area != null and finishedOperateLog.area != ''"> |
| | | and fol.area regexp REGEXP_REPLACE(#{finishedOperateLog.area},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.money != null and finishedOperateLog.money != ''"> |
| | | and fol.money regexp REGEXP_REPLACE(#{finishedOperateLog.money},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')"> |
| | | and o.customer_name regexp #{finishedOperateLog.order.customerName} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')"> |
| | | and o.project regexp #{finishedOperateLog.order.project} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.price != null and finishedOperateLog.orderDetail.price != ''"> |
| | | and od.price regexp #{finishedOperateLog.orderDetail.price} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.orderType != null and finishedOperateLog.order.orderType != '')"> |
| | | and o.order_type regexp #{finishedOperateLog.order.orderType} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} and fol.operate_type=#{type} |
| | | <if test="finishedOperateLog.operateType != null and finishedOperateLog.operateType != ''"> |
| | | and fol.operate_type regexp #{finishedOperateLog.operateType} |
| | | </if> |
| | |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | <if test="finishedOperateLog.area != null and finishedOperateLog.area != ''"> |
| | | and fol.area regexp REGEXP_REPLACE(#{finishedOperateLog.area},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.money != null and finishedOperateLog.money != ''"> |
| | | and fol.money regexp REGEXP_REPLACE(#{finishedOperateLog.money},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')"> |
| | | and o.customer_name regexp #{finishedOperateLog.order.customerName} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')"> |
| | | and o.project regexp #{finishedOperateLog.order.project} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.price != null and finishedOperateLog.orderDetail.price != ''"> |
| | | and od.price regexp #{finishedOperateLog.orderDetail.price} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.orderType != null and finishedOperateLog.order.orderType != '')"> |
| | | and o.order_type regexp #{finishedOperateLog.order.orderType} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectFinishedOperateLog" > |
| | |
| | | |
| | | |
| | | <select id="getmaximum" > |
| | | select count(*) from mm.finished_operate_log where operate_type =#{type} and date(operate_time)=CURDATE() |
| | | select count(*) from (select * from mm.finished_operate_log where operate_type =#{type} and date(operate_time)=CURDATE() group by operation_order_number) zu |
| | | </select> |
| | | |
| | | <insert id="insertIntFinishedOperateLog" useGeneratedKeys="true" > |
| | |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status |
| | | status, |
| | | remarks, |
| | | money, |
| | | area, |
| | | compute_area |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.processId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now(),"未审核" |
| | | #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.processId},#{flowCard.orderNumber},"入库",#{userName}, |
| | | #{flowCard.inventoryQuantity}, |
| | | <if test="createTime != null"> |
| | | #{createTime} |
| | | </if> |
| | | <if test="createTime == null"> |
| | | now() |
| | | </if> |
| | | ,"未审核",#{container},#{deliveryDetailMoney},#{deliveryDetailArea},#{getComputeArea} |
| | | |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status |
| | | status, |
| | | remarks, |
| | | area |
| | | ) |
| | | values ( |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber} |
| | | ,"出库",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"未审核" |
| | | ,"出库",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"未审核",#{boxNo},#{orderDetail.deliveryDetail.area} |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | fol.reviewed, |
| | | fol.reviewed_time, |
| | | fol.type, |
| | | fol.remarks |
| | | fol.remarks, |
| | | fol.area, |
| | | fol.money, |
| | | o.customer_name, |
| | | o.project, |
| | | od.price, |
| | | o.order_type |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | where date(fol.operate_time)>=#{dates[0]} and date(fol.operate_time) <= #{dates[1]} |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | where date(fol.operate_time)>=#{dates[0]} and date(fol.operate_time) <= #{dates[1]} and fol.operate_type=#{type} |
| | | |
| | | </select> |
| | | |
| | | <insert id="insertOrderFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | process_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | area, |
| | | compute_area, |
| | | remarks, |
| | | money |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.orderId},#{processId},#{orderDetail.orderNumber},"入库",#{userName},#{orderDetail.quantity},now(),"未审核", |
| | | #{orderDetail.computeGrossArea},#{orderDetail.computeArea},"",#{orderDetail.grossAmount} |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateOrderFinishedOperateLog" > |
| | | update mm.finished_operate_log set status="已作废" where order_id=#{orderDetail.orderId} and operation_number=#{orderDetail.orderNumber} and operate_type="入库"; |
| | | </update> |
| | | |
| | | <select id="getSelectStorageRecordPint" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.id, |
| | | fol.operation_order_number, |
| | | fol.order_id, |
| | | fol.operate_type, |
| | | fol.process_id, |
| | | fol.operation_number, |
| | | fol.quantity, |
| | | fol.operator, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | o.project, |
| | | o.customer_name, |
| | | o.customer_Id, |
| | | o.delivery_address, |
| | | fol.operate_time, |
| | | fol.`status`, |
| | | fol.is_state, |
| | | fol.reviewed, |
| | | fol.reviewed_time, |
| | | fol.remarks |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '入库' and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | and (fol.remarks is not null and fol.remarks !="") and (fol.process_id !="" and fol.process_id is not null) |
| | | <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''"> |
| | | and fol.order_id regexp #{finishedOperateLog.orderId} |
| | | </if> |
| | | <if test="finishedOperateLog.processId != null and finishedOperateLog.processId != ''"> |
| | | and od.process_id regexp #{finishedOperateLog.processId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != '')"> |
| | | and od.product_id regexp #{finishedOperateLog.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != '')"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != '')"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != '')"> |
| | | and od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')"> |
| | | and o.project regexp #{finishedOperateLog.order.project} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')"> |
| | | and o.customer_name regexp #{finishedOperateLog.order.customerName} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.deliveryAddress != null and finishedOperateLog.order.deliveryAddress != '')"> |
| | | and o.delivery_address regexp #{finishedOperateLog.order.deliveryAddress} |
| | | </if> |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarks} |
| | | </if> |
| | | </where> |
| | | group by fol.remarks,od.order_id |
| | | -- ,fol.process_id |
| | | order by fol.operate_time desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectStorageRecordPintPageTotal"> |
| | | select |
| | | CEILING(count(zu.id)/#{pageSize}) as 'pageTotal', |
| | | count(zu.id) as 'total' from ( |
| | | select fol.id |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '入库' and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | and (fol.remarks is not null and fol.remarks !="") and (fol.process_id !="" and fol.process_id is not null) |
| | | <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''"> |
| | | and fol.order_id regexp #{finishedOperateLog.orderId} |
| | | </if> |
| | | <if test="finishedOperateLog.processId != null and finishedOperateLog.processId != ''"> |
| | | and od.process_id regexp #{finishedOperateLog.processId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != '')"> |
| | | and od.product_id regexp #{finishedOperateLog.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != '')"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != '')"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail !=null and (finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != '')"> |
| | | and od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')"> |
| | | and o.project regexp #{finishedOperateLog.order.project} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')"> |
| | | and o.customer_name regexp #{finishedOperateLog.order.customerName} |
| | | </if> |
| | | <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.deliveryAddress != null and finishedOperateLog.order.deliveryAddress != '')"> |
| | | and o.delivery_address regexp #{finishedOperateLog.order.deliveryAddress} |
| | | </if> |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarks} |
| | | </if> |
| | | </where> |
| | | group by fol.remarks,od.order_id |
| | | -- ,fol.process_id |
| | | ) as zu |
| | | |
| | | </select> |
| | | |
| | | <select id="getPrimaryListLimt"> |
| | | select o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | fol.remarks, |
| | | SUM(fol.quantity) as quantity, |
| | | ROUND( sum(od.width * od.height * fol.quantity) / 1000000, 2 ) as area |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '入库' and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | where |
| | | o.order_id=#{orderId} and fol.remarks=#{remarks} |
| | | and (fol.remarks is not null and fol.remarks !="") and (fol.process_id !="" and fol.process_id is not null) |
| | | |
| | | group by fol.remarks,od.order_id |
| | | order by fol.operate_time desc |
| | | </select> |
| | | |
| | | <select id="getPrimaryListLimts"> |
| | | |
| | | |
| | | |
| | | select kkk.*,rw.teams_groups_name as teams_groups_name2 from(select o.order_id, |
| | | o.customer_name, |
| | | o.customer_id, |
| | | o.project, |
| | | o.batch, |
| | | fol.remarks, |
| | | SUM(fol.quantity) as quantity, |
| | | /*ROUND( sum(od.width * od.height * fol.quantity) / 1000000, 2 ) as area,*/ |
| | | fol.area as area, |
| | | ROUND( sum(od.width * od.height * fol.quantity*p.total_thickness*2.5) / 1000000, 2 ) as weight, |
| | | fol.process_id, |
| | | aaa.teams_groups_name, |
| | | aaa.previous_process, |
| | | date( aaa.reporting_work_time) as reporting_work_time |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '入库' and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | left join sd.product p on od.product_id=p.id |
| | | left join (select teams_groups_name,process_id,previous_process,reporting_work_time from pp.reporting_work where this_process='包装' group by process_id) aaa on aaa.process_id=fol.process_id |
| | | |
| | | |
| | | |
| | | where |
| | | o.customer_id=#{customerId} and fol.remarks=#{remarks} and o.project=#{project} |
| | | and (fol.remarks is not null and fol.remarks !="") and (fol.process_id !="" and fol.process_id is not null) |
| | | |
| | | group by fol.remarks,o.customer_name,o.project |
| | | ) as kkk |
| | | left join pp.reporting_work rw on rw.process_id=kkk.process_id and rw.this_process=kkk.previous_process |
| | | group by kkk.remarks,kkk.customer_id,kkk.project |
| | | |
| | | </select> |
| | | |
| | | <select id="getDetailList"> |
| | | SELECT |
| | | od.building_number, |
| | | od.width, |
| | | od.height, |
| | | fol.quantity, |
| | | ROUND( od.width * od.height * fol.quantity / 1000000, 2 ) as area |
| | | FROM |
| | | ( SELECT * FROM mm.finished_operate_log aa WHERE aa.operate_type = '入库' AND aa.STATUS != '已作废' ) fol |
| | | LEFT JOIN sd.order_detail od ON fol.order_id = od.order_id |
| | | AND fol.operation_number = od.order_number |
| | | LEFT JOIN sd.`order` o ON o.order_id = fol.order_id |
| | | WHERE |
| | | o.order_id=#{orderId} and fol.remarks=#{remarks} |
| | | ORDER BY |
| | | fol.operate_time DESC |
| | | |
| | | </select> |
| | | |
| | | <select id="getDetailLists"> |
| | | SELECT |
| | | ifnull(od.building_number,ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'')) as building_number, |
| | | od.width, |
| | | od.height, |
| | | sum(fol.quantity) as quantity, |
| | | od.product_name, |
| | | od.product_id, |
| | | /*ROUND(sum(od.width * od.height * fol.quantity / 1000000) , 2 ) as area,*/ |
| | | ROUND(sum(fol.compute_area * fol.quantity) , 2 ) as area, |
| | | ROUND(sum(od.width * od.height * fol.quantity / 1000000) , 2 )*#{thickness}*2.5 as weight |
| | | FROM |
| | | ( SELECT * FROM mm.finished_operate_log aa WHERE aa.operate_type = '入库' AND aa.STATUS != '已作废' ) fol |
| | | LEFT JOIN sd.order_detail od ON fol.order_id = od.order_id |
| | | AND fol.operation_number = od.order_number |
| | | LEFT JOIN sd.`order` o ON o.order_id = fol.order_id |
| | | WHERE |
| | | o.order_id=#{orderId} and fol.remarks=#{remarks} and od.product_id=#{productId} |
| | | group by od.order_id,od.order_number |
| | | ORDER BY |
| | | od.order_number |
| | | |
| | | </select> |
| | | |
| | | <select id="getDetailList2"> |
| | | SELECT |
| | | od.product_id, |
| | | od.product_name, |
| | | pro.thickness |
| | | FROM |
| | | ( SELECT * FROM mm.finished_operate_log aa WHERE aa.operate_type = '入库' AND aa.STATUS != '已作废' ) fol |
| | | LEFT JOIN sd.order_detail od ON fol.order_id = od.order_id |
| | | AND fol.operation_number = od.order_number |
| | | left join sd.product as pro |
| | | on pro.id = od.product_id |
| | | LEFT JOIN sd.`order` o ON o.order_id = fol.order_id |
| | | WHERE |
| | | o.order_id=#{orderId} and fol.remarks=#{remarks} |
| | | group by |
| | | od.product_id |
| | | |
| | | </select> |
| | | |
| | | <select id="getSelectStorageRecordDeliveryId" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.id, |
| | | fol.operation_order_number, |
| | | fol.order_id, |
| | | fol.operate_type, |
| | | fol.process_id, |
| | | fol.operation_number, |
| | | fol.quantity, |
| | | fol.operator, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | fol.operate_time, |
| | | fol.`status`, |
| | | fol.is_state, |
| | | fol.reviewed, |
| | | fol.reviewed_time, |
| | | fol.type, |
| | | fol.remarks |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = #{type} and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | where fol.operation_order_number=#{deliveryId} |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |