Commit c173d5c7 authored by libin's avatar libin

用户行为日志记录

parent 8313a91b
...@@ -125,7 +125,7 @@ public class CustomerBehaviorNotesBiz extends BaseBiz<CustomerBehaviorNotesMappe ...@@ -125,7 +125,7 @@ public class CustomerBehaviorNotesBiz extends BaseBiz<CustomerBehaviorNotesMappe
//App访问量统计 //App访问量统计
case APP_VISIT_COUNT: case APP_VISIT_COUNT:
actionAcount = new ActionAcount(); actionAcount = new ActionAcount();
default_p_total = mapper.selectAppVvisitsByType(BehaviorEnum.APP_VISIT_COUNT.getCode()); default_p_total = mapper.selectAppVvisitsByTypeAndTime(BehaviorEnum.APP_VISIT_COUNT.getCode(),startAtomic.get(),endAtomic.get());
default_p_avg = default_p_total / between_day; default_p_avg = default_p_total / between_day;
actionAcount.setDefault_p_total(default_p_total); actionAcount.setDefault_p_total(default_p_total);
actionAcount.setDefault_p_avg(default_p_avg); actionAcount.setDefault_p_avg(default_p_avg);
......
...@@ -17,7 +17,7 @@ public interface CustomerBehaviorNotesMapper extends Mapper<CustomerBehaviorNote ...@@ -17,7 +17,7 @@ public interface CustomerBehaviorNotesMapper extends Mapper<CustomerBehaviorNote
List<CustomerBehaviorNotes> selectByActivityIdAndTime(@Param("activityId") Integer activityId,@Param("startTime") Long startTime,@Param("endTime") Long endTime); List<CustomerBehaviorNotes> selectByActivityIdAndTime(@Param("activityId") Integer activityId,@Param("startTime") Long startTime,@Param("endTime") Long endTime);
long selectAppVvisitsByType(@Param("code") int code); long selectAppVvisitsByTypeAndTime(@Param("code") int code,@Param("startTime") Long startTime,@Param("endTime") Long endTime);
List<CustomerBehaviorNotes> selectAllByTypeIdsAndTime(@Param("bizIds") List<Integer> bizIds,@Param("startTime") Long startTime,@Param("endTime") Long endTime); List<CustomerBehaviorNotes> selectAllByTypeIdsAndTime(@Param("bizIds") List<Integer> bizIds,@Param("startTime") Long startTime,@Param("endTime") Long endTime);
} }
...@@ -27,8 +27,17 @@ ...@@ -27,8 +27,17 @@
</if> </if>
</select> </select>
<select id="selectAppVvisitsByType" resultType="long"> <select id="selectAppVvisitsByTypeAndTime" resultType="long">
select count(id) from `customer_behavior_notes` where `type`=#{code} select count(id) from `customer_behavior_notes` where `type`=#{code}
<if test="startTime != null != null and endTime !=null">
and `crt_time` between #{startTime} and #{endTime}
</if>
<if test="startTime != null and endTime == null">
and <![CDATA[`crt_time` >= #{startTime}]]>
</if>
<if test="endTime != null and startTime == null">
and <![CDATA[ `crt_time` <= #{endTime}]]>
</if>
</select> </select>
<select id="selectAllByTypeIdsAndTime" resultMap="customerBehaviorNotesMap"> <select id="selectAllByTypeIdsAndTime" resultMap="customerBehaviorNotesMap">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment