| | |
| | | ogd.production_id, |
| | | od.product_id, |
| | | od.product_name, |
| | | ROUND(SUM(od.quantity)-IFNULL(sum(fc.quantity)/count(fc.technology_number),0)) as quantity, |
| | | ROUND(SUM(DISTINCT od.quantity)-IFNULL(sum(fc.quantity)/fc.layers_number,0)) as quantity, |
| | | SUM(od.compute_gross_area) as compute_gross_area, |
| | | round(sum(od.perimeter), 2) as perimeter |
| | | from sd.order_detail as od |
| | |
| | | od.quantity, |
| | | od.compute_gross_area, |
| | | p.total_thickness, |
| | | ROUND(od.quantity-IFNULL(sum(fc.quantity)/count(fc.technology_number),0)) as baiscQuantity, |
| | | ROUND(od.quantity-IFNULL(sum(fc.quantity)/fc.layers_number,0)) as baiscQuantity, |
| | | od.compute_gross_area as 'computeGrossArea', |
| | | p.total_thickness AS 'totalThickness', |
| | | ifnull(p.thickness,'') as thickness, |
| | |
| | | from sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | left join sd.product as p on od.product_name = p.product_name |
| | | left join sd.product as p on od.product_id = p.id |
| | | left join (SELECT order_id, |
| | | order_number, |
| | | JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S01')) AS S01, |
| | |
| | | |
| | | <select id="getOrderDetailByProductionId"> |
| | | select * from (select a.*, |
| | | a.quantity as 'baiscQuantity', |
| | | #{glassThickness} as 'thickness', |
| | | IF(a.height >= a.width, a.height, a.width) as 'long', |
| | | IF(a.height < a.width, a.height, a.width) as 'short' |
| | | from sd.order_detail as a |
| | | left join sd.order_glass_detail as b |
| | | on a.order_id = b.order_id and a.order_number = b.order_number |
| | | where a.order_id = #{orderId} and b.production_id = #{productionId} |
| | | |
| | | group by a.order_number) as c |
| | | <if test="type=='scope'"> |
| | | where c.`long` <= #{inLenMax} |
| | | and c.`long` >= #{inLenMin} |
| | | and c.`short` >= #{inShortMin} |
| | | and c.`short` <= #{inShortMax} |
| | | </if> |
| | | <if test="type=='notScope'"> |
| | | where !(c.`long` <= #{inLenMax} |
| | | and c.`long` >= #{inLenMin} |
| | | and c.`short` >= #{inShortMin} |
| | | and c.`short` <= #{inShortMax}) |
| | | </if> |
| | | order by c.`long` desc |
| | | </select> |
| | | |