Răsfoiți Sursa

日志更新

liuchengsen 3 săptămâni în urmă
părinte
comite
2bd9eb3733

+ 2 - 10
backend-java/src/main/java/com/pharmacopoeia/repository/QuickAskAuditLogRepository.java

@@ -13,18 +13,10 @@ import java.time.Instant;
 @Repository
 @Repository
 public interface QuickAskAuditLogRepository extends JpaRepository<QuickAskAuditLog, Long> {
 public interface QuickAskAuditLogRepository extends JpaRepository<QuickAskAuditLog, Long> {
 
 
-    Page<QuickAskAuditLog> findAllByOrderByCreatedAtDesc(Pageable pageable);
-
-    /**
-     * 按操作类型筛选审计日志(action = CREATE / UPDATE / DELETE)
-     * 前端 auditLog 接口可传 action 参数,后端自动使用此方法查询
-     */
-    Page<QuickAskAuditLog> findByActionOrderByCreatedAtDesc(String action, Pageable pageable);
-
     @Query("SELECT a FROM QuickAskAuditLog a WHERE "
     @Query("SELECT a FROM QuickAskAuditLog a WHERE "
          + "(:action IS NULL OR a.action = :action) AND "
          + "(:action IS NULL OR a.action = :action) AND "
-         + "(:startTime IS NULL OR a.createdAt >= :startTime) AND "
-         + "(:endTime IS NULL OR a.createdAt < :endTime) "
+         + "(CAST(:startTime AS java.time.Instant) IS NULL OR a.createdAt >= :startTime) AND "
+         + "(CAST(:endTime AS java.time.Instant) IS NULL OR a.createdAt < :endTime) "
          + "ORDER BY a.createdAt DESC")
          + "ORDER BY a.createdAt DESC")
     Page<QuickAskAuditLog> findByFilters(
     Page<QuickAskAuditLog> findByFilters(
             @Param("action") String action,
             @Param("action") String action,