| | |
| | | </select> |
| | | |
| | | <select id="SelectWorkBasicTeamsMp"> |
| | | select * from erp_user_info.`user` WHERE address=#{process} |
| | | select id,login_name,user_name,address from erp_user_info.`user` WHERE address=#{process} |
| | | </select> |
| | | |
| | | <!-- 查询流程卡工艺流程--> |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num as quantity, |
| | | fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num as completedQuantity, |
| | | fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num - ifnull(fc.termination_quantity,0) as quantity, |
| | | fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num - ifnull(fc.termination_quantity,0) as completedQuantity, |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | od.other_columns |
| | | if(ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'')!='', |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),''), |
| | | od.building_number) as s01Value |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | |
| | | 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 |
| | | and o.create_order>0 and fc.quantity - ifnull(fc.termination_quantity,0)>0 |
| | | group by fc.order_number, |
| | | ogd.technology_number |
| | | order by fc.order_number |
| | |
| | | ogd.`group`, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | od.other_columns, |
| | | ogd.id as 'glassId',IFNULL(rws.reviewed_state,0) as reviewed_state |
| | | ogd.id as 'glassId',IFNULL(rws.reviewed_state,0) as reviewed_state, |
| | | if(ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'')!='', |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),''), |
| | | od.building_number) as s01Value |
| | | |
| | | FROM |
| | | sd.order_detail AS od |
| | |
| | | |
| | | <select id="historyTeamsMp"> |
| | | SELECT |
| | | bdp.id, |
| | | bdp.basic_type, |
| | | bd.id, |
| | | bd.basic_type, |
| | | rw.teams as basic_name, |
| | | bd.basic_name,bd.id AS basic_category, |
| | | rw.process |
| | |
| | | |
| | | <!--查询修改报工明细数据--> |
| | | <select id="selectByReportingWorkId" > |
| | | select |
| | | select * from(select |
| | | a.reporting_work_id, |
| | | d.order_number, |
| | | d.glass_child, |
| | |
| | | d.child_height, |
| | | if(e.shape=1,'普形',if(e.shape=2,'异形','')) as shape, |
| | | if(ifnull(a.completed_quantity+a.breakage_quantity,0)=0, |
| | | c.quantity-ifnull(a.completed_quantity+a.breakage_quantity,0), |
| | | 0, |
| | | ifnull(a.completed_quantity+a.breakage_quantity,0)) as 'quantity', -- 可报工数 |
| | | ifnull(a.completed_quantity,0) as 'completedQuantity', -- 完工数 |
| | | ifnull(a.completed_quantity,0) as 'completedQuantityComputed', -- 完工数 |
| | | ifnull(a.breakage_quantity,0) as 'breakageQuantity', -- 破损数 |
| | | ifnull(f.completed_quantity,0) as thisQuantitySum ,-- 本工序完工和 |
| | | if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag, |
| | | e.other_columns, |
| | | if(ifnull(JSON_UNQUOTE(JSON_EXTRACT(e.other_columns, '$.S01')),'')!='', |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(e.other_columns, '$.S01')),''), |
| | | e.building_number) as s01Value, |
| | | IF(count(pl.id)>0,'已补片','') as patchStatusOther, |
| | | |
| | | <if test="nextProcess != null and nextProcess != ''"> -- 非最后一道工序 |
| | |
| | | -ifnull(g.completed_quantity,0)) |
| | | > |
| | | a.completed_quantity, |
| | | a.completed_quantity, |
| | | (a.completed_quantity+ a.breakage_quantity), |
| | | (f.completed_quantity |
| | | -ifnull(g.completed_quantity,0)) |
| | | ) as minQuantity -- 修改最小数 |
| | | </if> |
| | | <if test="nextProcess == null or nextProcess == ''"> -- 最后一道工序 |
| | | # c.received_quantity, -- 已入库数量 |
| | | # c.inventory_quantity, -- 库存数量 |
| | | c.received_quantity, -- 已入库数量 |
| | | c.inventory_quantity, -- 库存数量 |
| | | if(ifnull(inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0) |
| | | >= a.completed_quantity,0, |
| | | (a.completed_quantity-(ifnull(c.inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0))) |
| | | >= a.completed_quantity,a.completed_quantity, |
| | | (ifnull(c.inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0)) |
| | | ) |
| | | as minQuantity -- 修改最小数 |
| | | </if> |
| | |
| | | from reporting_work as rw |
| | | left join reporting_work_detail as rwd |
| | | on rw.reporting_work_id = rwd.reporting_work_id |
| | | where rw.reviewed_state>-1 |
| | | group by rw.process_id, |
| | | rw.this_process, |
| | | rwd.order_number, |
| | |
| | | </if> |
| | | where b.reporting_work_id = #{reportingWorkId} |
| | | GROUP BY c.order_number,c.technology_number |
| | | order BY c.order_number,c.technology_number) as result |
| | | </select> |
| | | <select id="selectReportingWorkMp" resultMap="reportingWorkMap"> |
| | | select rw.reporting_work_id, |
| | |
| | | |
| | | left join sd.`order` as o on o.order_id=rw.order_id |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{selectTime2} |
| | | and date(rw.reporting_work_time) >= date(#{selectTime1}) |
| | | AND date(rw.reporting_work_time) <= date(#{selectTime2}) |
| | | and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | and o.create_order>0 |
| | |
| | | and o.order_id regexp #{reportingWork.orderId} |
| | | </if> |
| | | <if test="reportingWork.processId != null and reportingWork.processId != ''"> |
| | | and rw.process_id regexp #{reportingWork.processId} |
| | | |
| | | and CONCAT(rw.process_id,'/',rwd.goup) LIKE CONCAT('%', #{reportingWork.processId}, '%') |
| | | </if> |
| | | <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> |
| | | and o.project regexp #{reportingWork.order.project} |
| | |
| | | |
| | | SELECT * FROM sd.basic_data |
| | | WHERE basic_type='product' AND basic_category='process' AND basic_name='钢化' |
| | | |
| | | UNION |
| | | |
| | | SELECT * FROM sd.basic_data |
| | | WHERE basic_type='product' AND basic_category='process' AND basic_name='热弯' |
| | | ) AS combined_results; |
| | | </select> |
| | | |
| | |
| | | AND ogd.technology_number = rwd.technology_number*/ |
| | | LEFT JOIN sd.`order` AS o ON o.order_id = rw.order_id |
| | | WHERE rw.reviewed_state != 2 |
| | | and rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{selectTime2} |
| | | and date(rw.reporting_work_time) >= date(#{selectTime1}) |
| | | AND date(rw.reporting_work_time) <= date(#{selectTime2}) |
| | | AND position(#{orderId} in rw.order_id) |
| | | AND rw.reviewed_state != -1 |
| | | AND o.create_order > 0 |