1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

add the function of fuzzy query item

This commit is contained in:
cccccyb
2023-06-04 02:27:47 +08:00
parent 6860f2bdac
commit fe876c5a36
9 changed files with 50 additions and 41 deletions

View File

@@ -39,15 +39,15 @@ public class NoticeController {
//分页查询所有公告或分页模糊查询
@GetMapping("/page")
@PreAuthorize("hasAuthority('notice:manage:get')")
public ResponseResult<List<Notice>> selectPageNotice(Integer currentPage, Integer pageSize, String title, String type, String startTime, String endTime) {
Page<Notice> noticePage = null;
public ResponseResult<List<Notice>> selectPageNotice(Integer currentPage, Integer pageSize, String title, String type, String startTime, String endTime,String userName) {
Page<Notice> noticePage;
if (null != currentPage && null != pageSize) {
noticePage = PageDTO.of(currentPage, pageSize);
} else {
// 不进行分页
noticePage = PageDTO.of(1, -1);
}
IPage<Notice> noticeIPage = noticeService.selectPageNotice(noticePage, title.trim(), type.trim(), startTime.trim(), endTime.trim());
IPage<Notice> noticeIPage = noticeService.selectPageNotice(noticePage, title.trim(), type.trim(), startTime.trim(), endTime.trim(),userName.trim());
int code = noticeIPage.getRecords() != null ? ResponseCode.DATABASE_SELECT_OK : ResponseCode.DATABASE_SELECT_ERROR;
String msg = noticeIPage.getRecords() != null ? String.valueOf(noticeIPage.getTotal()) : "数据查询失败,请重试!";
return ResponseResult.build(code, msg, noticeIPage.getRecords());