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-idle-time: 10m
|
||||||
max-life-time: 30m
|
max-life-time: 30m
|
||||||
acquire-timeout: 3s
|
acquire-timeout: 3s
|
||||||
|
datasource:
|
||||||
|
url: jdbc:postgresql://localhost:55432/manage_system
|
||||||
|
username: novalon
|
||||||
|
password: novalon123
|
||||||
|
driver-class-name: org.postgresql.Driver
|
||||||
flyway:
|
flyway:
|
||||||
enabled: true
|
enabled: true
|
||||||
locations: classpath:db/migration
|
locations: classpath:db/migration
|
||||||
|
|||||||
+2
-2
@@ -51,7 +51,7 @@ public class SysExceptionLogRepository implements ISysExceptionLogRepository {
|
|||||||
SysExceptionLogQueryCriteria criteria = new SysExceptionLogQueryCriteria();
|
SysExceptionLogQueryCriteria criteria = new SysExceptionLogQueryCriteria();
|
||||||
criteria.setUsername(username);
|
criteria.setUsername(username);
|
||||||
|
|
||||||
Query dbQuery = QueryUtil.getQuery(criteria);
|
Query dbQuery = QueryUtil.getQueryAll(criteria);
|
||||||
Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
|
Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
|
||||||
dbQuery = dbQuery.sort(sort);
|
dbQuery = dbQuery.sort(sort);
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class SysExceptionLogRepository implements ISysExceptionLogRepository {
|
|||||||
criteria.setKeyword(keyword);
|
criteria.setKeyword(keyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
Query queryObj = QueryUtil.getQuery(criteria);
|
Query queryObj = QueryUtil.getQueryAll(criteria);
|
||||||
|
|
||||||
Sort sortObj = Sort.unsorted();
|
Sort sortObj = Sort.unsorted();
|
||||||
if (sort != null && !sort.isEmpty()) {
|
if (sort != null && !sort.isEmpty()) {
|
||||||
|
|||||||
+3
-3
@@ -50,10 +50,10 @@ public class SysLoginLogRepository implements ISysLoginLogRepository {
|
|||||||
SysLoginLogQueryCriteria criteria = new SysLoginLogQueryCriteria();
|
SysLoginLogQueryCriteria criteria = new SysLoginLogQueryCriteria();
|
||||||
criteria.setUsername(username);
|
criteria.setUsername(username);
|
||||||
|
|
||||||
Query dbQuery = QueryUtil.getQuery(criteria);
|
Query dbQuery = QueryUtil.getQueryAll(criteria);
|
||||||
Sort sort = Sort.by(Sort.Direction.DESC, "loginTime");
|
Sort sort = Sort.by(Sort.Direction.DESC, "loginTime");
|
||||||
dbQuery = dbQuery.sort(sort);
|
dbQuery = dbQuery.sort(sort);
|
||||||
|
|
||||||
return r2dbcEntityTemplate.select(SysLoginLogEntity.class)
|
return r2dbcEntityTemplate.select(SysLoginLogEntity.class)
|
||||||
.matching(dbQuery)
|
.matching(dbQuery)
|
||||||
.all()
|
.all()
|
||||||
@@ -112,7 +112,7 @@ public class SysLoginLogRepository implements ISysLoginLogRepository {
|
|||||||
criteria.setKeyword(keyword);
|
criteria.setKeyword(keyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
Query queryObj = QueryUtil.getQuery(criteria);
|
Query queryObj = QueryUtil.getQueryAll(criteria);
|
||||||
|
|
||||||
Sort sortObj = Sort.unsorted();
|
Sort sortObj = Sort.unsorted();
|
||||||
if (sort != null && !sort.isEmpty()) {
|
if (sort != null && !sort.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user