|
@@ -3,20 +3,20 @@
|
|
<mapper namespace="com.book.dao.polardb.mapper.SunUser2Mapper">
|
|
<mapper namespace="com.book.dao.polardb.mapper.SunUser2Mapper">
|
|
<select id="selectByDay" resultType="java.util.HashMap">
|
|
<select id="selectByDay" resultType="java.util.HashMap">
|
|
<![CDATA[
|
|
<![CDATA[
|
|
- SELECT COUNT(DISTINCT(openid)) as new_recharge_user,sum(recharge_amount) 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 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>
|
|
<select id="selectByDayChannel" resultType="java.util.HashMap">
|
|
<select id="selectByDayChannel" resultType="java.util.HashMap">
|
|
<![CDATA[
|
|
<![CDATA[
|
|
SELECT t.*,t2.channel_name FROM
|
|
SELECT t.*,t2.channel_name FROM
|
|
(
|
|
(
|
|
- SELECT channel_id,COUNT(DISTINCT(openid)) as new_recharge_user,sum(recharge_amount) 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
|
|
|
|
|
|
+ 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;
|
|
) t LEFT JOIN sun_channel t2 on t.channel_id=t2.channel_id;
|
|
]]>
|
|
]]>
|
|
</select>
|
|
</select>
|
|
<select id="selectCountUserByDay" resultType="java.lang.Integer">
|
|
<select id="selectCountUserByDay" resultType="java.lang.Integer">
|
|
<![CDATA[
|
|
<![CDATA[
|
|
- SELECT COUNT(1) FROM sun_user WHERE start_time>#{startDate} and end_time<=#{endDate};
|
|
|
|
|
|
+ SELECT COUNT(1) FROM sun_user WHERE start_time > #{startDate} and end_time <= #{endDate};
|
|
]]>
|
|
]]>
|
|
</select>
|
|
</select>
|
|
<select id="selectCountByDayChannel" resultType="java.util.HashMap">
|
|
<select id="selectCountByDayChannel" resultType="java.util.HashMap">
|