| | |
| | | where fc.process_id = #{processIdStr} |
| | | and POSITION(fc.technology_number in #{technologyStr}) |
| | | and if(#{reportType}=1,o.order_type!='样品订单',o.order_id!='') |
| | | and o.create_order>0 |
| | | GROUP BY fc.process_id |
| | | </select> |
| | | |
| | |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | AND odpd.process = #{process} |
| | | and if(#{reportType}=1,o.order_type!='样品订单',o.order_id!='') |
| | | and o.create_order>0 |
| | | group by fc.order_number, |
| | | ogd.technology_number |
| | | order by fc.order_number |
| | |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | <if test="process == '夹胶' or (process == '打胶和粘框' and previousProcess=='夹胶')"> |
| | | <if test="process == '夹胶' or (process == '打胶和粘框')"> |
| | | AND ogd.`group` = (select `group` |
| | | from sd.order_glass_detail |
| | | where order_id = ogd.order_id |
| | |
| | | |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | <if test="process != '中空' and process != '夹胶' and process != '包装' and process != '打胶和粘框' "> |
| | | <if test="laminating != 'laminating'"> |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | </if> |
| | | AND odpd.process = #{process} |
| | |
| | | </select> |
| | | <select id="selectGlassProcessNum" resultType="java.lang.Integer"> |
| | | select |
| | | if((d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)< 0, |
| | | ifnull(if((d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)< 0, |
| | | 0, |
| | | (d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num) |
| | | ) |
| | | ),0) |
| | | from flow_card as a |
| | | left join sd.order_process_detail as b |
| | | on |
| | |
| | | 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 DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2} |
| | | and rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{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 DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{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 sd.order_glass_detail AS ogd |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | <if test="process == '夹胶' or (process == '打胶和粘框' and previousProcess=='夹胶')"> |
| | | <if test="process == '夹胶' or (process == '打胶和粘框')"> |
| | | AND ogd.`group` = (select `group` |
| | | from sd.order_glass_detail |
| | | where order_id = ogd.order_id |
| | |
| | | from reporting_work as a |
| | | left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id= #{processIdStr} |
| | | and POSITION(b.technology_number in #{technologyStr}) |
| | | |
| | | GROUP BY a.reporting_work_id,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 |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | <if test="process != '中空' and process != '夹胶' and process != '包装' and process != '打胶和粘框' "> |
| | | <if test="laminating != 'laminating' "> |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | </if> |
| | | AND odpd.process = #{process} |
| | | and rws.reviewed_state=0 |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | | <select id="getProcessLaminating"> |
| | | select IFNULL(nickname,'') from sd.basic_data where basic_category='process' and basic_name=#{process} |
| | | </select> |
| | | |
| | | <select id="selectOrderid"> |
| | | select order_id from pp.flow_card where process_id=#{processIdStr} group by order_id |
| | | </select> |
| | | </mapper> |