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

Fuzzy query was completed and AffairsCard optimized

This commit is contained in:
assina045
2023-06-08 00:40:43 +08:00
parent 09723e427c
commit 640c3bca34
10 changed files with 174 additions and 61 deletions

View File

@@ -55,11 +55,12 @@ public class AffairController {
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
}
@GetMapping("/personal_affairs_title")
@GetMapping("/personal_affairs_fuzzy_queries")
@PreAuthorize("hasAuthority('affair:self:get')")
public ResponseResult getPersonalAffairsByTitle(String title,Integer typeId,Integer status,Integer inspectorId,String startTime,String endTime) {
public ResponseResult getPersonalAffairsByTitle(String title,Long typeId,Integer status) {
System.out.println(title);
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title,typeId,status,inspectorId,startTime,endTime));
Long applicantId =WebUtil.getLoginUser().getUser().getId();
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId));
}
@GetMapping("/not_approved")

View File

@@ -41,7 +41,7 @@ public interface AffairMapper extends BaseMapper<Affair> {
List<User> getSameDepartmentUser(@Param("id") long id);
List<Affair> getFuzzyQueriesByAffairTitle(String title, Integer typeId, Integer status, Integer inspectorId,LocalDateTime start,LocalDateTime end );
List<Affair> getFuzzyQueriesByAffairTitle(String title, Long typeId, Integer status,Long applicantId);
//
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")

View File

@@ -24,7 +24,7 @@ public interface IAffairService extends IService<Affair> {
// int deleteAffair_ApprovedByID(Affair affair);
List<User> getSameDepartmentUser (long id);
List<Affair> getFuzzyQueriesByAffairTitle(String title,Integer typeId,Integer status,Integer inspectorId,String startTime,String endTime);
List<Affair> getFuzzyQueriesByAffairTitle(String title,Long typeId,Integer status,Long applicantId);
}

View File

@@ -40,13 +40,8 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
}
public List<Affair> getFuzzyQueriesByAffairTitle(String title ,Integer typeId,Integer status,Integer inspectorId,String startTime, String endTime) {
LocalDateTime start=null,end=null;
if (startTime!=""&&endTime!=""){
start= LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
end = LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
}
List<Affair> affairList = affairMapper.getFuzzyQueriesByAffairTitle(title,typeId,status,inspectorId,start,end);
public List<Affair> getFuzzyQueriesByAffairTitle(String title ,Long typeId,Integer status,Long applicantId) {
List<Affair> affairList = affairMapper.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId);
return affairList;
}
}

View File

@@ -25,8 +25,12 @@
*
from t_affair
<where>
<if test=" applicantId !=null">
applicant_id = #{applicantId}
</if>
<if test=" title!=null and title!='' ">
instr(title,#{title})&gt;0
and instr(title,#{title})&gt;0
</if>
<if test=" typeId!=null ">
and instr(type_id,#{typeId})>0
@@ -34,15 +38,6 @@
<if test="status!=null ">
and instr(status,#{status})>0
</if>
<if test="inspectorId!=null">
and instr(inspector_id,#{inspectorId})>0
</if>
<if test="createTime!=null">
and create_time &gt;= #{start}
</if>
<if test="endTime!=null">
and create_time &lt; #{end}
</if>
</where>
order by create_time desc
</select>