gongchunyi
3 天以前 965cd9cc87ee705eb8d6ce259ee33d26291fe0d3
src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
@@ -44,4 +44,33 @@
        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>