xuhy
2025-10-13 782cef1a49bb665fd88f3850a9193c08d63ef1d5
ruoyi-system/src/main/resources/mapper/system/TErpProcurementMapper.xml
@@ -108,5 +108,41 @@
    </select>
    <select id="supplierThirtyProcurementStatistics"
            resultType="com.ruoyi.system.vo.SupplierThirtyProcurementStatisticsVO">
        select
        date_format(t1.pay_time, '%m.%d') as `time`,
        date_format(t1.pay_time, '%Y-%m-%d') as payTime,
        count(1) as orderCount
        from t_erp_procurement t1
        where t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        and t1.status in (3,4,5)
        and t1.pay_time between #{startTime} and #{endTime}
        <if test="query.roleType != null and query.roleType == 4">
            and t1.supplier_id = #{supplierAndClinicId}
        </if>
        <if test="query.roleType != null and query.roleType == 5">
            and t1.clinic_id = #{supplierAndClinicId}
        </if>
        group by date_format(t1.pay_time, '%m.%d')
    </select>
    <select id="supplierThirtyMoneyProcurementStatistics"
            resultType="com.ruoyi.system.vo.SupplierThirtyMoneyProcurementStatisticsVO">
        select
            date_format(t1.pay_time, '%m.%d') as `time`,
            date_format(t1.pay_time, '%Y-%m-%d') as payTime,
            sum(t1.pay_money) as moneyTotal
        from t_erp_procurement t1
        where t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
            and t1.status in (3,4,5)
            and t1.pay_time between #{startTime} and #{endTime}
            <if test="query.roleType != null and query.roleType == 4">
                and t1.supplier_id = #{supplierAndClinicId}
            </if>
            <if test="query.roleType != null and query.roleType == 5">
                and t1.clinic_id = #{supplierAndClinicId}
            </if>
        group by date_format(t1.pay_time, '%m.%d')
    </select>
</mapper>