fix(db): 修复日志查询使用 QueryUtil.getQuery 改为 getQueryAll
SysExceptionLogRepository 和 SysLoginLogRepository 中 getQuery 改为 getQueryAll 以正确查询包含软删除记录的日志数据; 补充开发环境 PostgreSQL 数据源配置。
This commit is contained in:
@@ -11,6 +11,11 @@ spring:
|
||||
max-idle-time: 10m
|
||||
max-life-time: 30m
|
||||
acquire-timeout: 3s
|
||||
datasource:
|
||||
url: jdbc:postgresql://localhost:55432/manage_system
|
||||
username: novalon
|
||||
password: novalon123
|
||||
driver-class-name: org.postgresql.Driver
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ public class SysExceptionLogRepository implements ISysExceptionLogRepository {
|
||||
SysExceptionLogQueryCriteria criteria = new SysExceptionLogQueryCriteria();
|
||||
criteria.setUsername(username);
|
||||
|
||||
Query dbQuery = QueryUtil.getQuery(criteria);
|
||||
Query dbQuery = QueryUtil.getQueryAll(criteria);
|
||||
Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
|
||||
dbQuery = dbQuery.sort(sort);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class SysExceptionLogRepository implements ISysExceptionLogRepository {
|
||||
criteria.setKeyword(keyword);
|
||||
}
|
||||
|
||||
Query queryObj = QueryUtil.getQuery(criteria);
|
||||
Query queryObj = QueryUtil.getQueryAll(criteria);
|
||||
|
||||
Sort sortObj = Sort.unsorted();
|
||||
if (sort != null && !sort.isEmpty()) {
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ public class SysLoginLogRepository implements ISysLoginLogRepository {
|
||||
SysLoginLogQueryCriteria criteria = new SysLoginLogQueryCriteria();
|
||||
criteria.setUsername(username);
|
||||
|
||||
Query dbQuery = QueryUtil.getQuery(criteria);
|
||||
Query dbQuery = QueryUtil.getQueryAll(criteria);
|
||||
Sort sort = Sort.by(Sort.Direction.DESC, "loginTime");
|
||||
dbQuery = dbQuery.sort(sort);
|
||||
|
||||
@@ -112,7 +112,7 @@ public class SysLoginLogRepository implements ISysLoginLogRepository {
|
||||
criteria.setKeyword(keyword);
|
||||
}
|
||||
|
||||
Query queryObj = QueryUtil.getQuery(criteria);
|
||||
Query queryObj = QueryUtil.getQueryAll(criteria);
|
||||
|
||||
Sort sortObj = Sort.unsorted();
|
||||
if (sort != null && !sort.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user