| | |
| | | WHERE 1 = 1 |
| | | </select> |
| | | |
| | | <select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto"> |
| | | SELECT |
| | | material_code, |
| | | product_name, |
| | | product_spec, |
| | | length, |
| | | width, |
| | | height, |
| | | COALESCE(SUM(quantity),0) AS quantity, |
| | | COALESCE(SUM(volume),0) AS volume |
| | | FROM production_plan |
| | | <where> |
| | | <if test="materialCode != null and materialCode != ''"> |
| | | AND material_code LIKE CONCAT('%', #{materialCode}, '%') |
| | | </if> |
| | | |
| | | <if test="productName != null and productName != ''"> |
| | | AND product_name LIKE CONCAT('%', #{productName}, '%') |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | material_code, |
| | | product_name, |
| | | product_spec, |
| | | length, |
| | | width, |
| | | height |
| | | </select> |
| | | |
| | | </mapper> |