mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 15:01:23 +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));
|
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")
|
@GetMapping("/approved")
|
||||||
@PreAuthorize("hasAuthority('affair:manage:get')")
|
@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> 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 ")
|
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")
|
||||||
// @ResultType(Affair.class)
|
// @ResultType(Affair.class)
|
||||||
|
|||||||
@@ -26,5 +26,7 @@ public interface IAffairService extends IService<Affair> {
|
|||||||
List<User> getSameDepartmentUser (long id);
|
List<User> getSameDepartmentUser (long id);
|
||||||
List<Affair> getFuzzyQueriesByAffairTitle(String title,Long typeId,Integer status,Long applicantId);
|
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);
|
List<Affair> affairList = affairMapper.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId);
|
||||||
return affairList;
|
return affairList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status, Long applicantId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,35 @@
|
|||||||
</resultMap>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -1,20 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-col :span="16">
|
|
||||||
<div class="mt-4">
|
|
||||||
<el-input placeholder="查询事务" class="input-with-select">
|
|
||||||
<template #prepend>
|
|
||||||
<el-select placeholder="查询方式">
|
|
||||||
<el-option label="事务编号" value="1" />
|
|
||||||
<el-option label="事务名称" value="2" />
|
|
||||||
<el-option label="日期" value="3" />
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
<template #append>
|
|
||||||
<el-button>查询</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-table :data="tableData" style="width: 100%">
|
<el-table :data="tableData" style="width: 100%">
|
||||||
<el-table-column label="事务编号" prop="id" />
|
<el-table-column label="事务编号" prop="id" />
|
||||||
|
|
||||||
@@ -214,6 +198,12 @@ export default {
|
|||||||
this.getApproved()
|
this.getApproved()
|
||||||
this.dialogFalse()
|
this.dialogFalse()
|
||||||
this.getUser()
|
this.getUser()
|
||||||
|
},
|
||||||
|
props: ['DataToRouterView'],
|
||||||
|
watch: {
|
||||||
|
DataToRouterView: function (val) {
|
||||||
|
this.tableData = val
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,20 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-col :span="16">
|
|
||||||
<div class="mt-4">
|
|
||||||
<el-input placeholder="查询事务" class="input-with-select">
|
|
||||||
<template #prepend>
|
|
||||||
<el-select placeholder="查询方式">
|
|
||||||
<el-option label="事务编号" value="1" />
|
|
||||||
<el-option label="事务名称" value="2" />
|
|
||||||
<el-option label="日期" value="3" />
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
<template #append>
|
|
||||||
<el-button>查询</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-table :data="tableData" style="width: 100%">
|
<el-table :data="tableData" style="width: 100%">
|
||||||
<el-table-column label="事务编号" prop="id" />
|
<el-table-column label="事务编号" prop="id" />
|
||||||
|
|
||||||
@@ -199,7 +183,13 @@ export default {
|
|||||||
console.log('not approved created')
|
console.log('not approved created')
|
||||||
this.getApproved()
|
this.getApproved()
|
||||||
this.dialogFalse()
|
this.dialogFalse()
|
||||||
} // 获取事务信息
|
}, // 获取事务信息
|
||||||
|
props: ['DataToRouterView'],
|
||||||
|
watch: {
|
||||||
|
DataToRouterView: function (val) {
|
||||||
|
this.tableData = val
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|||||||
@@ -192,13 +192,6 @@ export default {
|
|||||||
dialogFalse() {
|
dialogFalse() {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
}
|
}
|
||||||
// forRouter() {
|
|
||||||
// setInterval(() => {
|
|
||||||
// if (this.DataToRouterView !== '') {
|
|
||||||
// this.tableData = this.DataToRouterView
|
|
||||||
// }
|
|
||||||
// }, 500)
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getApproved()
|
this.getApproved()
|
||||||
|
|||||||
@@ -1,23 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :span="24">
|
<el-container>
|
||||||
<el-col :span="18">
|
<el-header>
|
||||||
<div class="mt-4">
|
<el-col :span="24">
|
||||||
<el-input placeholder="查询事务" class="input-with-select">
|
|
||||||
<template #prepend>
|
|
||||||
<el-select placeholder="查询方式">
|
|
||||||
<el-option label="事务编号" value="1" />
|
|
||||||
<el-option label="事务名称" value="2" />
|
|
||||||
<el-option label="日期" value="3" />
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
<template #append>
|
|
||||||
<el-button>查询</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="$route.path"
|
:default-active="$route.path"
|
||||||
class="el-menu-demo"
|
class="el-menu-demo"
|
||||||
@@ -25,26 +9,89 @@
|
|||||||
router
|
router
|
||||||
background-color="white"
|
background-color="white"
|
||||||
>
|
>
|
||||||
<el-menu-item index="/affair/manage/toApprove">
|
<el-menu-item index="/affair/manage/toApprove"> 待审批 </el-menu-item>
|
||||||
<el-button type="warning" round>待审批</el-button>
|
<el-menu-item index="/affair/manage/Approved"> 已审批 </el-menu-item>
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="/affair/manage/Approved">
|
|
||||||
<el-button type="success" round>已审批</el-button>
|
|
||||||
</el-menu-item>
|
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-col>
|
</el-col>
|
||||||
<router-view></router-view>
|
</el-header>
|
||||||
|
|
||||||
|
<el-main>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form :model="formData">
|
||||||
|
<el-row :span="24">
|
||||||
|
<el-col :span="5">
|
||||||
|
<el-form-item label="事务标题:"
|
||||||
|
><el-input v-model="formData.title"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1"></el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-form-item label="事务类型:"
|
||||||
|
><el-select v-model="formData.typeId">
|
||||||
|
<el-option label="事假" name="type1" value="1"></el-option>
|
||||||
|
<el-option label="病假" name="type2" value="2"></el-option>
|
||||||
|
<el-option label="财务报销" name="type3" value="3"></el-option>
|
||||||
|
<el-option label="调休" name="type4" value="4"></el-option>
|
||||||
|
</el-select> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="1"></el-col>
|
||||||
|
<el-col :span="4"
|
||||||
|
><el-form-item label="审批进度:">
|
||||||
|
<el-select v-model="formData.status">
|
||||||
|
<el-option label="未审批" value="0"></el-option>
|
||||||
|
<el-option label="同意" value="1"></el-option>
|
||||||
|
<el-option label="驳回" value="2"></el-option>
|
||||||
|
</el-select> </el-form-item
|
||||||
|
></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="resetForm">重置</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
<router-view :DataToRouterView="DataToRouterView"></router-view>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { COLOR_BACKGROUND } from '@/constants/Common.constants'
|
import request from '@/services'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AffairManage',
|
name: 'AffairManage',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formView: true,
|
||||||
|
formData: {
|
||||||
|
title: '',
|
||||||
|
typeId: '',
|
||||||
|
status: ''
|
||||||
|
},
|
||||||
|
DataToRouterView: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
COLOR_BACKGROUND() {
|
turnFormViewFalse() {
|
||||||
return COLOR_BACKGROUND
|
this.formView = false
|
||||||
|
},
|
||||||
|
turnFormViewTrue() {
|
||||||
|
this.formView = true
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
request
|
||||||
|
.get('/affair/personal_affairs_fuzzy_queries', this.formData)
|
||||||
|
.then((response) => {
|
||||||
|
this.DataToRouterView = response.data.data
|
||||||
|
console.log(response.data)
|
||||||
|
})
|
||||||
|
.catch((reportError) => {
|
||||||
|
console.log(reportError)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetForm() {
|
||||||
|
this.$router.go()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user