123456789101112131415161718192021222324252627 |
- <?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.book.dao.polardb.mapper.SunUser2Mapper">
- <select id="selectByDay" resultType="java.util.HashMap">
- <![CDATA[
- SELECT COUNT(DISTINCT(openid)) as new_recharge_user,IFNULL(sum(recharge_amount),0) as new_recharge_sum,count(recharge_num) as new_recharge_count FROM sun_user WHERE start_time>#{startDate} and end_time<=#{endDate} and recharge_num>0;
- ]]>
- </select>
- <select id="selectByDayChannel" resultType="java.util.HashMap">
- <![CDATA[
- SELECT t.*,t2.channel_name FROM
- (
- SELECT channel_id,COUNT(DISTINCT(openid)) as new_recharge_user,IFNULL(sum(recharge_amount),0) as new_recharge_sum,count(recharge_num) as new_recharge_count FROM sun_user WHERE start_time>#{startDate} and end_time<=#{endDate} and recharge_num>0 GROUP BY channel_id
- ) t LEFT JOIN sun_channel t2 on t.channel_id=t2.channel_id;
- ]]>
- </select>
- <select id="selectCountUserByDay" resultType="java.lang.Integer">
- <![CDATA[
- SELECT COUNT(1) FROM sun_user WHERE start_time > #{startDate} and end_time <= #{endDate};
- ]]>
- </select>
- <select id="selectCountByDayChannel" resultType="java.util.HashMap">
- <![CDATA[
- SELECT channel_id,COUNT(DISTINCT(openid)) as user_count FROM sun_user WHERE start_time>#{startDate} and end_time<=#{endDate} GROUP BY channel_id
- ]]>
- </select>
- </mapper>
|