|
|
@ -0,0 +1,41 @@ |
|
|
|
<?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="com.example.demo.mapper.RechargeMapper"> |
|
|
|
|
|
|
|
<select id="getRechargeA" resultType="com.example.demo.domain.vo.RechargeA"> |
|
|
|
SELECT |
|
|
|
CASE |
|
|
|
WHEN flag = 0 THEN '待审核' |
|
|
|
WHEN flag = 1 THEN '已通过' |
|
|
|
WHEN flag = 2 THEN '已驳回' |
|
|
|
ELSE '其他状态' |
|
|
|
END AS flag, |
|
|
|
COUNT(*) AS Raudit, |
|
|
|
SUM(paid_gold) AS SumRaudit, |
|
|
|
SUM(free_gold) AS SumRaudit1, |
|
|
|
(SUM(paid_gold) + SUM(free_gold)) AS SumRaudit2 |
|
|
|
FROM |
|
|
|
recharge |
|
|
|
<where> |
|
|
|
<!-- 动态条件:flag --> |
|
|
|
<if test="flags != null and flags.size > 0"> |
|
|
|
flag IN |
|
|
|
<foreach collection="flags" item="flag" open="(" separator="," close=")"> |
|
|
|
#{flag} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test='jwcode!=null and jwcode.length>0'>and recharge.jwcode=#{jwcode}</if> |
|
|
|
<if test='activityId!=null'>and recharge.activity_id=#{activityId}</if> |
|
|
|
<if test='adminId!=null'>and recharge.admin_id=#{adminId}</if> |
|
|
|
<if test='startDate != null and endDate != null'>AND recharge.create_time BETWEEN #{startDate} AND #{endDate}</if> |
|
|
|
<if test='payWay!=null and payWay.length>0 '>and pay_way like concat('%',#{payWay},'%')</if> |
|
|
|
<if test='rechargeWay!=null and rechargeWay.length>0 '>and recharge_way like concat('%',#{rechargeWay},'%')</if> |
|
|
|
<if test='area!=null and area.length>0'>and user.area=#{area}</if> |
|
|
|
<if test='status!=null'>and audit.status=#{status}</if> |
|
|
|
</where> |
|
|
|
GROUP BY |
|
|
|
flag; |
|
|
|
</select> |
|
|
|
</mapper> |