mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
Fuzzy query optimized
This commit is contained in:
@@ -72,6 +72,12 @@ public class AffairController {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/approved")
|
||||
@PreAuthorize("hasAuthority('affair:manage:get')")
|
||||
|
||||
@@ -43,6 +43,8 @@ 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);
|
||||
|
||||
//
|
||||
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")
|
||||
// @ResultType(Affair.class)
|
||||
|
||||
@@ -26,5 +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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,4 +44,9 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
|
||||
List<Affair> affairList = affairMapper.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId);
|
||||
return affairList;
|
||||
}
|
||||
|
||||
|
||||
public List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status, Long applicantId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,35 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getNotApprovedByFuzzyQueries" resultMap="affairMap2">
|
||||
select
|
||||
*
|
||||
from t_affair
|
||||
<where>
|
||||
<if test=" applicantId !=null">
|
||||
applicant_id = #{applicantId}
|
||||
</if>
|
||||
|
||||
<if test=" title!=null and title!='' ">
|
||||
and instr(title,#{title})>0
|
||||
</if>
|
||||
<if test=" typeId!=null ">
|
||||
and instr(type_id,#{typeId})>0
|
||||
</if>
|
||||
<if test="status!=null ">
|
||||
and instr(status,#{status})>0
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<resultMap id="affairMap2" type="affair" autoMapping="true">
|
||||
<id property="id" column="id"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user