|
@@ -11,12 +11,14 @@ import com.fs.course.vo.*;
|
|
|
import com.fs.im.dto.OpenImBatchResponseDataDTO;
|
|
import com.fs.im.dto.OpenImBatchResponseDataDTO;
|
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
|
import com.fs.sop.vo.QwRatingVO;
|
|
import com.fs.sop.vo.QwRatingVO;
|
|
|
|
|
+import org.apache.ibatis.annotations.Delete;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
import org.apache.ibatis.annotations.Update;
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
import org.springframework.stereotype.Repository;
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -557,4 +559,27 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
|
|
|
* 查询训练营看课人数
|
|
* 查询训练营看课人数
|
|
|
*/
|
|
*/
|
|
|
Integer getUserCountByCampId(@Param("trainingCampId") Long trainingCampId);
|
|
Integer getUserCountByCampId(@Param("trainingCampId") Long trainingCampId);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Select("SELECT log_id FROM fs_course_watch_log WHERE create_time < #{cutoffTime} LIMIT 1000")
|
|
|
|
|
+ List<Long> selectDelOldDataIds(@Param("cutoffTime") LocalDateTime cutoffTime);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 批量删除数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @Delete({
|
|
|
|
|
+ "<script>",
|
|
|
|
|
+ "DELETE FROM fs_course_watch_log WHERE log_id IN ",
|
|
|
|
|
+ "<foreach collection='ids' item='id' open='(' separator=',' close=')'>",
|
|
|
|
|
+ "#{id}",
|
|
|
|
|
+ "</foreach>",
|
|
|
|
|
+ "</script>"
|
|
|
|
|
+ })
|
|
|
|
|
+ int batchDelLog(@Param("ids") List<Long> ids);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 统计一个月前的数据总量(可选)
|
|
|
|
|
+ */
|
|
|
|
|
+ @Select("SELECT COUNT(*) FROM fs_course_watch_log WHERE create_time < #{cutoffTime}")
|
|
|
|
|
+ long countOldData(@Param("cutoffTime") LocalDateTime cutoffTime);
|
|
|
}
|
|
}
|