Authored by Lixiaodi

点击数统计 实时

... ... @@ -48,8 +48,8 @@
create_time >= #{beginTime,jdbcType=INTEGER}
and create_time < #{endTime,jdbcType=INTEGER}
</delete>
<select id="selectCount">
select sum(num) from union_click_count_day
<select id="selectCount" resultType="java.lang.Integer">
select case when sum(num) is null then 0 else sum(num) end from union_click_count_day
where union_type = #{unionType,jdbcType=VARCHAR} and client_type = #{clientType,jdbcType=INTEGER} and
day_id &gt;= #{start,jdbcType=VARCHAR} and day_id &lt;= #{end,jdbcType=VARCHAR}
</select>
... ...
... ... @@ -281,7 +281,7 @@
</select>
<select id="queryCountInfo" resultType="java.lang.Integer">
select count(*) from union_click_logs
select CASE WHEN count(*) is null then 0 else count(*) end from union_click_logs
where union_type = #{unionType,jdbcType=BIGINT} and client_type = #{clientType,jdbcType=VARCHAR} and
create_time &gt;= #{beginTime,jdbcType=INTEGER}
and create_time &lt; #{endTime,jdbcType=INTEGER}
... ...
... ... @@ -754,7 +754,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
log.info("queryActivateCount dayStart is {}, now is {}, lastH is {}", format.format(new Date(dayStart * 1000L)),
format.format(new Date(now * 1000L)), format.format(new Date(e * 1000L)));
String key = "yh:union:clickdata:" + unionType + ":" + formatDay.format(new Date(now * 1000L));
String key = "yh:union:clickdata:" + unionType + ":" + formatDay.format(new Date(now * 1000L)) + ":" + apptype;
Map<Integer, Integer> map = redisValueCache.get(key, Map.class);
log.info("queryActivateCount key is {}, getValue is {}", key, map);
... ...