| | |
| | | from reporting_work as a |
| | | left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr} |
| | | and POSITION(b.technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(b.technology_number , #{technologyStr}) |
| | | ) as rw |
| | | on rw.process_id = fc.process_id |
| | | left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id and rwd.technology_number=fc.technology_number |
| | |
| | | left join flow_card as fc on fc.order_id=o.order_id and fc.order_number=ogd.order_number and fc.technology_number=ogd.technology_number |
| | | where fc.process_id = #{processIdStr} |
| | | and o.create_order>0 |
| | | and POSITION(fc.technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(fc.technology_number , #{technologyStr}) |
| | | limit 1),'') as process |
| | | |
| | | </select> |
| | |
| | | where |
| | | reporting_work.this_process = #{process} |
| | | and a.process_id=#{processIdStr} |
| | | and POSITION(a.technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(a.technology_number , #{technologyStr}) |
| | | and a.review_status = 1 |
| | | group by a.process_id,a.order_sort,a.technology_number |
| | | ) as patch |
| | |
| | | |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | AND FIND_IN_SET(fc.technology_number , #{technologyStr}) |
| | | AND odpd.process = #{process} |
| | | and if(#{reportType}=1,o.order_type!='样品订单',o.order_id!='') |
| | | and o.create_order>0 and fc.quantity - ifnull(fc.termination_quantity,0)>0 |
| | |
| | | from sd.order_glass_detail |
| | | where order_id = ogd.order_id |
| | | and order_number = ogd.order_number |
| | | and POSITION(technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(technology_number , #{technologyStr}) |
| | | limit 1) |
| | | </if> |
| | | |
| | |
| | | left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id |
| | | where this_process=#{previousProcess} and process_id= #{processIdStr} and a.reviewed_state>=0 |
| | | <if test="laminating == ''"> |
| | | AND POSITION(b.technology_number in #{technologyStr}) |
| | | AND FIND_IN_SET(b.technology_number , #{technologyStr}) |
| | | </if> |
| | | GROUP BY b.order_number,b.technology_number |
| | | ) as rws |
| | |
| | | |
| | | AND odpd.process = #{process} |
| | | <if test="laminating == ''"> |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | AND FIND_IN_SET(fc.technology_number , #{technologyStr}) |
| | | </if> |
| | | order by fc.order_number |
| | | </select> |
| | |
| | | a.completed_quantity, |
| | | (a.completed_quantity+ a.breakage_quantity), |
| | | (f.completed_quantity |
| | | -ifnull(g.completed_quantity,0)) |
| | | -ifnull(g.completed_quantity,0) + a.breakage_quantity) |
| | | ) as minQuantity -- 修改最小数 |
| | | </if> |
| | | <if test="nextProcess == null or nextProcess == ''"> -- 最后一道工序 |
| | | c.received_quantity, -- 已入库数量 |
| | | c.inventory_quantity, -- 库存数量 |
| | | if(ifnull(inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0) |
| | | >= a.completed_quantity,a.completed_quantity, |
| | | c.received_quantity, -- 已入库数量 |
| | | c.inventory_quantity, -- 库存数量 |
| | | if(ifnull(inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0) |
| | | > a.completed_quantity,a.completed_quantity+ a.breakage_quantity, |
| | | (ifnull(c.inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0)) |
| | | -ifnull(c.received_quantity,0)+ a.breakage_quantity) |
| | | ) |
| | | as minQuantity -- 修改最小数 |
| | | </if> |
| | |
| | | from reporting_work as rw |
| | | left join reporting_work_detail as rwd |
| | | on rw.reporting_work_id = rwd.reporting_work_id |
| | | where rw.reviewed_state>-1 |
| | | where rw.reviewed_state>-1 and rw.order_id=#{orderId} |
| | | group by rw.process_id, |
| | | rw.this_process, |
| | | rwd.order_number, |
| | |
| | | from reporting_work as rw |
| | | left join reporting_work_detail as rwd |
| | | on rw.reporting_work_id = rwd.reporting_work_id |
| | | where rw.reviewed_state>=0 |
| | | where rw.reviewed_state>=0 and rw.order_id=#{orderId} |
| | | group by rw.process_id, |
| | | rw.this_process, |
| | | rwd.order_number, |
| | |
| | | rwd.wornArea |
| | | # (IF(rw.reviewed_state = 0, '未审核', IF(rw.reviewed_state = 1, '审核通过', '审核不通过'))) as reviewed_state |
| | | from |
| | | reporting_work as rw |
| | | pp.reporting_work as rw |
| | | left join ( |
| | | SELECT cc.reporting_work_id,cc.goup,round(sum(cc.completedArea),2) as completedArea ,round(sum(cc.wornArea),2) as wornArea from (SELECT rwds.reporting_work_id, GROUP_CONCAT(distinct rwds.technology_number SEPARATOR '') as goup, |
| | | sum(rwds.child_width*rwds.child_height*completed_quantity/1000000)as completedArea, |
| | | sum(rwds.child_width*rwds.child_height*rwds.breakage_quantity/1000000) as wornArea from reporting_work_detail as rwds GROUP BY rwds.reporting_work_id,order_number ) as cc GROUP BY cc.reporting_work_id)as rwd on rw.reporting_work_id=rwd.reporting_work_id |
| | | sum(rwds.child_width*rwds.child_height*rwds.breakage_quantity/1000000) as wornArea from pp.reporting_work_detail as rwds GROUP BY rwds.reporting_work_id,order_number ) as cc GROUP BY cc.reporting_work_id)as rwd on rw.reporting_work_id=rwd.reporting_work_id |
| | | |
| | | left join sd.`order` as o on o.order_id=rw.order_id |
| | | where rw.reviewed_state != 2 |
| | |
| | | ROUND(SUM(rwd.wornArea), 2) AS wornArea, |
| | | CEILING(count(rw.reporting_work_id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct rw.reporting_work_id) as 'total' |
| | | FROM reporting_work AS rw |
| | | FROM pp.reporting_work AS rw |
| | | LEFT JOIN |
| | | (SELECT cc.reporting_work_id,cc.goup,round(sum(cc.completedArea),2) as completedArea ,round(sum(cc.wornArea),2) as wornArea from (SELECT rwds.reporting_work_id, GROUP_CONCAT(distinct rwds.technology_number SEPARATOR '') as goup, |
| | | sum(rwds.child_width*rwds.child_height*completed_quantity/1000000)as completedArea, |
| | | sum(rwds.child_width*rwds.child_height*rwds.breakage_quantity/1000000) as wornArea from reporting_work_detail as rwds GROUP BY rwds.reporting_work_id,order_number ) as cc GROUP BY cc.reporting_work_id) |
| | | sum(rwds.child_width*rwds.child_height*rwds.breakage_quantity/1000000) as wornArea from pp.reporting_work_detail as rwds GROUP BY rwds.reporting_work_id,order_number ) as cc GROUP BY cc.reporting_work_id) |
| | | AS rwd |
| | | ON rw.reporting_work_id = rwd.reporting_work_id |
| | | /*LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = rw.order_id |
| | |
| | | GROUP BY rw.reporting_work_id |
| | | ORDER BY rw.reporting_work_id desc |
| | | </select> |
| | | |
| | | <select id="mesSelectWorkBasicDeviceMp"> |
| | | SELECT bdp.id,bdp.basic_type,bdp.basic_name, bd.basic_name as basic_category FROM sd.basic_data as bd left join `basic_data_produce` as bdp |
| | | on bd.id=bdp.basic_category |
| | | where bd.basic_category="process" and bdp.basic_type="device" |
| | | </select> |
| | | |
| | | <select id="mesSelectWorkBasicTeamsMp"> |
| | | select id,login_name,user_name,address from erp_user_info.`user` where address is not null |
| | | </select> |
| | | </mapper> |