|
|
@@ -138,15 +138,46 @@ public interface LiveMapper
|
|
|
"select * from live where 1=1 " +
|
|
|
" <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1 " +
|
|
|
" <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if> " +
|
|
|
- " order by create_time desc" +
|
|
|
+ " UNION " +
|
|
|
+ "select l.* from live l " +
|
|
|
+ "LEFT JOIN ( " +
|
|
|
+ " SELECT live_id, SUM(COALESCE(duration, 0)) AS total_duration " +
|
|
|
+ " FROM live_video " +
|
|
|
+ " WHERE video_type IN (1, 2) " +
|
|
|
+ " GROUP BY live_id " +
|
|
|
+ ") video_duration ON l.live_id = video_duration.live_id " +
|
|
|
+ "where 1=1 " +
|
|
|
+ " <if test='param.companyId!=null' > and l.company_id = #{param.companyId} </if> " +
|
|
|
+ "and l.live_type IN (1,2, 3) AND l.status = 2 AND l.is_del = 0 and l.is_audit=1 " +
|
|
|
+ "and l.start_time IS NOT NULL " +
|
|
|
+ "and TIMESTAMPDIFF(SECOND, l.start_time, NOW()) > COALESCE(video_duration.total_duration, 0) " +
|
|
|
+ "and COALESCE(video_duration.total_duration, 0) > 0 " +
|
|
|
+ " <if test='param.liveName!=null' > and l.live_name like concat('%' ,#{param.liveName},'%') </if> " +
|
|
|
+ "order by create_time desc" +
|
|
|
" </script>"})
|
|
|
List<Live> listLiveData(@Param("param") LiveDataParam param);
|
|
|
|
|
|
@Select({"<script>" +
|
|
|
- "select count(1) from live where 1=1 " +
|
|
|
- " <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1" +
|
|
|
- " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if>" +
|
|
|
- " order by create_time desc " +
|
|
|
+ "select count(1) from ( " +
|
|
|
+ "select * from live where 1=1 " +
|
|
|
+ " <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1 " +
|
|
|
+ " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if> " +
|
|
|
+ " UNION " +
|
|
|
+ "select l.* from live l " +
|
|
|
+ "LEFT JOIN ( " +
|
|
|
+ " SELECT live_id, SUM(COALESCE(duration, 0)) AS total_duration " +
|
|
|
+ " FROM live_video " +
|
|
|
+ " WHERE video_type IN (1, 2) " +
|
|
|
+ " GROUP BY live_id " +
|
|
|
+ ") video_duration ON l.live_id = video_duration.live_id " +
|
|
|
+ "where 1=1 " +
|
|
|
+ " <if test='param.companyId!=null' > and l.company_id = #{param.companyId} </if> " +
|
|
|
+ "and l.live_type IN (1,2, 3) AND l.status = 2 AND l.is_del = 0 and l.is_audit=1 " +
|
|
|
+ "and l.start_time IS NOT NULL " +
|
|
|
+ "and TIMESTAMPDIFF(SECOND, l.start_time, NOW()) > COALESCE(video_duration.total_duration, 0) " +
|
|
|
+ "and COALESCE(video_duration.total_duration, 0) > 0 " +
|
|
|
+ " <if test='param.liveName!=null' > and l.live_name like concat('%' ,#{param.liveName},'%') </if> " +
|
|
|
+ ") as temp " +
|
|
|
" </script>"})
|
|
|
int listLiveDataCount(@Param("param") LiveDataParam param);
|
|
|
|