@@ -18,15 +19,17 @@ public interface XiaoDuHistoryTBRepository extends JpaRepository<XiaoDuHistoryTB
...
@@ -18,15 +19,17 @@ public interface XiaoDuHistoryTBRepository extends JpaRepository<XiaoDuHistoryTB
@Query(value="SELECT DISTINCT xiaodu_user_id FROM xiaodu_history_tb",nativeQuery=true)
@Query(value="SELECT DISTINCT xiaodu_user_id FROM xiaodu_history_tb",nativeQuery=true)
List<String>getAllUser();
List<String>getAllUser();
@Transactional
@Modifying
@Query(value="delete from xiaodu_history_tb where xiaodu_user_id=?1 and last_time < (select last_time from xiaodu_history_tb where xiaodu_user_id=?1 order by last_time limit 14,1)",nativeQuery=true)
@Transactional(rollbackFor=Exception.class)
@Query(value="delete from xiaodu_history_tb where xiaodu_user_id=?1 and last_time < (select last_time from (select last_time from xiaodu_history_tb where xiaodu_user_id=?1 order by last_time limit 14,1) t1)",nativeQuery=true)
voiddeleteOverTime(StringuserId);
voiddeleteOverTime(StringuserId);
@Transactional
@Modifying
@Transactional(rollbackFor=Exception.class)
@Query(value="delete from xiaodu_history_tb where last_time <?1",nativeQuery=true)
@Query(value="delete from xiaodu_history_tb where last_time <?1",nativeQuery=true)