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

Fuzzy query optimized more

This commit is contained in:
assina045
2023-06-08 20:49:29 +08:00
parent 3d04abc08a
commit 54dc7acba7
10 changed files with 67 additions and 89 deletions

View File

@@ -58,9 +58,8 @@ public class AffairController {
@GetMapping("/personal_affairs_fuzzy_queries")
@PreAuthorize("hasAuthority('affair:self:get')")
public ResponseResult getPersonalAffairsByTitle(String title,Long typeId,Integer status) {
System.out.println(title);
Long applicantId =WebUtil.getLoginUser().getUser().getId();
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId));
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title.trim(),typeId,status,applicantId));
}
@GetMapping("/not_approved")
@@ -74,8 +73,8 @@ public class AffairController {
@GetMapping("/not_approved_FuzzyQueries")
@PreAuthorize("hasAuthority('affair:manage:get')")
public ResponseResult<List<Affair>> selectNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId) {
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getNotApprovedByFuzzyQueries(title,typeId,status,applicantId));
public ResponseResult<List<Affair>> selectNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId,LocalDateTime startTime,LocalDateTime endTime ) {
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getNotApprovedByFuzzyQueries(title,typeId,status,applicantId,startTime,endTime));
}

View File

@@ -43,7 +43,7 @@ public interface AffairMapper extends BaseMapper<Affair> {
List<Affair> getFuzzyQueriesByAffairTitle(String title, Long typeId, Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status,Long applicantId ,LocalDateTime startTime,LocalDateTime endTime);
//
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")

View File

@@ -26,7 +26,7 @@ public interface IAffairService extends IService<Affair> {
List<User> getSameDepartmentUser (long id);
List<Affair> getFuzzyQueriesByAffairTitle(String title,Long typeId,Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId,LocalDateTime startTime,LocalDateTime endTime);
}

View File

@@ -46,7 +46,8 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
}
public List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status, Long applicantId) {
return null;
public List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status, Long applicantId, LocalDateTime startTime ,LocalDateTime endTime) {
List<Affair> affairList =affairMapper.getNotApprovedByFuzzyQueries(title,typeId,status,applicantId,startTime,endTime);
return affairList;
}
}