mirror of https://gitee.com/stylefeng/roses
整理wrapper查询逻辑
parent
16b4e825fb
commit
576fa5aeb7
|
@ -134,7 +134,15 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||||
private LambdaQueryWrapper<SysConfig> createWrapper(SysConfigParam sysConfigParam) {
|
private LambdaQueryWrapper<SysConfig> createWrapper(SysConfigParam sysConfigParam) {
|
||||||
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (ObjectUtil.isNotNull(sysConfigParam)) {
|
// 查询未删除的
|
||||||
|
queryWrapper.ne(SysConfig::getDelFlag, YesOrNotEnum.Y.getCode());
|
||||||
|
|
||||||
|
// 按类型升序排列,同类型的排在一起
|
||||||
|
queryWrapper.orderByDesc(SysConfig::getGroupCode);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(sysConfigParam)) {
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
String configName = sysConfigParam.getConfigName();
|
String configName = sysConfigParam.getConfigName();
|
||||||
String configCode = sysConfigParam.getConfigCode();
|
String configCode = sysConfigParam.getConfigCode();
|
||||||
|
@ -148,13 +156,6 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||||
|
|
||||||
// 如果分类编码不为空,则带上分类编码
|
// 如果分类编码不为空,则带上分类编码
|
||||||
queryWrapper.eq(ObjectUtil.isNotEmpty(groupCode), SysConfig::getGroupCode, groupCode);
|
queryWrapper.eq(ObjectUtil.isNotEmpty(groupCode), SysConfig::getGroupCode, groupCode);
|
||||||
}
|
|
||||||
|
|
||||||
// 查询未删除的
|
|
||||||
queryWrapper.ne(SysConfig::getDelFlag, YesOrNotEnum.Y.getCode());
|
|
||||||
|
|
||||||
// 按类型升序排列,同类型的排在一起
|
|
||||||
queryWrapper.orderByDesc(SysConfig::getGroupCode);
|
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,15 +222,19 @@ public class DatabaseInfoServiceImpl extends ServiceImpl<DatabaseInfoMapper, Dat
|
||||||
private LambdaQueryWrapper<DatabaseInfo> createWrapper(DatabaseInfoRequest databaseInfoRequest) {
|
private LambdaQueryWrapper<DatabaseInfo> createWrapper(DatabaseInfoRequest databaseInfoRequest) {
|
||||||
LambdaQueryWrapper<DatabaseInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DatabaseInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
// 查询没被删除的
|
||||||
|
queryWrapper.eq(DatabaseInfo::getDelFlag, YesOrNotEnum.N.getCode());
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(databaseInfoRequest)) {
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
// 根据名称模糊查询
|
// 根据名称模糊查询
|
||||||
String dbName = databaseInfoRequest.getDbName();
|
String dbName = databaseInfoRequest.getDbName();
|
||||||
|
|
||||||
// 拼接sql 条件
|
// 拼接sql 条件
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(dbName), DatabaseInfo::getDbName, dbName);
|
queryWrapper.like(ObjectUtil.isNotEmpty(dbName), DatabaseInfo::getDbName, dbName);
|
||||||
|
|
||||||
// 查询没被删除的
|
|
||||||
queryWrapper.eq(DatabaseInfo::getDelFlag, YesOrNotEnum.N.getCode());
|
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,13 @@ public class TranslationServiceImpl extends ServiceImpl<TranslationMapper, Trans
|
||||||
private LambdaQueryWrapper<Translation> createWrapper(TranslationRequest translationRequest) {
|
private LambdaQueryWrapper<Translation> createWrapper(TranslationRequest translationRequest) {
|
||||||
LambdaQueryWrapper<Translation> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Translation> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
// 按翻译编码倒序排列
|
||||||
|
queryWrapper.orderByDesc(Translation::getTranCode);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(translationRequest)) {
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
Long tranId = translationRequest.getTranId();
|
Long tranId = translationRequest.getTranId();
|
||||||
String tranCode = translationRequest.getTranCode();
|
String tranCode = translationRequest.getTranCode();
|
||||||
String tranName = translationRequest.getTranName();
|
String tranName = translationRequest.getTranName();
|
||||||
|
@ -142,9 +149,6 @@ public class TranslationServiceImpl extends ServiceImpl<TranslationMapper, Trans
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(tranName), Translation::getTranName, tranName);
|
queryWrapper.like(ObjectUtil.isNotEmpty(tranName), Translation::getTranName, tranName);
|
||||||
queryWrapper.eq(ObjectUtil.isNotEmpty(tranLanguageCode), Translation::getTranLanguageCode, tranLanguageCode);
|
queryWrapper.eq(ObjectUtil.isNotEmpty(tranLanguageCode), Translation::getTranLanguageCode, tranLanguageCode);
|
||||||
|
|
||||||
// 按翻译编码倒序排列
|
|
||||||
queryWrapper.orderByDesc(Translation::getTranCode);
|
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,13 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
|
||||||
private LambdaQueryWrapper<SysLog> createWrapper(LogManagerRequest logManagerRequest) {
|
private LambdaQueryWrapper<SysLog> createWrapper(LogManagerRequest logManagerRequest) {
|
||||||
LambdaQueryWrapper<SysLog> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
// 根据时间倒序排序
|
||||||
|
queryWrapper.orderByDesc(SysLog::getCreateTime);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(logManagerRequest)) {
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
String beginDateTime = logManagerRequest.getBeginDateTime();
|
String beginDateTime = logManagerRequest.getBeginDateTime();
|
||||||
String endDateTime = logManagerRequest.getEndDateTime();
|
String endDateTime = logManagerRequest.getEndDateTime();
|
||||||
|
|
||||||
|
@ -109,9 +116,6 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
|
||||||
queryWrapper.eq(StrUtil.isNotEmpty(clientIp), SysLog::getClientIp, clientIp);
|
queryWrapper.eq(StrUtil.isNotEmpty(clientIp), SysLog::getClientIp, clientIp);
|
||||||
queryWrapper.eq(StrUtil.isNotEmpty(url), SysLog::getRequestUrl, url);
|
queryWrapper.eq(StrUtil.isNotEmpty(url), SysLog::getRequestUrl, url);
|
||||||
|
|
||||||
// 根据时间倒序排序
|
|
||||||
queryWrapper.orderByDesc(SysLog::getCreateTime);
|
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue