|
|
@@ -218,6 +218,12 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
|
|
|
List<FsCourseWatchLog> selectFsCourseWatchLogFinish();
|
|
|
|
|
|
@Select({"<script> " +
|
|
|
+ "select t.* " +
|
|
|
+ "<if test= 'sendType != 1 '> " +
|
|
|
+ " ,concat(round(if(t.send_number=0,0,(t.on_line_num/t.send_number)*100),2),'%') on_line_rate" +
|
|
|
+ " ,concat(round(if(t.send_number=0,0,(t.type2/t.send_number)*100),2),'%') finished_rate" +
|
|
|
+ "</if> " +
|
|
|
+ "from (" +
|
|
|
"SELECT \n" +
|
|
|
"o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time," +
|
|
|
"<if test= 'sendType != 1 '> " +
|
|
|
@@ -235,10 +241,17 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
|
|
|
" SUM(CASE WHEN o.log_type = '1' THEN 1 ELSE 0 END) +\n" +
|
|
|
" SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END) +\n" +
|
|
|
" SUM(CASE WHEN o.log_type = '4' THEN 1 ELSE 0 END)\n" +
|
|
|
- ") AS on_line_num\n" +
|
|
|
- "FROM fs_course_watch_log o\n" +
|
|
|
+ ") AS on_line_num " +
|
|
|
+ "<if test= 'sendType != 1 '> " +
|
|
|
+ " ,count(o.log_id) send_number" +
|
|
|
+ " ,sum(if((o.user_id is not null or o.user_id>0) and o.log_type=3,1,0)) is_user_wait_number" +
|
|
|
+ " ,sum(if((o.user_id is null or o.user_id=0) and o.log_type=3,1,0)) no_user_wait_number" +
|
|
|
+ " ,sum(ifnull(fcr.amount,0)) red_amount" +
|
|
|
+ "</if> " +
|
|
|
+ "FROM fs_course_watch_log o " +
|
|
|
"<if test= 'sendType != 1 '> " +
|
|
|
- " LEFT JOIN qw_user qu on qu.id=o.qw_user_id\n" +
|
|
|
+ " LEFT JOIN qw_user qu on qu.id=o.qw_user_id " +
|
|
|
+ " LEFT JOIN fs_course_red_packet_log fcr on o.user_id = fcr.user_id and fcr.video_id = o.video_id" +
|
|
|
"</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" +
|
|
|
@@ -275,7 +288,8 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
|
|
|
" o.company_user_id," +
|
|
|
"</if>\n" +
|
|
|
"DATE(o.create_time)\n" +
|
|
|
- "ORDER BY o.video_id ,DATE(o.create_time) \n"+
|
|
|
+ "ORDER BY o.video_id ,DATE(o.create_time) " +
|
|
|
+ ") t \n"+
|
|
|
"</script>"})
|
|
|
List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVO(FsCourseWatchLogStatisticsListParam param);
|
|
|
|