| | |
| | | a.area, |
| | | a.quantity, |
| | | a.create_time, |
| | | round(ifnull(d.finishNum, 0) / a.quantity * 100) as 'percent', |
| | | ifnull(d.finishNum, 0) |
| | | round(ifnull(d.finishNum, 0) / a.quantity * 100) as 'percent', ifnull(d.finishNum, 0) |
| | | from sd.`order` as a |
| | | LEFT JOIN ( |
| | | SELECT sum(c.reporting_work_num) as 'finishNum',order_id |
| | |
| | | ) as d |
| | | on a.order_id = d.order_id |
| | | where a.warehousing != 2 and a.warehousing >= 0 |
| | | ORDER BY a.order_id desc |
| | | ORDER BY a.order_id desc |
| | | </select> |
| | | <select id="queryOrderByFlowCardId" resultType="com.mes.order.entity.HollowOrderDTO"> |
| | | select t1.* |
| | | from pp.flow_card t |
| | | inner join sd.order t1 on t.order_id = t1.order_id |
| | | where t.process_id = #{flowCardId} |
| | | limit 1 |
| | | where t.process_id = #{flowCardId} limit 1 |
| | | </select> |
| | | <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMapHollowDetail"> |
| | | <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMapHollowDetail"> |
| | | with temp_flow as (SELECT t.process_id, |
| | | t.order_id, |
| | | t.order_number, |
| | |
| | | select min(order_id) as order_id, min(order_number) as order_number |
| | | from pp.flow_card |
| | | where process_id = #{flowCardId} |
| | | ) |
| | | limit 1 |
| | | ) limit 1 |
| | | </select> |
| | | <select id="queryLackByERP" resultType="com.mes.order.entity.ProcessCardReport"> |
| | | select a.*, |
| | | (b.quantity - b.termination_quantity) as 'quantity', |
| | | (b.quantity - b.termination_quantity - reporting_work_num) as 'lack_quantity' |
| | | from order_process_detail as a |
| | | inner join pp.flow_card as b |
| | | on a.order_id = b.order_id |
| | | and a.process_id = b.process_id |
| | | and a.order_number = b.order_number |
| | | and a.technology_number = b.technology_number |
| | | where termination_status = 0 |
| | | and a.process_id = #{flowCardId} |
| | | and a.process = "中空" |
| | | and (b.quantity - b.termination_quantity) > reporting_work_num |
| | | </select> |
| | | </mapper> |