| | |
| | | order by IF(fc.sort != NULL or fc.sort != '', fc.sort, pl.order_sort) |
| | | </select> |
| | | |
| | | |
| | | <select id="getReworkPrintCustomData"> |
| | | select o.order_id as orderId, |
| | | o.project, |
| | | o.customer_id as customerId, |
| | | o.customer_name as customerName, |
| | | o.order_type as orderType, |
| | | o.order_classify as orderClassify, |
| | | o.batch, |
| | | o.icon, |
| | | o.pack_type as packType, |
| | | o.delivery_date as deliveryDate, |
| | | o.al_type as alType, |
| | | o.money, |
| | | contract_id as contractId, |
| | | customer_batch customerBatch, |
| | | contacts, |
| | | o.delivery_address as deliveryAddress, |
| | | od.processing_note as processingNote, |
| | | od.width, |
| | | od.height, |
| | | pl.rework_num as quantity, |
| | | pl.order_sort as orderNumber, |
| | | pl.technology_number as technologyNumber, |
| | | od.building_number as buildingNumber, |
| | | od.product_name as productName, |
| | | od.edging_type as edgingType, |
| | | p.remarks, |
| | | c.customer_abbreviation as customerAbbreviation, |
| | | p.product_abbreviation as productAbbreviation, |
| | | fc.process_id as processId, |
| | | SUBSTRING(fc.process_id,12 ) as processIdAD ,/*-流程卡简写-*/ |
| | | o.create_time as createTime, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')) AS figureNumber, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S03')) AS colourCeramicGlaze, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')) AS remarks1, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S05')) AS remarks2, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S06')) AS remarks3, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S07')) AS remarks4, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S08')) AS remarks5, |
| | | p.remarks as filmNumber, |
| | | od.bend_radius as bendRadius, |
| | | CONCAT( |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))), |
| | | ' = ',pl.rework_num ) 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))), |
| | | ' = ',pl.rework_num ) as numberSize, |
| | | 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)))) as numberSizeQuantity, |
| | | '文本' as custom1, |
| | | '文本' as custom2, |
| | | '文本' as custom3, |
| | | '文本' as custom4, |
| | | '文本' as custom5 |
| | | from sd.order as o |
| | | left join sd.order_detail as od on o.order_id = od.order_id |
| | | left join flow_card as fc on o.order_id = fc.order_id and |
| | | od.order_number = fc.order_number |
| | | left join rework as pl on pl.process_id = fc.process_id and pl.order_sort = fc.order_number and |
| | | pl.technology_number = fc.technology_number |
| | | left join sd.product as p on p.id = od.product_id |
| | | left join sd.customer as c on c.id = o.customer_id |
| | | left join sd.product_detail as pd on pd.prod_id = p.id and pd.sort_num = od.order_number |
| | | where pl.process_id = #{processId} |
| | | and pl.order_sort=#{orderNumber} |
| | | and pl.technology_number = #{technologyNumber} |
| | | and pl.reporting_work_id = #{reportingWorkId} |
| | | group by od.order_number, width, height |
| | | order by IF(fc.sort != NULL or fc.sort != '', fc.sort, pl.order_sort) |
| | | </select> |
| | | |
| | | <select id="getGlassNumber"> |
| | | select other_columns |
| | | from sd.order_detail as od |
| | |
| | | order by IF(fc.sort != NULL or fc.sort != '', fc.sort, pl.order_sort) |
| | | </select> |
| | | |
| | | <select id="getReworkPrintCustomDataSemi"> |
| | | select o.order_id as orderId, |
| | | o.project, |
| | | o.customer_id as customerId, |
| | | o.customer_name as customerName, |
| | | o.order_type as orderType, |
| | | o.order_classify as orderClassify, |
| | | o.batch, |
| | | o.icon, |
| | | o.pack_type as packType, |
| | | o.delivery_date as deliveryDate, |
| | | o.al_type as alType, |
| | | o.money, |
| | | contract_id as contractId, |
| | | customer_batch customerBatch, |
| | | contacts, |
| | | o.delivery_address as deliveryAddress, |
| | | od.processing_note as processingNote, |
| | | ogd.child_width as width, |
| | | ogd.child_height as height, |
| | | pl.rework_num as quantity, |
| | | pl.order_sort as orderNumber, |
| | | pl.technology_number as technologyNumber, |
| | | od.building_number as buildingNumber, |
| | | od.product_name as productName, |
| | | od.edging_type as edgingType, |
| | | p.remarks, |
| | | c.customer_abbreviation as customerAbbreviation, |
| | | p.product_abbreviation as productAbbreviation, |
| | | CONCAT(fc.process_id, '/', fc.technology_number) as processId, |
| | | SUBSTRING(fc.process_id,12 ) as processIdAD ,/*-流程卡简写-*/ |
| | | o.create_time as createTime, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')) AS figureNumber, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S03')) AS colourCeramicGlaze, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')) AS remarks1, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S05')) AS remarks2, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S06')) AS remarks3, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S07')) AS remarks4, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S08')) AS remarks5, |
| | | p.remarks as filmNumber, |
| | | od.bend_radius as bendRadius, |
| | | ogd.glass_child as glassChild, |
| | | ogd.glass_address as glassAddress, |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color, |
| | | CONCAT( |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_height AS CHAR))), |
| | | ' = ',pl.rework_num ) as size, |
| | | CONCAT( |
| | | od.order_number,') ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_height AS CHAR))), |
| | | ' = ',pl.rework_num ) as numberSize, |
| | | CONCAT( |
| | | od.order_number,')',' ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_height AS CHAR)))) as numberSizeQuantity, |
| | | '文本' as custom1, |
| | | '文本' as custom2, |
| | | '文本' as custom3, |
| | | '文本' as custom4, |
| | | '文本' as custom5 |
| | | from sd.order as o |
| | | left join sd.order_detail as od on o.order_id = od.order_id |
| | | left join flow_card as fc on o.order_id = fc.order_id and |
| | | od.order_number = fc.order_number |
| | | left join rework as pl on pl.process_id = fc.process_id and pl.order_sort = fc.order_number and |
| | | pl.technology_number = fc.technology_number |
| | | left join sd.product as p on p.id = od.product_id |
| | | left join sd.customer as c on c.id = o.customer_id |
| | | left join sd.product_detail as pd on pd.prod_id = p.id and pd.sort_num = od.order_number |
| | | left join sd.order_glass_detail ogd |
| | | on ogd.order_id = o.order_id and ogd.order_number = od.order_number and |
| | | ogd.technology_number = fc.technology_number |
| | | where pl.process_id = #{processId} |
| | | and pl.order_sort=#{orderNumber} |
| | | and pl.technology_number = #{technologyNumber} |
| | | and pl.reporting_work_id = #{reportingWorkId} |
| | | group by od.order_number, width, height |
| | | order by IF(fc.sort != NULL or fc.sort != '', fc.sort, pl.order_sort) |
| | | </select> |
| | | |
| | | <select id="selectPrintAllMp"> |
| | | select * |
| | | from ((select fc.id, |