|
@@ -145,7 +145,7 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
|
|
|
"<if test ='nickName !=null and nickName!=\"\"'>\n" +
|
|
"<if test ='nickName !=null and nickName!=\"\"'>\n" +
|
|
|
" and qu.qw_user_name like concat( #{nickName}, '%')\n" +
|
|
" and qu.qw_user_name like concat( #{nickName}, '%')\n" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test ='deptId !=null and deptId!=\"\"'>\n" +
|
|
|
|
|
|
|
+ "<if test ='(deptIds ==null or deptIds.size = 0) and deptId !=null and deptId!=\"\"'>\n" +
|
|
|
" and cu.dept_id = #{deptId}\n" +
|
|
" and cu.dept_id = #{deptId}\n" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
" <if test=\"filterDeptIds != null and filterDeptIds.size() != 0\">\n" +
|
|
" <if test=\"filterDeptIds != null and filterDeptIds.size() != 0\">\n" +
|
|
@@ -154,6 +154,12 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
|
|
|
" ${item}\n" +
|
|
" ${item}\n" +
|
|
|
" </foreach>\n" +
|
|
" </foreach>\n" +
|
|
|
" </if> " +
|
|
" </if> " +
|
|
|
|
|
+ "<if test ='deptIds !=null and deptIds.size > 0'>\n" +
|
|
|
|
|
+ "and cu.dept_id in" +
|
|
|
|
|
+ "<foreach collection=\"deptIds\" item=\"deptId\" index=\"index\" separator=\",\" open=\"(\" close=\")\">\n" +
|
|
|
|
|
+ " #{deptId}\n" +
|
|
|
|
|
+ "</foreach>" +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test ='ids !=null and ids!=\"\"'>\n" +
|
|
"<if test ='ids !=null and ids!=\"\"'>\n" +
|
|
|
" and qec.qw_user_id in (${ids})\n" +
|
|
" and qec.qw_user_id in (${ids})\n" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
@@ -212,6 +218,63 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
|
|
|
" DATE(qec.create_time) "+
|
|
" DATE(qec.create_time) "+
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
List<QwWatchLogStatisticsListVO> selectQwExtCountByDayAndOther(FsCourseWatchLogListParam param);
|
|
List<QwWatchLogStatisticsListVO> selectQwExtCountByDayAndOther(FsCourseWatchLogListParam param);
|
|
|
|
|
+
|
|
|
|
|
+ @Select({"<script> " +
|
|
|
|
|
+ "SELECT\n" +
|
|
|
|
|
+ " qec.qw_user_id id,\n" +
|
|
|
|
|
+ " qu.qw_user_name AS qw_user_name, \n" +
|
|
|
|
|
+ " DATE(qec.create_time) AS create_time, \n" +
|
|
|
|
|
+ " COUNT(1) AS line,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.is_interact = 1 THEN 1 END) AS interact,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.`level` = 1 THEN 1 END) AS A,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.`level` = 2 THEN 1 END) AS B,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.`level` = 3 THEN 1 END) AS C,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.`level` = 4 THEN 1 END) AS D,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.`level` = 5 THEN 1 END) AS E,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.fs_user_id IS NOT NULL THEN 1 END) AS sign,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.`status` =3 THEN 1 END) AS los,\n" +
|
|
|
|
|
+ " COUNT(CASE WHEN qec.`status` IN (4, 5,6) THEN 1 END) AS del\n" +
|
|
|
|
|
+ "FROM\n" +
|
|
|
|
|
+ " qw_external_contact qec\n" +
|
|
|
|
|
+ "JOIN\n" +
|
|
|
|
|
+ " qw_user qu ON qec.qw_user_id = qu.id \n" +
|
|
|
|
|
+ "left join company_user cu on qec.company_user_id = cu.user_id "+
|
|
|
|
|
+ "WHERE\n" +
|
|
|
|
|
+ " DATE(qec.create_time) >= DATE(#{sTime}) and DATE(qec.create_time) <= DATE(#{eTime}) and qec.company_id =#{companyId} " +
|
|
|
|
|
+ " and NOT EXISTS (\n" +
|
|
|
|
|
+ " SELECT 1 \n" +
|
|
|
|
|
+ " FROM qw_external_contact_transfer_log t " +
|
|
|
|
|
+ " WHERE t.external_contact_id = qec.id " +
|
|
|
|
|
+ " AND DATE(t.create_time) >= DATE(#{sTime}) \n" +
|
|
|
|
|
+ " AND DATE(t.create_time) <= DATE(#{eTime})\n" +
|
|
|
|
|
+ " )" +
|
|
|
|
|
+ "<if test ='nickName !=null and nickName!=\"\"'>\n" +
|
|
|
|
|
+ " and qu.qw_user_name like concat( #{nickName}, '%')\n" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test ='deptIds !=null and deptIds.size > 0'>\n" +
|
|
|
|
|
+ "and cu.dept_id in" +
|
|
|
|
|
+ "<foreach collection=\"deptIds\" item=\"deptId\" index=\"index\" separator=\",\" open=\"(\" close=\")\">\n" +
|
|
|
|
|
+ " #{deptId}\n" +
|
|
|
|
|
+ "</foreach>" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test ='(deptIds == null or deptIds.size == 0) and deptId !=null and deptId!=\"\"'>\n" +
|
|
|
|
|
+ " and cu.dept_id = #{deptId}\n" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ " <if test=\"deptIds != null and deptIds.size() != 0\">\n" +
|
|
|
|
|
+ " and cu.dept_id in\n" +
|
|
|
|
|
+ " <foreach collection=\"deptIds\" item=\"item\" open=\"(\" close=\")\" separator=\",\">\n" +
|
|
|
|
|
+ " ${item}\n" +
|
|
|
|
|
+ " </foreach>\n" +
|
|
|
|
|
+ " </if> " +
|
|
|
|
|
+ "<if test ='ids !=null and ids!=\"\"'>\n" +
|
|
|
|
|
+ " and qec.qw_user_id in (${ids})\n" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "GROUP BY\n" +
|
|
|
|
|
+ " qec.qw_user_id, DATE(qec.create_time) \n" +
|
|
|
|
|
+ "ORDER BY\n" +
|
|
|
|
|
+ " DATE(qec.create_time) "+
|
|
|
|
|
+ "</script>"})
|
|
|
|
|
+ List<QwWatchLogStatisticsListVO> selectQwExtCountByDayAndOtherExcludeTransfer(FsCourseWatchLogListParam param);
|
|
|
@Select("select \n" +
|
|
@Select("select \n" +
|
|
|
"COUNT(CASE WHEN day = 0 and status in (1,2) THEN 1 END) AS firstOnline,\n" +
|
|
"COUNT(CASE WHEN day = 0 and status in (1,2) THEN 1 END) AS firstOnline,\n" +
|
|
|
"COUNT(CASE WHEN day = 0 and status=2 THEN 1 END) AS firstOver,\n" +
|
|
"COUNT(CASE WHEN day = 0 and status=2 THEN 1 END) AS firstOver,\n" +
|