| | |
| | | <result column="glass_child" property="glassChild"/> |
| | | <result column="process_id" property="processId"/> |
| | | <result column="code" property="code"/> |
| | | <result column="responsible_personnel" property="responsiblePersonnel"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | dd.responsible_team, |
| | | dd.breakage_type, |
| | | dd.breakage_reason, |
| | | dd.responsible_personnel, |
| | | ROUND((dd.breakage_quantity)) as breakage_quantity, |
| | | round(ogd.child_width * ogd.child_height * (dd.breakage_quantity) / 1000000, 2) as area, |
| | | rw.this_process, |
| | |
| | | <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''"> |
| | | and o.order_id regexp #{crossProcessBreakingDTO.orderId} |
| | | </if> |
| | | <if test="crossProcessBreakingDTO.responsiblePersonnel != null and crossProcessBreakingDTO.responsiblePersonnel != ''"> |
| | | and dd.responsible_personnel regexp #{crossProcessBreakingDTO.responsiblePersonnel} |
| | | </if> |
| | | GROUP BY dd.id |
| | | order by dd.id desc |
| | | limit #{offset},#{pageSize} |
| | |
| | | </if> |
| | | <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''"> |
| | | and o.order_id regexp #{crossProcessBreakingDTO.orderId} |
| | | </if> |
| | | <if test="crossProcessBreakingDTO.responsiblePersonnel != null and crossProcessBreakingDTO.responsiblePersonnel != ''"> |
| | | and dd.responsible_personnel regexp #{crossProcessBreakingDTO.responsiblePersonnel} |
| | | </if> |
| | | order by dd.id desc |
| | | </select> |
| | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="selectProcessCompletedMp"> |
| | | SELECT |
| | | #{selectProcesses} as process, |
| | | hz.project,hz.batch, |
| | | SUM(quantity) as quantity, |
| | | SUM(childArea)as childArea, |
| | | SUM(actualArea) as actualArea, |
| | | SUM(completeNum) as completeNum, |
| | | SUM(completeArea) as completeArea, |
| | | SUM(incompleteNum) as incompleteNum, |
| | | SUM(incompleteArea) as incompleteArea, |
| | | hz.glass_child |
| | | from ( |
| | | select DATE(o.create_time) as create_time, |
| | | DATE(o.delivery_date) as delivery_date, |
| | | o.order_id, |
| | | fc.process_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.batch, |
| | | od.order_number, |
| | | ogd.technology_number, |
| | | ogd.glass_child, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | fc.quantity - ifnull(fc.termination_quantity,0) as quantity, |
| | | ROUND(ogd.child_width * ogd.child_height / 1000000, 2) as childArea, |
| | | ROUND(ogd.child_width * ogd.child_height * (fc.quantity- ifnull(fc.termination_quantity,0)) / 1000000, 2) as actualArea, |
| | | odpd.reporting_work_num as completeNum, |
| | | ROUND(ogd.child_width * ogd.child_height * odpd.reporting_work_num / 1000000, |
| | | 2) as completeArea, |
| | | fc.quantity - odpd.reporting_work_num - ifnull(fc.termination_quantity,0) as incompleteNum, |
| | | ROUND(ogd.child_width * ogd.child_height * (fc.quantity - odpd.reporting_work_num- ifnull(fc.termination_quantity,0)) / 1000000, |
| | | 2) as incompleteArea, |
| | | 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` as o |
| | | on o.order_id = od.order_id |
| | | where o.create_order>0 |
| | | and odpd.process = #{selectProcesses} |
| | | and o.create_time >= #{selectTime1} |
| | | AND o.create_time < #{selectTime2} |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | and GREATEST(fc.quantity - odpd.reporting_work_num, 0)>0 |
| | | and fc.quantity-ifnull(fc.termination_quantity,0)>0 |
| | | GROUP BY fc.process_id, fc.order_number, fc.technology_number |
| | | order by fc.process_id, fc.order_number, fc.technology_number |
| | | ) as hz |
| | | GROUP BY hz.project,hz.batch,glass_child |
| | | </select> |
| | | |
| | | |
| | | </mapper> |