| | |
| | | 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 |