From efb2457e0f7b6e5a76999c239d8b079b21c88eb0 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期三, 19 二月 2025 14:03:43 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/xiaochen991015/xizang --- ruoyi-system/src/main/resources/mapper/system/TBankFlowMapper.xml | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/TBankFlowMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TBankFlowMapper.xml index 61d5859..c72c8f5 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TBankFlowMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TBankFlowMapper.xml @@ -26,4 +26,40 @@ id, bank_serial_number, flow_money, deduction_money, remaining_money, pay_time, payer, flow_status, pay_type, payment_bill_id, create_time, update_time, create_by, update_by, disabled </sql> + + <!-- 定义结果映射 --> + <resultMap id="PaymentStatsResultMap" type="com.ruoyi.system.vo.TBankFlowStatisticsVo"> + <result property="totalFlowMoney" column="totalFlowMoney" /> + <result property="totalDeductionMoney" column="totalDeductionMoney" /> + <result property="totalRemainingMoney" column="totalRemainingMoney" /> + </resultMap> + + <!-- 统计总额和微信支付金额 --> + <select id="getPaymentStats" resultMap="PaymentStatsResultMap"> + SELECT + SUM(flow_money) AS totalFlowMoney, + SUM(deduction_money) AS totalDeductionMoney, + SUM(remaining_money) AS totalRemainingMoney + FROM + t_bank_flow + <where> + <if test="req.bankSerialNumber != null and req.bankSerialNumber != ''"> + and bank_serial_number = #{req.bankSerialNumber} + </if> + <if test="req.payer != null and req.payer != ''"> + and payer like concat('%', #{req.payer}, '%') + </if> + <if test="req.flowStatus != null and req.flowStatus != ''"> + and flow_status = #{req.flowStatus} + </if> + <if test="req.payStartTime != null and req.payStartTime != ''"> + and pay_time >= #{req.payStartTime} + </if> + <if test="req.payEndTime != null and req.payEndTime != ''"> + and pay_time <= #{req.payEndTime} + </if> + AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} + </where> + </select> + </mapper> -- Gitblit v1.7.1