| | |
| | | GROUP_CONCAT(ogds.technology_number SEPARATOR '') AS technology_number, |
| | | ogds.glass_child, |
| | | GROUP_CONCAT(ogds.glass_child SEPARATOR '+') AS concatenated_glass_child, |
| | | SUBSTRING(process, LOCATE('夹胶', process)) AS processed_part |
| | | SUBSTRING(process, LOCATE(bd.basic_name, process)) AS processed_part |
| | | from sd.order_glass_detail as ogds |
| | | left join sd.basic_data as bd on bd.nickname='stepC' |
| | | where ogds.order_id = #{orderId} |
| | | and LOCATE('夹胶', ogds.process) > 0 |
| | | and LOCATE(bd.basic_name, ogds.process) > 0 |
| | | GROUP BY order_id, order_number, ogds.group) as ogdss |
| | | on fc.order_id = ogdss.order_id and ogdss.order_number = fc.order_number |
| | | where fc.order_id = #{orderId} |
| | |
| | | GROUP_CONCAT(pds.glass_sort SEPARATOR '') AS technology_number, |
| | | ogds.glass_child, |
| | | GROUP_CONCAT(ogds.glass_child SEPARATOR '+') AS concatenated_glass_child, |
| | | SUBSTRING(ogds.process, LOCATE('中空', ogds.process)) AS processed_part |
| | | SUBSTRING(ogds.process, LOCATE(bd.basic_name, ogds.process)) AS processed_part |
| | | from sd.order_glass_detail as ogds |
| | | left join sd.order_detail as ods |
| | | on ods.order_id = ogds.order_id and ods.order_number = ogds.order_number |
| | | left join sd.product_detail as pds on pds.prod_id = ods.product_id and |
| | | pds.glass_sort = |
| | | ogds.technology_number |
| | | left join sd.basic_data as bd on bd.nickname='stepD' |
| | | where ogds.order_id = #{orderId} |
| | | GROUP BY order_id, order_number) as ogdss |
| | | on fc.order_id = ogdss.order_id and ogdss.order_number = fc.order_number |
| | |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number |
| | | order by IF(fcs.sort != NULL or fcs.sort != '', fcs.sort, fc.order_number) |
| | | <choose> |
| | | <!-- flashback = 1 时正序 --> |
| | | <when test="flashback == 1"> |
| | | ORDER BY |
| | | CASE |
| | | WHEN fcs.sort IS NOT NULL AND fcs.sort <> '' THEN fcs.sort |
| | | ELSE fc.order_number |
| | | END ASC |
| | | </when> |
| | | <!-- flashback != 1 时倒序 --> |
| | | <otherwise> |
| | | ORDER BY |
| | | CASE |
| | | WHEN fcs.sort IS NOT NULL AND fcs.sort <> '' THEN fcs.sort |
| | | ELSE fc.order_number |
| | | END DESC |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <select id="getDetailLists"> |
| | |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by IF(fcs.sort != NULL or fcs.sort != '', fcs.sort, fc.order_number) |
| | | <choose> |
| | | <!-- flashback = 1 时正序 --> |
| | | <when test="flashback == 1"> |
| | | ORDER BY |
| | | CASE |
| | | WHEN fcs.sort IS NOT NULL AND fcs.sort <> '' THEN fcs.sort |
| | | ELSE fc.order_number |
| | | END ASC |
| | | </when> |
| | | <!-- flashback != 1 时倒序 --> |
| | | <otherwise> |
| | | ORDER BY |
| | | CASE |
| | | WHEN fcs.sort IS NOT NULL AND fcs.sort <> '' THEN fcs.sort |
| | | ELSE fc.order_number |
| | | END DESC |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <select id="getDetailListMerge"> |
| | |
| | | and fcs.process = #{process} |
| | | where fc.process_id = #{processId} and fc.`merge`=1 |
| | | group by fc.process_id, fc.order_number |
| | | order by IF(fcs.sort != NULL or fcs.sort != '', fcs.sort, fc.order_number) |
| | | <choose> |
| | | <!-- flashback = 1 时正序 --> |
| | | <when test="flashback == 1"> |
| | | ORDER BY |
| | | CASE |
| | | WHEN fcs.sort IS NOT NULL AND fcs.sort <> '' THEN fcs.sort |
| | | ELSE fc.order_number |
| | | END ASC |
| | | </when> |
| | | <!-- flashback != 1 时倒序 --> |
| | | <otherwise> |
| | | ORDER BY |
| | | CASE |
| | | WHEN fcs.sort IS NOT NULL AND fcs.sort <> '' THEN fcs.sort |
| | | ELSE fc.order_number |
| | | END DESC |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <select id="getDetailListLikes"> |
| | |
| | | GROUP_CONCAT(ogds.technology_number SEPARATOR '') AS technology_number, |
| | | ogds.glass_child, |
| | | GROUP_CONCAT(ogds.glass_child SEPARATOR '+') AS concatenated_glass_child, |
| | | SUBSTRING(process, LOCATE('夹胶', process)) AS processed_part |
| | | SUBSTRING(process, LOCATE(bd.basic_name, process)) AS processed_part |
| | | from sd.order_glass_detail as ogds |
| | | left join sd.basic_data as bd on bd.nickname='stepC' |
| | | where ogds.order_id = #{orderId} |
| | | and LOCATE('夹胶', ogds.process) > 0 |
| | | and LOCATE(bd.basic_name, ogds.process) > 0 |
| | | GROUP BY order_id, order_number, ogds.group) as ogdss |
| | | on fc.order_id = ogdss.order_id and ogdss.order_number = fc.order_number |
| | | where fc.order_id = #{orderId} |
| | |
| | | GROUP_CONCAT(pds.glass_sort SEPARATOR '') AS technology_number, |
| | | ogds.glass_child, |
| | | GROUP_CONCAT(ogds.glass_child SEPARATOR '+') AS concatenated_glass_child, |
| | | SUBSTRING(pds.process, LOCATE('中空', pds.process)) AS processed_part |
| | | SUBSTRING(pds.process, LOCATE(bd.basic_name, pds.process)) AS processed_part |
| | | from sd.order_glass_detail as ogds |
| | | left join sd.order_detail as ods |
| | | on ods.order_id = ogds.order_id and ods.order_number = ogds.order_number |
| | | left join sd.product_detail as pds on pds.prod_id = ods.product_id and |
| | | pds.glass_sort = |
| | | ogds.technology_number |
| | | left join sd.basic_data as bd on bd.nickname='stepD' |
| | | where ogds.order_id = #{orderId} |
| | | GROUP BY order_id, order_number) as ogdss |
| | | on fc.order_id = ogdss.order_id and ogdss.order_number = fc.order_number |
| | |
| | | <select id="getProcessNameList"> |
| | | SELECT id,basic_name,IFNULL(nickname,"") as nickname FROM sd.`basic_data` where basic_category='process' |
| | | </select> |
| | | |
| | | <select id="exportDateProcessMp"> |
| | | select |
| | | a.order_Id, |
| | | a.process_Id, |
| | | c.product_id, |
| | | c.product_name, |
| | | b.project, |
| | | sum(a.quantity) as quantity, |
| | | sum(a.quantity) * c.area as compute_gross_area, |
| | | a.founder, |
| | | c.processing_note, |
| | | b.customer_name, |
| | | layout_status as layout_status, |
| | | a.merge, |
| | | a.rack, |
| | | b.batch |
| | | from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,max(merge) as merge,rack from flow_card |
| | | group by process_Id,order_number) as a |
| | | left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where date(a.create_time) >= #{date[0]} |
| | | and date(a.create_time) <= #{date[1]} |
| | | and b.create_order>0 |
| | | group by a.process_Id |
| | | ORDER BY a.id desc |
| | | </select> |
| | | |
| | | <select id="getSumQuantity"> |
| | | select quantity from sd.`order` where order_id=#{orderId} |
| | | </select> |
| | | </mapper> |