【优化】日志page查询中排除部分字段(提升查询速度)

pull/181/head
vchao 2023-12-05 15:59:54 +08:00
parent a80623c453
commit 4b6a04538a
1 changed files with 7 additions and 0 deletions

View File

@ -57,6 +57,13 @@ public class DevLogServiceImpl extends ServiceImpl<DevLogMapper, DevLog> impleme
@Override
public Page<DevLog> page(DevLogPageParam devLogPageParam) {
QueryWrapper<DevLog> queryWrapper = new QueryWrapper<>();
// page查询中排除较大的字段提升查询速度
queryWrapper.select(DevLog.class, info ->
!info.getColumn().equalsIgnoreCase("param_json")
&& !info.getColumn().equalsIgnoreCase("result_json")
&& !info.getColumn().equalsIgnoreCase("exe_message")
&& !info.getColumn().equalsIgnoreCase("sign_data")
);
if(ObjectUtil.isNotEmpty(devLogPageParam.getCategory())) {
queryWrapper.lambda().eq(DevLog::getCategory, devLogPageParam.getCategory());
}