yuan
2026-10-10 7aad06fedc12f0183734088fa44c929ac6ff42b3
src/main/resources/mapper/production/ProductionProductOutputMapper.xml
@@ -24,7 +24,7 @@
                and ppm.id = #{c.productMainId}
            </if>
        </where>
        order by ppo.id
        order by ppo.id DESC
    </select>
    <delete id="deleteByProductMainIds" parameterType="java.util.List">
@@ -34,4 +34,28 @@
            #{id}
        </foreach>
    </delete>
    <select id="selectOutputStats" resultType="com.ruoyi.production.dto.ProductionProductOutputDto">
        SELECT
            create_time,
            quantity,
            scrap_qty
        FROM
            production_product_output
        WHERE
            create_time &gt;= #{startDate}
            AND create_time &lt;= #{endDate}
    </select>
    <select id="selectDailyOutputStats" resultType="java.util.Map">
        SELECT
            DATE_FORMAT(create_time, '%Y-%m-%d') as date,
            SUM(quantity-scrap_qty) as quantity
        FROM
            production_product_output
        WHERE
            create_time &gt;= #{startDate}
            AND create_time &lt;= #{endDate}
        GROUP BY
            DATE_FORMAT(create_time, '%Y-%m-%d')
    </select>
</mapper>