| | |
| | | rw.this_process, |
| | | rw.creator, |
| | | rw.reporting_work_id, |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.thickness')) AS thickness |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.thickness')) AS thickness, |
| | | ROUND(round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) |
| | | * SUBSTRING_INDEX(IFNULL(JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.thickness')), '0'), 'mm', 1),2) AS pingfang |
| | | FROM |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | |
| | | rw.this_process, |
| | | rw.creator, |
| | | rw.reporting_work_id, |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.thickness')) AS thickness |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.thickness')) AS thickness, |
| | | ROUND(round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) |
| | | * SUBSTRING_INDEX(IFNULL(JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.thickness')), '0'), 'mm', 1),2) AS pingfang |
| | | FROM sd.ORDER AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = o.order_id |
| | |
| | | <select id="damageReportFootSum"> |
| | | SELECT |
| | | SUM(dd.breakage_quantity) AS breakageQuantity, |
| | | ROUND(SUM(ogd.child_width * ogd.child_height * dd.breakage_quantity) / 1000000, 2) AS area |
| | | ROUND(SUM(ogd.child_width * ogd.child_height * dd.breakage_quantity) / 1000000, 2) AS area, |
| | | SUM(ROUND(round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) |
| | | * SUBSTRING_INDEX(IFNULL(JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.thickness')), '0'), 'mm', 1),2)) AS pingfang |
| | | FROM |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | |
| | | od.quantity, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | d.numCounts + d.patchNumSum - d.numCount -d.broken_num as stockNum, |
| | | d.numCounts + d.patchNumSum - d.numCount -d.broken_num-ifnull(fc.termination_quantity,0) as stockNum, |
| | | ROUND(ogd.child_width * ogd.child_height * |
| | | (d.numCounts + d.patchNumSum - d.numCount - |
| | | d.broken_num) / 1000000, 2) as stockArea, |
| | |
| | | SELECT g.* |
| | | ,GROUP_CONCAT(g.glass_child SEPARATOR '+') as childName |
| | | from( SELECT f.*, |
| | | e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num as quantity, |
| | | (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num)*f.area as glassArea |
| | | if((e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)>0, |
| | | (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity), |
| | | 0 |
| | | ) as quantity, |
| | | if((e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)>0, |
| | | (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity) , |
| | | 0)*f.area as glassArea |
| | | from (SELECT a.order_id, |
| | | if(a.batch!="",CONCAT(a.project,'(',a.batch,')'),a.project) as project, |
| | | C.product_id, |
| | |
| | | b.id, |
| | | c.area, |
| | | d.glass_child, |
| | | ifnull(cb.patchNumSum,0) as patchNumSum |
| | | ifnull(cb.patchNumSum,0) as patchNumSum, |
| | | fc.termination_quantity |
| | | |
| | | FROM sd.`order` as a |
| | | LEFT JOIN sd.order_process_detail as b |
| | |
| | | |
| | | |
| | | ) as h |
| | | where h.quantity >0 |
| | | <choose> |
| | | <when test="optionVal == 1"> |
| | | GROUP BY thisProcess |