| | |
| | | <if test="flowCard.processId != null and flowCard.processId != ''"> |
| | | and a.process_Id regexp #{flowCard.processId} |
| | | </if> |
| | | <if test="flowCard.order.batch != null and flowCard.order.batch != ''"> |
| | | and b.batch regexp #{flowCard.order.batch} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and c.product_id regexp #{flowCard.orderDetail.productId} |
| | | </if> |
| | |
| | | concat(fc.process_id, '/', #{technologyNumber}) as processIdNumber, |
| | | concat('对应我司单号', o.batch) AS otherRemarks, |
| | | '' as qrcode, |
| | | ifnull(rack,"") as rack |
| | | ifnull(rack,"") as rack, |
| | | o.quantity as orderQuantity, |
| | | o.area as orderArea, |
| | | o.order_type |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | #{technologyNumber} as technologyNumber, |
| | | concat(fc.process_id, '/', #{technologyNumber}) as processIdNumber, |
| | | concat('对应我司单号', o.batch) AS otherRemarks, |
| | | '' as qrcode |
| | | '' as qrcode, |
| | | o.order_type |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | pd.separation, |
| | | fc.technology_number, |
| | | IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber, |
| | | od.building_number |
| | | od.building_number, |
| | | od.weight |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | od.processing_note as processingNote, |
| | | width, |
| | | height, |
| | | #{printQuantity} as quantity, |
| | | if(#{printQuantity}>0 ,#{printQuantity},fc.quantity) as quantity, |
| | | CONCAT( |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))), |
| | | ' = ',#{printQuantity} ) as size, |
| | | ' = ',if(#{printQuantity}>0 ,#{printQuantity},fc.quantity) ) as size, |
| | | |
| | | CONCAT( |
| | | od.order_number,') ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))), |
| | | ' = ',#{printQuantity} ) as numberSize, |
| | | ' = ',if(#{printQuantity}>0 ,#{printQuantity},fc.quantity) ) as numberSize, |
| | | CONCAT( |
| | | od.order_number,')',' ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))), |
| | |
| | | </select> |
| | | |
| | | <select id="selectReplenishPrintMp"> |
| | | select fc.id, |
| | | select pl.id, |
| | | fc.order_id, |
| | | fc.process_id, |
| | | o.customer_name, |
| | |
| | | pl.reporting_work_id, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | pl.patch_id, |
| | | date(pl.create_time) as create_time |
| | | date(pl.create_time) as create_time, |
| | | pl.print_num |
| | | |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | |
| | | pd.separation, |
| | | fc.technology_number, |
| | | IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber, |
| | | od.building_number |
| | | od.building_number, |
| | | od.weight |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | fc.technology_number, |
| | | IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber, |
| | | od.building_number, |
| | | fc.merge as merge |
| | | fc.merge as merge, |
| | | od.weight |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | round(SUM(ogd.total_area), 2) as gross_area, |
| | | sum(od.weight) as weight, |
| | | #{technologyNumber} as technologyNumber, |
| | | concat(fc.process_id, '/', #{technologyNumber}) as processIdNumber |
| | | concat(fc.process_id, '/', #{technologyNumber}) as processIdNumber, |
| | | o.order_type |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | pl.patch_reason, |
| | | pl.patch_processes, |
| | | pl.responsible_team, |
| | | pl.responsible_personnel |
| | | pl.responsible_personnel, |
| | | od.building_number |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | concat('对应我司单号', o.batch) AS otherRemarks, |
| | | dd.responsible_personnel, |
| | | #{mergeTechnologyNumber} as mergeTechnologyNumber, |
| | | pl.patch_id |
| | | pl.patch_id, |
| | | o.order_type |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | </if> |
| | | group by fc.process_id,od.order_number, ogd.technology_number, ogd.child_width, ogd.child_height |
| | | order by IF(fcs.sort != NULL or fcs.sort != '', fcs.sort, fc.order_number) |
| | | </select> |
| | | |
| | | <select id="getgetPrintCustomDataSemiSp"> |
| | | select * from pp.optimize_detail opd |
| | | where opd.process_id= #{processId} and opd.order_sort = #{orderNumber} |
| | | <if test="technologyNumber != null and technologyNumber != ''"> |
| | | and opd.layer = #{technologyNumber} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="selectPrintNotMp"> |
| | |
| | | concat(fc.process_id, '/', #{technologyNumber}) as processIdNumber, |
| | | concat('对应我司单号', o.batch) AS otherRemarks, |
| | | fc.technology_number as qrcode, |
| | | o.other_remarks |
| | | o.other_remarks, |
| | | o.quantity as orderQuantity, |
| | | o.area as orderArea, |
| | | o.order_type |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | ORDER BY opd.stock_id |
| | | </select> |
| | | |
| | | <select id="getPrintProjectDetailsMpSp"> |
| | | SELECT opd.project_no,opd.stock_id,opd.polys_id,o_width,o_height,p_width,p_height,opd.glass_id |
| | | FROM optimize_detail as opd left join optimize_layout as opl on opl.project_no=opd.project_no and opl.stock_id=opd.stock_id |
| | | where opd.project_no=#{projectNo} and opd.stock_id in |
| | | <foreach item="item" index="index" collection="stockId" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | order BY opd.stock_id |
| | | </select> |
| | | |
| | | <select id="getPrintCustomDataProjectDetail"> |
| | | select |
| | | opt.glass_id as heat_layout_sort , |
| | |
| | | contacts, |
| | | delivery_address as deliveryAddress, |
| | | od.processing_note as processingNote, |
| | | opt.width, |
| | | opt.height, |
| | | opt.o_width, |
| | | opt.o_height, |
| | | opl.glass_count as flowQuantity, |
| | | CONCAT( |
| | | opt.width, |
| | | opt.o_width, |
| | | ' X ', |
| | | opt.height, |
| | | opt.o_height, |
| | | ' = ',opl.glass_count ) as size, |
| | | CONCAT( |
| | | od.order_number,') ', |
| | | opt.width, |
| | | opt.o_width, |
| | | ' X ', |
| | | opt.height, |
| | | opt.o_height, |
| | | ' = ',opl.glass_count ) as numberSize, |
| | | CONCAT( |
| | | od.order_number,')',' ', |
| | | opt.width, |
| | | opt.o_width, |
| | | ' X ', |
| | | opt.height) as numberSizeQuantity, |
| | | opt.o_height) as numberSizeQuantity, |
| | | od.order_number as orderNumber, |
| | | fc.technology_number as technologyNumber, |
| | | od.building_number as buildingNumber, |
| | |
| | | left join sd.product_detail as pd on pd.prod_id = p.id and pd.sort_num = od.order_number and |
| | | pd.glass_sort = fc.technology_number |
| | | where opt.project_no=#{projectNo} and opt.stock_id=#{stockId} |
| | | <if test="polysId != null"> |
| | | and opt.polys_id=#{polysId} |
| | | </if> |
| | | order by opt.stock_id,opt.polys_id |
| | | </select> |
| | | |
| | |
| | | pd.separation, |
| | | #{compound} as technology_number, |
| | | IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber, |
| | | od.building_number |
| | | od.building_number, |
| | | od.weight |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | pd.separation, |
| | | #{compound} as technology_number, |
| | | IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber, |
| | | od.building_number |
| | | od.building_number, |
| | | od.weight |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | </update> |
| | | |
| | | <update id="updateTerminationNoMp"> |
| | | update pp.flow_card set termination_status=0 where process_id = #{processId} and order_number = #{orderNumber} |
| | | update pp.flow_card set termination_status=0 , termination_quantity=0 where process_id = #{processId} and order_number = #{orderNumber} |
| | | </update> |
| | | |
| | | <select id="getNewProcessMp"> |
| | | select opd.process,bd.sort from sd.order_process_detail as opd |
| | | left join sd.basic_data as bd on bd.basic_name = opd.process and bd.basic_category='process' |
| | | where opd.process_id=#{processId} and opd.order_number=#{orderNumber} |
| | | and opd.technology_number = #{technologyNumber} and reporting_work_num_count>0 ORDER BY opd.id DESC LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getProcessInfo"> |
| | | select basic_name as process,sort FROM sd.basic_data as bd |
| | | where bd.basic_category='process' and bd.basic_name = #{processName} |
| | | </select> |
| | | <select id="OrderProcess"> |
| | | select DISTINCT basic_name as process,nickname,sort from sd.basic_data where basic_category = 'process' |
| | | </select> |
| | | |
| | | <select id="PrintProgressProcessCardData"> |
| | | select a.product_name, |
| | | b.glass_child, |
| | | d.order_type, |
| | | c.process_id, |
| | | c.process_id as 'processId', |
| | | c.order_id, |
| | | c.order_number, |
| | | c.technology_number, |
| | | b.child_width, |
| | | b.child_height, |
| | | c.quantity, |
| | | |
| | | c.quantity-ifnull(c.termination_quantity,0) as thisQuantity,/*用于判断是否改变颜色*/ |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityShow, |
| | | e.reportWorkQuantityCount, |
| | | e.reportWorkTime, |
| | | e.broken_num, |
| | | c.quantity-ifnull(c.termination_quantity,0) as glassQuantity, |
| | | |
| | | c.quantity-ifnull(c.termination_quantity,0) as quantityShow, |
| | | round( (c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,2) as grossAreaShow, |
| | | ifnull(c.received_quantity, 0) as StorageShow, |
| | | ifnull(dd.quantity, 0) as shippedQuantityShow, -- 发货数量 |
| | | round(ifnull(dd.quantity, 0)*a.compute_area,2) as shippedAreaShow, -- 发货面积 |
| | | round((ifnull(c.received_quantity, 0))*a.compute_area,2) as StorageAreaShow,-- 入库面积 |
| | | |
| | | round((c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,2)as grossArea, |
| | | ifnull(c.received_quantity, 0) as Storage, |
| | | ifnull(dd.quantity, 0) as shippedQuantity, |
| | | round(ifnull(dd.quantity, 0)*a.compute_area,2) as shippedArea, |
| | | round((ifnull(c.received_quantity, 0))*a.compute_area,2) as StorageArea, |
| | | |
| | | |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber, |
| | | b.`group`, |
| | | c.print_status, |
| | | c.print_number, |
| | | o.project, |
| | | o.customer_name, |
| | | b.process |
| | | |
| | | from pp.flow_card as c |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | | and c.order_number = a.order_number |
| | | left join sd.order_glass_detail as b |
| | | on c.order_id = b.order_id |
| | | and b.order_number = c.order_number |
| | | and c.technology_number = b.technology_number |
| | | left join sd.`order` as d |
| | | on c.order_id = d.order_id |
| | | # left join mm.finished_goods_inventory as f |
| | | # on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | left join (SELECT a.process_id, |
| | | a.order_number, |
| | | a.technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", if(a.technology_number!=1 and (bd.nickname='stepD' || bd.nickname='stepB' ) ,0,reporting_work_num), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityShow, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num_count, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", IFNULL(date(a.update_time),''), "\"")), |
| | | '}' |
| | | ) as reportWorkTime |
| | | FROM sd.order_process_detail as a |
| | | left join (SELECT DISTINCT basic_name,nickname from sd.basic_data as bd where bd.basic_category = 'process') as bd |
| | | on a.process = bd.basic_name |
| | | left join pp.flow_card as fc on fc.process_id=a.process_id and fc.order_number=a.order_number and fc.technology_number=a.technology_number |
| | | where (fc.create_time) >= #{startDate} and (fc.create_time) <= #{endDate} |
| | | GROUP BY a.process_id, a.order_number, a.technology_number |
| | | |
| | | |
| | | ) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | and e.order_number = c.order_number |
| | | left join sd.`order` as o on o.order_id =c.order_id |
| | | where (c.create_time) >= #{startDate} and (c.create_time) <= #{endDate} |
| | | and d.create_order>0 and c.quantity-ifnull(c.termination_quantity,0)>0 |
| | | group by c.order_number, |
| | | c.technology_number, |
| | | c.process_id |
| | | order by c.process_id, c.order_number, c.technology_number |
| | | </select> |
| | | </mapper> |