2023-10-06 14:15:59 +08:00
|
|
|
<?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">
|
2023-10-09 23:27:10 +08:00
|
|
|
<mapper namespace="cn.iocoder.yudao.module.statistics.dal.mysql.pay.PayWalletStatisticsMapper">
|
2023-10-06 14:15:59 +08:00
|
|
|
<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}
|
2023-10-11 12:32:28 +08:00
|
|
|
AND deleted = FALSE
|
2023-10-06 14:15:59 +08:00
|
|
|
</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}
|
2023-10-11 12:32:28 +08:00
|
|
|
AND deleted = FALSE
|
2023-10-06 14:15:59 +08:00
|
|
|
</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}
|
2023-10-11 12:32:28 +08:00
|
|
|
AND deleted = FALSE
|
2023-10-06 14:15:59 +08:00
|
|
|
</select>
|
2023-10-09 23:27:10 +08:00
|
|
|
|
|
|
|
<select id="selectRechargeSummaryGroupByWalletId"
|
2023-10-11 15:26:17 +08:00
|
|
|
resultType="cn.iocoder.yudao.module.statistics.service.pay.bo.RechargeSummaryRespBO">
|
2023-10-09 23:27:10 +08:00
|
|
|
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>
|
2023-10-11 12:32:28 +08:00
|
|
|
AND deleted = FALSE
|
2023-10-09 23:27:10 +08:00
|
|
|
GROUP BY wallet_id
|
|
|
|
</select>
|
2023-10-11 12:32:28 +08:00
|
|
|
|
2023-10-06 14:15:59 +08:00
|
|
|
</mapper>
|