| | |
| | | |
| | | </resultMap> |
| | | |
| | | <resultMap id="damageDetailsTableMap" type="com.example.erp.entity.pp.DamageDetails"> |
| | | <resultMap id="damageDetailsTableMap" type="com.example.erp.dto.pp.CrossProcessBreakingDTO"> |
| | | <result column="responsible_process" property="responsibleProcess"/> |
| | | <result column="responsible_team" property="responsibleTeam"/> |
| | | <result column="breakage_type" property="breakageType"/> |
| | | <result column="breakage_reason" property="breakageReason"/> |
| | | <result column="breakage_quantity" property="breakageQuantity"/> |
| | | <result column="area" property="area"/> |
| | | <result column="reporting_work_id" property="reportingWork.reportingWorkId"/> |
| | | <result column="reporting_work_time" property="reportingWork.reportingWorkTime"/> |
| | | <result column="this_process" property="reportingWork.thisProcess"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="order_id" property="order.orderId"/> |
| | | <result column="glass_child" property="orderGlassDetail.glassChild"/> |
| | | <result column="process_id" property="reportingWork.processId"/> |
| | | <result column="reporting_work_time" property="reportingWorkTime"/> |
| | | <result column="this_process" property="thisProcess"/> |
| | | <result column="project" property="project"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="glass_child" property="glassChild"/> |
| | | <result column="process_id" property="processId"/> |
| | | <result column="code" property="code"/> |
| | | </resultMap> |
| | | |
| | |
| | | and dd.available = 0 |
| | | and reviewed_state != 2 |
| | | and rw.this_process != dd.responsible_process |
| | | <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''"> |
| | | and JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) regexp #{crossProcessBreakingDTO.code} |
| | | </if> |
| | | <if test="crossProcessBreakingDTO.processId != null and crossProcessBreakingDTO.processId != ''"> |
| | | and rw.process_id regexp #{crossProcessBreakingDTO.processId} |
| | | </if> |
| | | <if test="crossProcessBreakingDTO.thisProcess != null and crossProcessBreakingDTO.thisProcess != ''"> |
| | | and rw.this_process regexp #{crossProcessBreakingDTO.thisProcess} |
| | | </if> |
| | | <if test="crossProcessBreakingDTO.responsibleProcess != null and crossProcessBreakingDTO.responsibleProcess != ''"> |
| | | and dd.responsible_process regexp #{crossProcessBreakingDTO.responsibleProcess} |
| | | </if> |
| | | <if test="crossProcessBreakingDTO.responsibleTeam != null and crossProcessBreakingDTO.responsibleTeam != ''"> |
| | | and dd.responsible_team regexp #{crossProcessBreakingDTO.responsibleTeam} |
| | | </if> |
| | | GROUP BY dd.id |
| | | order by dd.id desc |
| | | limit #{offset},#{pageSize} |
| | |
| | | ifnull(f.inventory, 0) as inventoryNum, |
| | | round(ifnull(f.inventory, 0) * a.area, 2) as inventoryArea, |
| | | ifnull(dd.quantity, 0) as shippedQuantity, |
| | | ifnull(dd.area, 0) as area |
| | | ifnull(dd.area, 0) as area, |
| | | JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')) AS glassNumber |
| | | |
| | | from flow_card as c |
| | | left join |
| | |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | fc.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | sum( pd.thickness ) as thickness, |
| | | od.edging_type, |
| | | opd.reporting_work_num as completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*opd.reporting_work_num/1000000,2) as area, |
| | | od.product_name, |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code |
| | | FROM |
| | | reporting_work AS rw |
| | | LEFT JOIN reporting_work_detail AS rwd ON rw.reporting_work_id = rwd.reporting_work_id |
| | | LEFT JOIN sd.`order` AS o ON o.order_id = rw.order_id |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | | AND od.order_number = rwd.order_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | AND ogd.order_number = rwd.order_number |
| | | AND ogd.technology_number = rwd.technology_number |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN ( |
| | | SELECT |
| | | prod_id, |
| | | glass_sort, |
| | | REPLACE ( JSON_UNQUOTE( JSON_EXTRACT( separation, '$.thickness' )), 'mm', '' ) AS thickness |
| | | FROM |
| | | sd.product_detail |
| | | WHERE |
| | | detail_type = "glass" |
| | | ) AS pd ON pd.prod_id = od.product_id AND pd.glass_sort = rwd.technology_number |
| | | LEFT JOIN sd.order_process_detail AS opd ON opd.order_id = o.order_id |
| | | AND opd.process_id = rw.process_id |
| | | AND opd.order_number = ogd.order_number |
| | | AND opd.technology_number = ogd.technology_number |
| | | sd.`order` as o left join sd.order_detail as od on od.order_id=o.order_id |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=od.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=ogd.order_number and fc.technology_number=ogd.technology_number |
| | | left join reporting_work as rw on rw.order_id=od.order_id and rw.process_id=fc.process_id |
| | | left join sd.order_process_detail as opd on opd.order_id = o.order_id AND opd.process_id = rw.process_id |
| | | AND opd.order_number = fc.order_number AND opd.technology_number = fc.technology_number and opd.process=rw.this_process |
| | | left join sd.product_detail as pd on pd.prod_id = od.product_id and pd.glass_sort = fc.technology_number and detail_type = "glass" |
| | | where opd.reporting_work_num > 0 and rw.reviewed_state=1 and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{selectProcesses} in rw.this_process) |
| | | <if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''"> |
| | |
| | | <if test="teamOutputDTO.processId != null and teamOutputDTO.processId != ''"> |
| | | and rw.process_id regexp #{teamOutputDTO.processId} |
| | | </if> |
| | | <if test="teamOutputDTO.thickness != null and teamOutputDTO.thickness != ''"> |
| | | and thickness regexp #{teamOutputDTO.thickness} |
| | | </if> |
| | | <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''"> |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | </if> |
| | |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rw.process_id, |
| | | rwd.order_number |
| | | fc.order_number |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | fc.order_number, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name |
| | | limit #{offset},#{pageSize}; |
| | |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | fc.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | sum( pd.thickness ) as thickness, |
| | | od.edging_type, |
| | | opd.reporting_work_num as completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*opd.reporting_work_num/1000000,2) as area, |
| | | od.product_name, |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code |
| | | FROM |
| | | reporting_work AS rw |
| | | LEFT JOIN reporting_work_detail AS rwd ON rw.reporting_work_id = rwd.reporting_work_id |
| | | LEFT JOIN sd.`order` AS o ON o.order_id = rw.order_id |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | | AND od.order_number = rwd.order_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | AND ogd.order_number = rwd.order_number |
| | | AND ogd.technology_number = rwd.technology_number |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN ( |
| | | SELECT |
| | | prod_id, |
| | | glass_sort, |
| | | REPLACE ( JSON_UNQUOTE( JSON_EXTRACT( separation, '$.thickness' )), 'mm', '' ) AS thickness |
| | | FROM |
| | | sd.product_detail |
| | | WHERE |
| | | detail_type = "glass" |
| | | ) AS pd ON pd.prod_id = od.product_id AND pd.glass_sort = rwd.technology_number |
| | | LEFT JOIN sd.order_process_detail AS opd ON opd.order_id = o.order_id |
| | | AND opd.process_id = rw.process_id |
| | | AND opd.order_number = ogd.order_number |
| | | AND opd.technology_number = ogd.technology_number |
| | | sd.`order` as o left join sd.order_detail as od on od.order_id=o.order_id |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=od.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=ogd.order_number and fc.technology_number=ogd.technology_number |
| | | left join reporting_work as rw on rw.order_id=od.order_id and rw.process_id=fc.process_id |
| | | left join sd.order_process_detail as opd on opd.order_id = o.order_id AND opd.process_id = rw.process_id |
| | | AND opd.order_number = fc.order_number AND opd.technology_number = fc.technology_number and opd.process=rw.this_process |
| | | left join sd.product_detail as pd on pd.prod_id = od.product_id and pd.glass_sort = fc.technology_number and detail_type = "glass" |
| | | where opd.reporting_work_num > 0 and rw.reviewed_state=1 |
| | | and date(rw.reporting_work_time) >= #{date[0]} |
| | | 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.this_process, |
| | | rw.teams_groups_name, |
| | | rw.process_id, |
| | | rwd.order_number |
| | | fc.order_number |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | fc.order_number, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name |
| | | </select> |
| | | |
| | | <select id="teamOutputPageTotal"> |
| | | SELECT |
| | | CEILING(count(rwd.id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct rwd.id) as 'total' |
| | | CEILING(count(*)/#{pageSize}) as 'pageTotal', |
| | | count(*) as 'total' |
| | | FROM |
| | | reporting_work AS rw |
| | | LEFT JOIN reporting_work_detail AS rwd ON rw.reporting_work_id = rwd.reporting_work_id |
| | | LEFT JOIN sd.`order` AS o ON o.order_id = rw.order_id |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | | AND od.order_number = rwd.order_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | AND ogd.order_number = rwd.order_number |
| | | AND ogd.technology_number = rwd.technology_number |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN ( |
| | | ( |
| | | SELECT |
| | | prod_id, |
| | | glass_sort, |
| | | REPLACE ( JSON_UNQUOTE( JSON_EXTRACT( separation, '$.thickness' )), 'mm', '' ) AS thickness |
| | | rw.reporting_work_time, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | rw.process_id, |
| | | fc.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | od.edging_type, |
| | | opd.reporting_work_num as completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*opd.reporting_work_num/1000000,2) as area, |
| | | od.product_name, |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code |
| | | FROM |
| | | sd.product_detail |
| | | WHERE |
| | | detail_type = "glass" |
| | | ) AS pd ON pd.prod_id = od.product_id AND pd.glass_sort = rwd.technology_number |
| | | LEFT JOIN sd.order_process_detail AS opd ON opd.order_id = o.order_id |
| | | AND opd.process_id = rw.process_id |
| | | AND opd.order_number = ogd.order_number |
| | | AND opd.technology_number = ogd.technology_number |
| | | sd.`order` as o left join sd.order_detail as od on od.order_id=o.order_id |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=od.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=ogd.order_number and fc.technology_number=ogd.technology_number |
| | | left join reporting_work as rw on rw.order_id=od.order_id and rw.process_id=fc.process_id |
| | | left join sd.order_process_detail as opd on opd.order_id = o.order_id AND opd.process_id = rw.process_id |
| | | AND opd.order_number = fc.order_number AND opd.technology_number = fc.technology_number and opd.process=rw.this_process |
| | | left join sd.product_detail as pd on pd.prod_id = od.product_id and pd.glass_sort = fc.technology_number and detail_type = "glass" |
| | | where opd.reporting_work_num > 0 and rw.reviewed_state=1 and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{selectProcesses} in rw.this_process) |
| | | <if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''"> |
| | |
| | | <if test="teamOutputDTO.processId != null and teamOutputDTO.processId != ''"> |
| | | and rw.process_id regexp #{teamOutputDTO.processId} |
| | | </if> |
| | | <if test="teamOutputDTO.thickness != null and teamOutputDTO.thickness != ''"> |
| | | and thickness regexp #{teamOutputDTO.thickness} |
| | | </if> |
| | | <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''"> |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | </if> |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | GROUP BY |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rw.process_id, |
| | | fc.order_number |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | | fc.order_number, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name |
| | | ) as page_toal |
| | | limit #{offset},#{pageSize} |
| | | </select> |
| | | |
| | | <select id="workInProgressOrderMp" resultMap="workInProgressMap"> |