mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-19 12:41:55 +08:00
51 lines
2.1 KiB
XML
51 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
<mapper namespace="cn.iocoder.yudao.module.statistics.dal.mysql.pay.PayWalletStatisticsMapper">
|
||
|
||
<select id="selectRechargeSummaryByPayTimeBetween"
|
||
resultType="cn.iocoder.yudao.module.statistics.service.trade.bo.WalletSummaryRespBO">
|
||
SELECT COUNT(1) AS rechargePayCount,
|
||
SUM(pay_price) AS rechargePayPrice
|
||
FROM pay_wallet_recharge
|
||
WHERE pay_status = #{payStatus}
|
||
AND pay_time BETWEEN #{beginTime} AND #{endTime}
|
||
AND deleted = FALSE
|
||
</select>
|
||
|
||
<select id="selectRechargeSummaryByRefundTimeBetween"
|
||
resultType="cn.iocoder.yudao.module.statistics.service.trade.bo.WalletSummaryRespBO">
|
||
SELECT COUNT(1) AS rechargeRefundCount,
|
||
SUM(pay_price) AS rechargeRefundPrice
|
||
FROM pay_wallet_recharge
|
||
WHERE refund_status = #{refundStatus}
|
||
AND refund_time BETWEEN #{beginTime} AND #{endTime}
|
||
AND deleted = FALSE
|
||
</select>
|
||
|
||
<select id="selectPriceSummaryByBizTypeAndCreateTimeBetween" resultType="java.lang.Integer">
|
||
SELECT SUM(price)
|
||
FROM pay_wallet_transaction
|
||
WHERE biz_type = #{bizType}
|
||
AND create_time BETWEEN #{beginTime} AND #{endTime}
|
||
AND deleted = FALSE
|
||
</select>
|
||
|
||
<select id="selectRechargeSummaryGroupByWalletId"
|
||
resultType="cn.iocoder.yudao.module.statistics.service.pay.bo.RechargeSummaryRespBO">
|
||
<!-- TODO @疯狂:是不是不用 group by,而是通过 DISTINCT wallet_id 更合适哈? -->
|
||
SELECT COUNT(1) AS rechargeUserCount,
|
||
SUM(pay_price) AS rechargePrice
|
||
FROM pay_wallet_recharge
|
||
WHERE pay_status = #{payStatus}
|
||
<if test="beginTime != null">
|
||
AND pay_time >= #{beginTime}
|
||
</if>
|
||
<if test="endTime != null">
|
||
AND pay_time <= #{endTime}
|
||
</if>
|
||
AND deleted = FALSE
|
||
GROUP BY wallet_id
|
||
</select>
|
||
|
||
</mapper>
|