| | |
| | | SELECT produce_year as year, |
| | | produce_month as month, |
| | | production_base as productionBase, |
| | | SUM ( CASE WHEN work_order_type = '0' AND classification = '1' THEN total_weld_seam ELSE 0 END ) AS pipingOrderRequirement, |
| | | SUM ( CASE WHEN work_order_type = '0' AND classification = '0' THEN total_weld_seam ELSE 0 END ) AS gasOrderRequirement, |
| | | SUM ( CASE WHEN work_order_type = '1' AND classification = '1' THEN total_weld_seam ELSE 0 END ) AS pipingPredictionRequirement, |
| | | SUM ( CASE WHEN work_order_type = '1' AND classification = '0' THEN total_weld_seam ELSE 0 END ) AS gasPredictionRequirement |
| | | FROM |
| | | aps_weld_seam |
| | | where 1=1 |
| | | <foreach item="item" index="index" collection="list" separator=" "> |
| | | or ( produce_year=#{item.produceYear} and produce_month=#{item.produceMonth} and production_base=#{item.productionBase}) |
| | | </foreach> |
| | | GROUP BY |
| | | produce_year, |
| | | produce_month, |
| | | production_base |
| | | work_order_type as workOrderType, |
| | | classification, |
| | | sum(total_weld_seam) as total |
| | | FROM aps_weld_seam |
| | | GROUP BY produce_year, produce_month, production_base, work_order_type, classification |
| | | </select> |
| | | </mapper> |