| 123456789101112131415161718192021222324 |
- <?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.yami.shop.dao.PointsRechargeMapper">
- <select id="statisticsList" resultType="com.yami.shop.bean.vo.PointsRechargeVO">
- SELECT
- sum(points) AS totalPoints,
- count(id) AS totalUserCount,
- channel_name AS channelName,
- max(create_time) AS createTime
- FROM tz_points_recharge
- <where>
- <if test="pointsRecharge.channelId != null"> channel_id = #{pointsRecharge.channelId}</if>
- <if test="pointsRecharge.channelIdList != null and !pointsRecharge.channelIdList.isEmpty()">
- and channel_id in
- <foreach collection="pointsRecharge.channelIdList" item="channelId" open="(" close=")" separator=",">
- #{channelId}
- </foreach>
- </if>
- </where>
- GROUP BY channel_id, channel_name
- ORDER BY max(create_time) DESC
- </select>
- </mapper>
|