| | |
| | | ifnull(g.completed_quantity,0) as nextQuantitySum, -- 后工序已完成 |
| | | if((f.completed_quantity |
| | | -ifnull(g.completed_quantity,0)) |
| | | >= |
| | | > |
| | | a.completed_quantity, |
| | | 0, |
| | | (a.completed_quantity-f.completed_quantity |
| | | +ifnull(g.completed_quantity,0)) |
| | | (f.completed_quantity |
| | | -ifnull(g.completed_quantity,0)) |
| | | ) as minQuantity -- 修改最小数 |
| | | </if> |
| | | <if test="nextProcess == null or nextProcess == ''"> -- 最后一道工序 |
| | |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | and o.create_order>0 |
| | |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | and o.create_order>0 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | |
| | | |
| | | left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2} |
| | | and position(#{processId} in rw.process_id) |
| | | and position(#{state} in dd.quality_ins_status) |
| | | and rw.reviewed_state!=-1 |
| | |
| | | |
| | | left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2} |
| | | and position(#{processId} in rw.process_id) |
| | | and position(#{state} in dd.quality_ins_status) |
| | | and rw.reviewed_state!=-1 |