|
@@ -219,32 +219,57 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
|
|
|
|
|
|
@Select({"<script> " +
|
|
|
"SELECT \n" +
|
|
|
- "o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time,qu.qw_user_name,v.title videoName,uc.course_name,\n" +
|
|
|
+ "o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time," +
|
|
|
+ "<if test= 'sendType != 1 '> " +
|
|
|
+ " qu.qw_user_name qw_user_name," +
|
|
|
+ "</if>\n" +
|
|
|
+ "<if test= 'sendType == 1 '> " +
|
|
|
+ " cu.nick_name qw_user_name," +
|
|
|
+ "</if>\n" +
|
|
|
+ "v.title videoName,uc.course_name,\n" +
|
|
|
"SUM(CASE WHEN o.log_type = '1' THEN 1 ELSE 0 END) AS type1,\n" +
|
|
|
"SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END) AS type2,\n" +
|
|
|
"SUM(CASE WHEN o.log_type = '3' THEN 1 ELSE 0 END) AS type3,\n" +
|
|
|
"SUM(CASE WHEN o.log_type = '4' THEN 1 ELSE 0 END) AS type4\n" +
|
|
|
"FROM fs_course_watch_log o\n" +
|
|
|
- "LEFT JOIN qw_user qu on qu.id=o.qw_user_id\n" +
|
|
|
+ "<if test= 'sendType != 1 '> " +
|
|
|
+ " LEFT JOIN qw_user qu on qu.id=o.qw_user_id\n" +
|
|
|
+ "</if>\n" +
|
|
|
"LEFT JOIN fs_user_course_video v on v.video_id=o.video_id \n" +
|
|
|
"LEFT JOIN fs_user_course uc on uc.course_id=v.course_id\n" +
|
|
|
- "where o.company_id=#{companyId} AND send_type=2 " +
|
|
|
+ "<if test= 'sendType == 1 '> " +
|
|
|
+ " LEFT JOIN company_user cu on cu.user_id=o.company_user_id\n" +
|
|
|
+ "</if>\n" +
|
|
|
+ "where o.company_id=#{companyId} " +
|
|
|
+ "<if test= 'sendType != null '> " +
|
|
|
+ " and send_type= #{sendType} " +
|
|
|
+ "</if>\n" +
|
|
|
"<if test= 'sTime != null '> " +
|
|
|
" and DATE(o.create_time) >= DATE(#{sTime})\n" +
|
|
|
"</if>\n" +
|
|
|
"<if test='eTime != null '> " +
|
|
|
" and DATE(o.create_time) <= DATE(#{eTime})\n" +
|
|
|
"</if>" +
|
|
|
- "<if test ='nickName !=null and nickName!=\"\"'>\n" +
|
|
|
+ "<if test ='sendType != 1 and nickName !=null and nickName!=\"\"'>\n" +
|
|
|
" and qu.qw_user_name like concat( #{nickName}, '%')\n" +
|
|
|
"</if>" +
|
|
|
+ "<if test ='sendType == 1 and nickName !=null and nickName!=\"\"'>\n" +
|
|
|
+ " and cu.nick_name like concat( #{nickName}, '%')\n" +
|
|
|
+ "</if>" +
|
|
|
"<if test ='courseId !=null'> " +
|
|
|
" and o.course_id = #{courseId} " +
|
|
|
"</if>" +
|
|
|
"<if test ='videoId !=null'> " +
|
|
|
" and o.video_id = #{videoId} " +
|
|
|
"</if>" +
|
|
|
- "GROUP BY o.video_id,o.qw_user_id,DATE(o.create_time)\n" +
|
|
|
+ "GROUP BY o.video_id," +
|
|
|
+ "<if test= 'sendType != 1 '> " +
|
|
|
+ " o.qw_user_id," +
|
|
|
+ "</if>\n" +
|
|
|
+ "<if test= 'sendType == 1 '> " +
|
|
|
+ " o.company_user_id," +
|
|
|
+ "</if>\n" +
|
|
|
+ "DATE(o.create_time)\n" +
|
|
|
"ORDER BY o.video_id ,DATE(o.create_time) \n"+
|
|
|
"</script>"})
|
|
|
List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVO(FsCourseWatchLogStatisticsListParam param);
|