fix: 消息列表分页错误

This commit is contained in:
fit2cloud-chenyw 2021-10-22 15:55:29 +08:00
parent 1e4b40dd23
commit 82361e0f90
2 changed files with 8 additions and 11 deletions

View File

@ -42,8 +42,9 @@ public class MsgController {
List<SysMsgType> sysMsgTypes = sysMsgService.queryMsgTypes();
typeIds = sysMsgTypes.stream().filter(sysMsgType -> msgRequest.getType() == sysMsgType.getPid()).map(SysMsgType::getMsgTypeId).collect(Collectors.toList());
}
Long overTime = sysMsgService.overTime();
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
Pager<List<MsgGridDto>> listPager = PageUtils.setPageInfo(page, sysMsgService.queryGrid(userId, msgRequest, typeIds));
Pager<List<MsgGridDto>> listPager = PageUtils.setPageInfo(page, sysMsgService.queryGrid(userId, msgRequest, typeIds, overTime));
return listPager;
}

View File

@ -55,7 +55,7 @@ public class SysMsgService {
@Autowired
private SystemParameterService systemParameterService;
public List<SysMsg> query(Long userId, MsgRequest msgRequest) {
/* public List<SysMsg> query(Long userId, MsgRequest msgRequest) {
String orderClause = " create_time desc";
SysMsgExample example = new SysMsgExample();
SysMsgExample.Criteria criteria = example.createCriteria();
@ -81,8 +81,8 @@ public class SysMsgService {
List<SysMsg> sysMsgs = sysMsgMapper.selectByExample(example);
return sysMsgs;
}
public List<MsgGridDto> queryGrid(Long userId, MsgRequest msgRequest, List<Long> typeIds) {
*/
public List<MsgGridDto> queryGrid(Long userId, MsgRequest msgRequest, List<Long> typeIds, Long startTime) {
String orderClause = " create_time desc";
SysMsgExample example = new SysMsgExample();
SysMsgExample.Criteria criteria = example.createCriteria();
@ -110,7 +110,8 @@ public class SysMsgService {
criteria.andStatusEqualTo(msgRequest.getStatus());
}
criteria.andCreateTimeGreaterThanOrEqualTo(overTime());
criteria.andCreateTimeGreaterThanOrEqualTo(startTime);
/* criteria.andCreateTimeGreaterThanOrEqualTo(overTime()); */
example.setOrderByClause(orderClause);
List<MsgGridDto> msgGridDtos = extSysMsgMapper.queryGrid(example);
@ -349,11 +350,6 @@ public class SysMsgService {
}
/* public static void main(String[] args) {
Long overTime = overTime();
System.out.println(overTime);
} */
}