| | |
| | | where position(#{process} in a.next_process) and a.next_process!='切割' |
| | | GROUP BY a.reporting_work_id |
| | | </select> |
| | | |
| | | <select id="workInProgressCombinationMpdataList2"> |
| | | select |
| | | a.process_id,a.teams_groups_name,a.next_process,b.technology_number,b.order_number |
| | | from pp.reporting_work as a |
| | | left join pp.reporting_work_detail as b on a.reporting_work_id=b.reporting_work_id |
| | | where position(#{selectProcesses} in a.next_process) and a.next_process!='切割' |
| | | GROUP BY a.reporting_work_id |
| | | </select> |
| | | |
| | | <select id="workInProgressCombinationMpdataList1"> |
| | | select if(#{selectProcesses}='',d.process,#{selectProcesses}) as thisProcess, |
| | | o.project, |
| | | SUM(d.numCounts + d.patchNumSum - d.numCount -d.broken_num) as stockNum, |
| | | SUM(ROUND(ogd.child_width * ogd.child_height * |
| | | (d.numCounts + d.patchNumSum - d.numCount - |
| | | d.broken_num) / 1000000, 2)) as stockArea |
| | | 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 pp.flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | and fc.production_id = ogd.production_id |
| | | AND fc.order_number = ogd.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | left join ( |
| | | SELECT |
| | | odpd.process, |
| | | odpd.process_id, |
| | | odpd.order_number, |
| | | odpd.technology_number, |
| | | odpds.reporting_work_num_count as numCounts, |
| | | ifnull( c.patchNumSum, 0 ) as patchNumSum, |
| | | odpd.reporting_work_num_count as numCount, |
| | | odpd.broken_num |
| | | FROM |
| | | sd.order_process_detail AS odpd |
| | | LEFT JOIN sd.order_process_detail AS odpds ON odpds.id = odpd.id - 1 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | sum( rw.rework_num ) AS 'patchNumSum', |
| | | rw.process_id, |
| | | rw.order_sort, |
| | | rw.technology_number, |
| | | rwk.this_process |
| | | FROM |
| | | pp.rework AS rw |
| | | LEFT JOIN pp.reporting_work AS rwk ON rw.reporting_work_id = rwk.reporting_work_id |
| | | WHERE |
| | | position( #{selectProcesses} IN rwk.this_process ) |
| | | AND rw.review_status >= 0 |
| | | GROUP BY |
| | | rw.process_id, |
| | | rw.order_sort, |
| | | rw.technology_number |
| | | ) AS c ON c.process_id = odpd.process_id |
| | | AND c.order_sort = odpd.order_number |
| | | AND c.technology_number = odpd.technology_number |
| | | WHERE |
| | | position(#{selectProcesses} IN odpd.process ) and odpds.reporting_work_num_count is not null |
| | | GROUP BY |
| | | odpd.process_id, |
| | | odpd.order_number, |
| | | odpd.technology_number, |
| | | odpd.process |
| | | |
| | | ) as d |
| | | on d.process_id=fc.process_id and d.order_number=fc.order_number and d.technology_number=fc.technology_number |
| | | and position(#{selectProcesses} in d.process) |
| | | left join sd.`order` as o on o.order_id=od.order_id |
| | | where o.create_order>0 |
| | | and d.numCounts +d.patchNumSum - d.numCount - d.broken_num != 0 |
| | | and d.process!=SUBSTRING_INDEX(ogd.process, '->', 1) |
| | | and position(#{selectProcesses} in d.process) |
| | | |
| | | <if test="workInProgressDTO.project != null and workInProgressDTO.project != ''"> |
| | | and o.project regexp #{workInProgressDTO.project} |
| | | </if> |
| | | |
| | | group by d.process |
| | | order by d.process |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | </mapper> |