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

Fuzzy query debug

This commit is contained in:
assina045
2023-06-10 03:43:43 +08:00
parent 5d43ea9f55
commit b96b3a8cf6
9 changed files with 104 additions and 21 deletions

View File

@@ -73,8 +73,9 @@ 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,LocalDateTime startTime,LocalDateTime endTime ) {
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getNotApprovedByFuzzyQueries(title,typeId,status,applicantId,startTime,endTime));
public ResponseResult<List<Affair>> selectNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,LocalDateTime startTime,LocalDateTime endTime ) {
Long inspectorId= WebUtil.getLoginUser().getUser().getId();
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getNotApprovedByFuzzyQueries(title,typeId,status,inspectorId,startTime,endTime));
}
@@ -87,6 +88,13 @@ public class AffairController {
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper2));
}
@GetMapping("/approved_FuzzyQueries")
@PreAuthorize("hasAuthority('affair:manage:get')")
public ResponseResult<List<Affair>> selectApprovedByFuzzyQueries(String title,Long typeId,Integer status,LocalDateTime startTime,LocalDateTime endTime ) {
Long inspectorId =WebUtil.getLoginUser().getUser().getId();
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getApprovedByFuzzyQueries(title,typeId,status,inspectorId,startTime,endTime));
}
@PutMapping("/yes")
@PreAuthorize("hasAuthority('affair:manage:modify')")
public ResponseResult<Integer> updateAffairYes(@RequestBody Affair affair) {

View File

@@ -43,7 +43,9 @@ 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 ,LocalDateTime startTime,LocalDateTime endTime);
List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status,Long inspectorId ,LocalDateTime startTime,LocalDateTime endTime);
List<Affair> getApprovedByFuzzyQueries(String title, Long typeId, Integer status,Long inspectorId ,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,8 @@ 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,LocalDateTime startTime,LocalDateTime endTime);
List<Affair> getNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long inspectorId,LocalDateTime startTime,LocalDateTime endTime);
List<Affair> getApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long inspectorId,LocalDateTime startTime,LocalDateTime endTime);
}

View File

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

View File

@@ -38,6 +38,8 @@
<if test="status!=null ">
and instr(status,#{status})>0
</if>
and deleted = 0
and old = 0
</where>
order by create_time desc
</select>
@@ -71,8 +73,9 @@
*
from t_affair
<where>
<if test=" applicantId !=null">
applicant_id = #{applicantId}
<if test=" inspectorId !=null">
inspector_id = #{inspectorId}
and status=0
</if>
<if test=" title!=null and title!='' ">
@@ -84,14 +87,46 @@
<if test="status!=null ">
and instr(status,#{status})>0
</if>
and deleted = 0
and old = 0
</where>
order by create_time desc
</select>
<select id="getApprovedByFuzzyQueries" resultMap="affairMap3">
select
*
from t_affair
<where>
<if test=" inspectorId !=null">
inspector_id = #{inspectorId}
and status!=0
</if>
<if test=" title!=null and title!='' ">
and instr(title,#{title})&gt;0
</if>
<if test=" typeId!=null ">
and instr(type_id,#{typeId})>0
</if>
<if test="status!=null ">
and instr(status,#{status})>0
</if>
and deleted = 0
and old = 0
</where>
order by inspect_time desc
</select>
<resultMap id="affairMap2" type="affair" autoMapping="true">
<id property="id" column="id"/>
</resultMap>
<resultMap id="affairMap3" type="affair" autoMapping="true">
<id property="id" column="id"/>
</resultMap>

View File

@@ -21,17 +21,15 @@
<el-table-column label="申请者" prop="applicantId">
<template #default="scope">
{{
scope.row.applicantId === 1652714496280469506
scope.row.applicantId === 1
? 'admin'
: scope.row.applicantId === 1652714496280469506
? 'cyb'
: scope.row.applicantId === 1654151146072145921
? 'syf'
: scope.row.applicantId === 1654151877520973826
? 'gzw'
: scope.row.applicantId === 1654151930402746370
? 'yrm'
: scope.row.applicantId === 1
? 'admin'
: 'ggb'
: 'yrm'
}}
</template>
</el-table-column>

View File

@@ -22,7 +22,7 @@
<template #default="scope">
{{
scope.row.applicantId === 1
? 'ggb'
? 'admin'
: scope.row.applicantId === 1652714496280469506
? 'cyb'
: scope.row.applicantId === 1654151146072145921

View File

@@ -22,7 +22,7 @@
<template #default="scope">
{{
scope.row.inspectorId === 1
? 'ggb'
? 'admin'
: scope.row.inspectorId === 1652714496280469506
? 'cyb'
: scope.row.inspectorId === 1654151146072145921

View File

@@ -9,8 +9,12 @@
router
background-color="white"
>
<el-menu-item index="/affair/manage/toApprove"> 待审批 </el-menu-item>
<el-menu-item index="/affair/manage/Approved"> 已审批 </el-menu-item>
<el-menu-item index="/affair/manage/toApprove" @click="turnToNotApproved">
待审批
</el-menu-item>
<el-menu-item index="/affair/manage/Approved" @click="turnToApproved">
已审批
</el-menu-item>
</el-menu>
</el-col>
</el-header>
@@ -50,7 +54,12 @@
<!-- </el-col>-->
<el-col :span="1"></el-col>
<el-col :span="3">
<el-button type="primary" @click="onSubmit">查询</el-button>
<el-button type="primary" @click="onSubmit1" v-if="flagNotApproved"
>查询</el-button
>
<el-button type="primary" @click="onSubmit2" v-if="flagApproved"
>查询</el-button
>
<el-button type="primary" @click="resetForm">重置</el-button>
</el-col>
</el-row>
@@ -76,6 +85,9 @@ export default {
startTime: '',
endTime: ''
},
flagNotApproved: true,
flagApproved: false,
count: 0,
DataToRouterView: {}
}
},
@@ -86,7 +98,7 @@ export default {
turnFormViewTrue() {
this.formView = true
},
onSubmit() {
onSubmit1() {
request
.get('/affair/not_approved_FuzzyQueries', this.formData)
.then((response) => {
@@ -97,8 +109,29 @@ export default {
console.log(reportError)
})
},
onSubmit2() {
request
.get('/affair/approved_FuzzyQueries', this.formData)
.then((response) => {
this.DataToRouterView = response.data.data
console.log(response.data)
})
.catch((reportError) => {
console.log(reportError)
})
},
turnToNotApproved() {
this.flagApproved = false
this.flagNotApproved = true
},
turnToApproved() {
this.flagNotApproved = false
this.flagApproved = true
},
resetForm() {
this.$router.go()
if (this.flagNotApproved) {
this.$router.go()
}
}
}
}