| | |
| | | <result column="personnel" property="personnel"/> |
| | | <result column="glass_child" property="glassChild"/> |
| | | <result column="glassNumber" property="glassNumber"/> |
| | | <result column="child_width" property="childWidth"/> |
| | | <result column="child_height" property="childHeight"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="teamOutputMap" type="com.example.erp.dto.pp.TeamOutputDTO"> |
| | |
| | | <result column="area" property="area"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="code" property="code"/> |
| | | <result column="reviewed" property="reviewed"/> |
| | | <result column="examine_time" property="examineTime"/> |
| | | <result column="workProcessName" property="workProcessName"/> |
| | | <result column="device_name" property="deviceName"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="scheduleProductionScheduleMap" type="com.example.erp.dto.pp.ScheduleProductionScheduleDTO"> |
| | |
| | | concat(c.process_id, '/', c.technology_number) as process_id, |
| | | c.order_number, |
| | | c.technology_number, |
| | | b.child_width, |
| | | b.child_height, |
| | | c.quantity, |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityCount, |
| | | e.reportWorkTime, |
| | | e.broken_num, |
| | | c.quantity*a.area as gross_area, |
| | | ifnull(f.inventory, 0) as inventory, |
| | | round(ifnull(f.inventory, 0) * a.area, 2) as inventoryArea, |
| | | ifnull(dd.quantity, 0) as shippedQuantity, |
| | |
| | | round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) as area, |
| | | IFNULL(dd.responsible_personnel,'') as personnel, |
| | | ogd.glass_child, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber |
| | | FROM |
| | | sd.ORDER AS o |
| | |
| | | fc.quantity, |
| | | round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area, |
| | | if(od.shape='' || ISNULL(od.shape),'普形',if(od.shape = 1, '普形', if(od.shape = 2, '异形', ''))) as shape, |
| | | od.remarks |
| | | FROM sd.ORDER AS o |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = od.order_id |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON o.order_id = ogd.order_id |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = ogd.order_id |
| | | AND fc.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | od.remarks, |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS S01, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')) AS S02, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S03')) AS S03, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')) AS S04, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S05')) AS S05 |
| | | FROM |
| | | flow_card as fc left join sd.order_glass_detail as ogd on ogd.order_id=fc.order_id and ogd.order_number=ogd.order_number and ogd.technology_number=fc.technology_number |
| | | left join sd.order_detail as od on od.order_id=fc.order_id and od.order_number=fc.order_number |
| | | left join sd.`order` as o on o.order_id=fc.order_id |
| | | WHERE fc.order_id = #{orderId} |
| | | GROUP BY fc.id |
| | | order by fc.order_number,fc.technology_number |
| | | </select> |
| | | |
| | | <select id="qualityReportMp"> |
| | |
| | | dd.breakage_quantity, |
| | | round(ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2) as area, |
| | | IFNULL(dd.responsible_personnel, '') as personnel, |
| | | ogd.glass_child |
| | | ogd.glass_child, |
| | | ogd.child_width, |
| | | ogd.child_height |
| | | 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> |
| | | |
| | | <select id="exportWorkInProgressMp"> |
| | | select #{process} as thisProcess, |
| | | select if(#{process}='',odpd.process,#{process}) as thisProcess, |
| | | fc.process_id, |
| | | o.customer_name, |
| | | o.project, |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num as stockNum, |
| | | odpd.broken_num as stockNum, |
| | | ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2) as stockArea, |
| | | odpd.broken_num) / 1000000, 2) as stockArea, |
| | | od.product_name, |
| | | od.bend_radius |
| | | od.bend_radius, |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber |
| | | |
| | | from sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | |
| | | ON odpds.id = odpd.id - 1 |
| | | left join |
| | | (SELECT sum(rw.rework_num) as 'patchNumSum', |
| | | rw.process_id, |
| | | rw.process_id, |
| | | rw.order_sort, |
| | | rw.technology_number, |
| | | rwk.this_process |
| | |
| | | LEFT JOIN |
| | | reporting_work as rwk |
| | | on rw.reporting_work_id = rwk.reporting_work_id |
| | | where rwk.this_process = #{process} |
| | | where position(#{process} in rwk.this_process) |
| | | and 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 = fc.process_id |
| | |
| | | on o.order_id = od.order_id |
| | | where o.create_order>0 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 |
| | | and odpd.process = #{process} |
| | | odpd.broken_num != 0 and odpd.process!='切割' |
| | | and position(#{process} in odpd.process) |
| | | and position(ifnull(#{inputVal}, '') in od.order_id) |
| | | and position(ifnull(#{project}, '') in o.project) |
| | | |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | group by fc.process_id, fc.order_number, fc.technology_number,odpd.process |
| | | order by fc.process_id, fc.order_number, fc.technology_number |
| | | </select> |
| | | |
| | |
| | | rwd.completed_quantity as completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*rwd.completed_quantity/1000000,2) as area, |
| | | od.product_name, |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code, |
| | | rw.reviewed, |
| | | rw.examine_time, |
| | | rw.device_name, |
| | | -- GROUP_CONCAT(ogd.glass_child SEPARATOR '+') as workProcessName |
| | | CASE |
| | | WHEN LOCATE('step',#{laminating})>0 THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+') |
| | | ELSE MAX( ogd.glass_child ) |
| | | END AS workProcessName |
| | | FROM |
| | | reporting_work as rw left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id |
| | | left join flow_card as fc on fc.order_id=rw.order_id and fc.process_id=rw.process_id and fc.order_number=rwd.order_number and fc.technology_number=rwd.technology_number |
| | |
| | | <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''"> |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | </if> |
| | | <if test="teamOutputDTO.deviceName != null and teamOutputDTO.deviceName != ''"> |
| | | and rw.device_name regexp #{teamOutputDTO.deviceName} |
| | | </if> |
| | | |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | <choose> |
| | | <when test="laminating == ''"> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number, |
| | | rwd.technology_number |
| | | </when> |
| | | <otherwise> |
| | | GROUP BY |
| | | <if test="laminating == 'stepA' || laminating == 'stepC'" > |
| | | ogd.`group`, |
| | | </if> |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | |
| | | </otherwise> |
| | | </choose> |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | |
| | | rwd.completed_quantity as completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*rwd.completed_quantity/1000000,2) as area, |
| | | od.product_name, |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code, |
| | | rw.reviewed, |
| | | rw.examine_time, |
| | | rw.device_name, |
| | | CASE |
| | | WHEN LOCATE('step',#{laminating})>0 THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+') |
| | | ELSE MAX( ogd.glass_child ) |
| | | END AS workProcessName |
| | | FROM |
| | | reporting_work as rw left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id |
| | | left join flow_card as fc on fc.order_id=rw.order_id and fc.process_id=rw.process_id and fc.order_number=rwd.order_number and fc.technology_number=rwd.technology_number |
| | |
| | | left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.`order` as o on o.order_id=od.order_id |
| | | where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 |
| | | and date(rw.reporting_work_time) >= #{date[0]} |
| | | and date(rw.reporting_work_time) <= #{date[1]} |
| | | and date(rw.reporting_work_time) >= #{date[0]} |
| | | and date(rw.reporting_work_time) <= #{date[1]} |
| | | and position(#{process} in rw.this_process) |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | <choose> |
| | | <when test="laminating == ''"> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number, |
| | | rwd.technology_number |
| | | </when> |
| | | <otherwise> |
| | | GROUP BY |
| | | <if test="laminating == 'stepA' || laminating == 'stepC'" > |
| | | ogd.`group`, |
| | | </if> |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | </otherwise> |
| | | </choose> |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | </if> |
| | | |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | <choose> |
| | | <when test="laminating == ''"> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number, |
| | | rwd.technology_number |
| | | </when> |
| | | <otherwise> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | </otherwise> |
| | | </choose> |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | |
| | | </select> |
| | | |
| | | <select id="workInProgressOrderFootSum"> |
| | | SELECT |
| | | SUM(od.quantity) AS quantity, |
| | | SUM(odpds.reporting_work_num_count + IFNULL(c.patchNumSum, 0) - odpd.reporting_work_num_count - odpd.broken_num) AS stockNum, |
| | | SUM(ROUND(ogd.child_width * ogd.child_height * |
| | | SELECT SUM(aa.quantity) AS quantity, |
| | | sum(aa.stockNum) AS stockNum, |
| | | SUM(aa.stockArea) AS stockArea, |
| | | count(* ) AS 'total', |
| | | CEILING( count(* )/#{pageSize} ) AS 'pageTotal' |
| | | from |
| | | ( |
| | | SELECT (od.quantity) AS quantity, |
| | | (odpds.reporting_work_num_count + IFNULL(c.patchNumSum, 0) - odpd.reporting_work_num_count - odpd.broken_num) AS stockNum, |
| | | (ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + IFNULL(c.patchNumSum, 0) - odpd.reporting_work_num_count - odpd.broken_num) / 1000000, 2)) AS stockArea |
| | | FROM sd.order_detail AS od |
| | | 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 flow_card AS fc |
| | | LEFT JOIN pp.flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | AND fc.production_id = ogd.production_id |
| | | and fc.production_id = ogd.production_id |
| | | AND fc.order_number = ogd.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | LEFT JOIN sd.order_process_detail AS odpd |
| | | left join sd.order_process_detail as odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | AND odpd.process_id = fc.process_id |
| | | LEFT JOIN sd.order_process_detail AS odpds |
| | | and odpd.process_id = fc.process_id |
| | | left join sd.order_process_detail as odpds |
| | | ON odpds.id = odpd.id - 1 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | SUM(rw.rework_num) AS patchNumSum, |
| | | left join |
| | | (SELECT sum(rw.rework_num) as 'patchNumSum', |
| | | rw.process_id, |
| | | rw.order_sort, |
| | | rw.technology_number, |
| | | rwk.this_process |
| | | FROM rework AS rw |
| | | LEFT JOIN reporting_work AS rwk |
| | | ON rw.reporting_work_id = rwk.reporting_work_id |
| | | WHERE rwk.this_process = #{selectProcesses} |
| | | AND rw.review_status >= 0 |
| | | GROUP BY rw.process_id, rw.order_sort, rw.technology_number |
| | | ) AS c |
| | | ON c.process_id = fc.process_id |
| | | AND c.order_sort = fc.order_number |
| | | AND c.technology_number = fc.technology_number |
| | | LEFT JOIN sd.`order` AS o |
| | | ON o.order_id = od.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.process_id, |
| | | a.teams_groups_name, |
| | | a.next_process, |
| | | b.technology_number, |
| | | b.order_number |
| | | FROM reporting_work AS a |
| | | LEFT JOIN reporting_work_detail AS b |
| | | ON a.reporting_work_id = b.reporting_work_id |
| | | GROUP BY a.process_id, a.teams_groups_name, a.next_process, b.order_number, b.technology_number |
| | | ) AS rws |
| | | ON rws.process_id = fc.process_id |
| | | AND rws.order_number = fc.order_number |
| | | AND rws.technology_number = fc.technology_number |
| | | AND rws.next_process = #{selectProcesses} |
| | | WHERE o.create_order > 0 |
| | | AND odpds.reporting_work_num_count + IFNULL(c.patchNumSum, 0) - odpd.reporting_work_num_count - odpd.broken_num != 0 |
| | | and odpd.process = #{selectProcesses} |
| | | from pp.rework as rw |
| | | LEFT JOIN |
| | | pp.reporting_work as rwk |
| | | on rw.reporting_work_id = rwk.reporting_work_id |
| | | where position(rwk.this_process in #{selectProcesses}) |
| | | and 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 = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | left join sd.`order` as o |
| | | on o.order_id = od.order_id |
| | | WHERE |
| | | o.create_order>0 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 and odpd.process!='切割' |
| | | and position(#{selectProcesses} in odpd.process) |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | <if test="workInProgressDTO.customerName != null and workInProgressDTO.customerName != ''"> |
| | |
| | | <if test="workInProgressDTO.processId != null and workInProgressDTO.processId != ''"> |
| | | and fc.process_id regexp #{workInProgressDTO.processId} |
| | | </if> |
| | | order by o.order_id, fc.process_id |
| | | group by fc.process_id, fc.order_number, fc.technology_number,odpd.process |
| | | ) as aa |
| | | |
| | | </select> |
| | | |
| | | <select id="processToBeCompletedFootSum"> |
| | |
| | | <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''"> |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | </if> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | <choose> |
| | | <when test="laminating == ''"> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number, |
| | | rwd.technology_number |
| | | </when> |
| | | <otherwise> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | </otherwise> |
| | | </choose> |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | |
| | | rw.teams_groups_name |
| | | ) as subquery |
| | | </select> |
| | | |
| | | <select id="getLaminating"> |
| | | select IFNULL(nickname,'') from sd.basic_data where basic_category='process' and basic_name=#{selectProcesses} |
| | | </select> |
| | | |
| | | <select id="workInProgressMpdataList1" resultMap="workInProgressMap"> |
| | | select if(#{selectProcesses}='',odpd.process,#{selectProcesses}) as thisProcess, |
| | | fc.process_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.order_id, |
| | | o.batch, |
| | | od.shape, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.process, |
| | | od.quantity, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num as stockNum, |
| | | ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2) as stockArea, |
| | | od.product_name, |
| | | od.bend_radius, |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber |
| | | -- , |
| | | -- rws.teams_groups_name |
| | | |
| | | 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 sd.order_process_detail as odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | 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 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 = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | left join sd.`order` as o |
| | | on o.order_id = od.order_id |
| | | where o.create_order>0 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 and odpd.process!='切割' |
| | | and position(#{selectProcesses} in odpd.process) |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | <if test="workInProgressDTO.customerName != null and workInProgressDTO.customerName != ''"> |
| | | and o.customer_name regexp #{workInProgressDTO.customerName} |
| | | </if> |
| | | <if test="workInProgressDTO.project != null and workInProgressDTO.project != ''"> |
| | | and o.project regexp #{workInProgressDTO.project} |
| | | </if> |
| | | <if test="workInProgressDTO.orderId != null and workInProgressDTO.orderId != ''"> |
| | | and o.order_id regexp #{workInProgressDTO.orderId} |
| | | </if> |
| | | <if test="workInProgressDTO.batch != null and workInProgressDTO.batch != ''"> |
| | | and o.batch regexp #{workInProgressDTO.batch} |
| | | </if> |
| | | <if test="workInProgressDTO.processId != null and workInProgressDTO.processId != ''"> |
| | | and fc.process_id regexp #{workInProgressDTO.processId} |
| | | </if> |
| | | <if test="workInProgressDTO.orderNumber != null and workInProgressDTO.orderNumber != ''"> |
| | | and ogd.order_number regexp #{workInProgressDTO.orderNumber} |
| | | </if> |
| | | <if test="workInProgressDTO.technologyNumber != null and workInProgressDTO.technologyNumber != ''"> |
| | | and ogd.technology_number regexp #{workInProgressDTO.technologyNumber} |
| | | </if> |
| | | <if test="workInProgressDTO.glassNumber != null and workInProgressDTO.glassNumber != ''"> |
| | | and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{workInProgressDTO.glassNumber} |
| | | </if> |
| | | group by fc.process_id, fc.order_number, fc.technology_number,odpd.process |
| | | order by fc.process_id, fc.order_number, fc.technology_number |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="workInProgressMpdataList2" resultMap="workInProgressMap"> |
| | | 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="workInProgressOrderMpList1" resultMap="workInProgressMap"> |
| | | select if(#{selectProcesses}='',odpd.process,#{selectProcesses}) as thisProcess, |
| | | o.customer_name, |
| | | o.project, |
| | | o.order_id, |
| | | o.batch, |
| | | od.shape, |
| | | sum(od.quantity) as quantity, |
| | | sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) as stockNum, |
| | | sum(ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2)) as stockArea, |
| | | od.product_name |
| | | |
| | | 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 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 sd.order_process_detail as odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | 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 rework as rw |
| | | LEFT JOIN |
| | | reporting_work as rwk |
| | | on rw.reporting_work_id = rwk.reporting_work_id |
| | | where position(#{selectProcesses} in rwk.this_process) |
| | | and 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 = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | left join sd.`order` as o |
| | | on o.order_id = od.order_id |
| | | where o.create_order>0 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 and odpd.process!='切割' |
| | | and position(#{selectProcesses} in odpd.process) |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | <if test="workInProgressDTO.customerName != null and workInProgressDTO.customerName != ''"> |
| | | and o.customer_name regexp #{workInProgressDTO.customerName} |
| | | </if> |
| | | <if test="workInProgressDTO.project != null and workInProgressDTO.project != ''"> |
| | | and o.project regexp #{workInProgressDTO.project} |
| | | </if> |
| | | <if test="workInProgressDTO.orderId != null and workInProgressDTO.orderId != ''"> |
| | | and o.order_id regexp #{workInProgressDTO.orderId} |
| | | </if> |
| | | <if test="workInProgressDTO.batch != null and workInProgressDTO.batch != ''"> |
| | | and o.batch regexp #{workInProgressDTO.batch} |
| | | </if> |
| | | group by o.order_id |
| | | order by o.order_id |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="workInProgressProcessMpList1" resultMap="workInProgressMap"> |
| | | select if(#{selectProcesses}='',odpd.process,#{selectProcesses}) as thisProcess, |
| | | o.customer_name, |
| | | o.project, |
| | | o.order_id, |
| | | fc.process_id, |
| | | o.batch, |
| | | od.shape, |
| | | sum(od.quantity) as quantity, |
| | | sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) as stockNum, |
| | | sum(ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2)) as stockArea, |
| | | od.product_name |
| | | |
| | | 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 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 sd.order_process_detail as odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | 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 rework as rw |
| | | LEFT JOIN |
| | | reporting_work as rwk |
| | | on rw.reporting_work_id = rwk.reporting_work_id |
| | | where position(#{selectProcesses} in rwk.this_process) |
| | | and 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 = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | left join sd.`order` as o |
| | | on o.order_id = od.order_id |
| | | where o.create_order>0 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 and odpd.process!='切割' |
| | | and position(#{selectProcesses} in odpd.process) |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | <if test="workInProgressDTO.customerName != null and workInProgressDTO.customerName != ''"> |
| | | and o.customer_name regexp #{workInProgressDTO.customerName} |
| | | </if> |
| | | <if test="workInProgressDTO.project != null and workInProgressDTO.project != ''"> |
| | | and o.project regexp #{workInProgressDTO.project} |
| | | </if> |
| | | <if test="workInProgressDTO.orderId != null and workInProgressDTO.orderId != ''"> |
| | | and o.order_id regexp #{workInProgressDTO.orderId} |
| | | </if> |
| | | <if test="workInProgressDTO.batch != null and workInProgressDTO.batch != ''"> |
| | | and o.batch regexp #{workInProgressDTO.batch} |
| | | </if> |
| | | <if test="workInProgressDTO.processId != null and workInProgressDTO.processId != ''"> |
| | | and fc.process_id regexp #{workInProgressDTO.processId} |
| | | </if> |
| | | group by o.order_id, fc.process_id |
| | | order by o.order_id, fc.process_id |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="exportWorkInProgressMpdataList2"> |
| | | 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(#{process} in a.next_process) and a.next_process!='切割' |
| | | GROUP BY a.reporting_work_id |
| | | </select> |
| | | </mapper> |