| | |
| | | group by od.order_id, ogd.production_id |
| | | </select> |
| | | |
| | | <!-- 更新分架状态--> |
| | | <update id="UpdateDeleteState"> |
| | | update sd.order_glass_detail as ogd |
| | | set ogd.production_id=null, |
| | | ogd.production_time=null, |
| | | ogd.founder=null |
| | | where ogd.production_id = #{processId} |
| | | update |
| | | sd.order_glass_detail as ogd left join flow_card as fc |
| | | on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number |
| | | set ogd.splitting_status=0 |
| | | where ogd.order_id=#{orderId} and fc.process_id=#{processId} |
| | | |
| | | </update> |
| | | |
| | | <!-- 删除流程卡--> |
| | | <update id="DeleteFlowCardMp"> |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | set ogd.production_id=null, |
| | | ogd.production_time=null, |
| | | ogd.founder=null |
| | | where od.order_id = #{orderId} |
| | | and ogd.production_id = #{processId} |
| | | delete from flow_card as fc where fc.process_id=#{processId} |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | |
| | | p.thickness, |
| | | od.weight |
| | | from |
| | | |
| | | sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.product as p on od.product_name=p.product_name |
| | |
| | | technology_number, |
| | | quantity, |
| | | founder, |
| | | layers_number, |
| | | splitFrame_time, |
| | | create_time |
| | | ) |
| | |
| | | ogd.technology_number, |
| | | #{quantity}, |
| | | #{userName}, |
| | | #{layer}, |
| | | NOW(), |
| | | NOW() |
| | | |
| | |
| | | set o.processing_card=#{state} |
| | | where o.order_id=left(#{productionId},10) |
| | | </update> |
| | | |
| | | <!-- 查询已排版数据--> |
| | | <select id="SelectOkSchedulingMp"> |
| | | select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2), |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)), |
| | | round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2), |
| | | IFNULL(ps.scheduling_quantity,0), |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2), |
| | | od.product_name,od.shape |
| | | from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id |
| | | left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL |
| | | |
| | | </select> |
| | | <!-- 查询未排版数据--> |
| | | <select id="SelectNoSchedulingMp"> |
| | | |
| | | </select> |
| | | <!-- 首次查询排版数据--> |
| | | <select id="selectLastSchedulingMp"> |
| | | select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea, |
| | | od.product_name,od.shape |
| | | from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id |
| | | left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.create_time between #{selectTime1} and #{selectTime2} |
| | | </select> |
| | | |
| | | <!-- 查询对应序号的层数--> |
| | | <select id="SelectLayer"> |
| | | select COUNT(ogd.order_number) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = #{productionId} |
| | | and ogd.order_number=#{orderNumber} |
| | | </select> |
| | | </mapper> |