Commit d291421d authored by 耿迪迪's avatar 耿迪迪

居民安检统计-区域筛选

parent ac1ebe82
......@@ -88,6 +88,8 @@ public class TTaskInspect extends BaseEntity
//任务类型
private String taskType;
private Long village;
public String getMeterImg() {
return meterImg;
}
......@@ -285,6 +287,14 @@ public class TTaskInspect extends BaseEntity
this.taskType = taskType;
}
public Long getVillage() {
return village;
}
public void setVillage(Long village) {
this.village = village;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inspect.meter_img,
su.nick_name as member_name,
(
case type
case inspect.`type`
when '1' then (select username from t_user tu where tu.id = inspect.receive_id)
when '2' then (select username from t_business bu where bu.id = inspect.receive_id)
else (select company from t_industry ind where ind.id = inspect.receive_id)
......@@ -55,6 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
t_task_inspect inspect
LEFT JOIN sys_user su ON su.user_id = inspect.member_id
<if test="village != null and type == 1">
LEFT JOIN t_user u ON u.id = inspect.receive_id
</if>
</sql>
<select id="selectJuminInspectList" parameterType="TTaskInspect" resultMap="TTaskInspectResult">
......@@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="danger != null "> and inspect.danger = #{danger}</if>
<if test="dateBegin != null and dateEnd != ''">and inspect.create_time BETWEEN #{dateBegin} AND #{dateEnd}</if>
<if test="memberName != null and memberName != ''">and su.nick_name like concat('%',#{memberName},'%')</if>
<if test="village != null and type == 1"> and u.village = #{village}</if>
</where>
ORDER BY inspect.create_time DESC
</select>
......@@ -252,6 +256,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_task_inspect inspect
LEFT JOIN t_task task ON task.id = inspect.task_id
LEFT JOIN sys_user us ON us.user_id = inspect.member_id
<if test="village != null and type == 1">
LEFT JOIN t_user u ON u.id = inspect.receive_id
</if>
<where>
<if test="taskId != null">and inspect.task_id = #{taskId}</if>
<if test="status != null "> and inspect.status = #{status}</if>
......@@ -259,9 +266,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="danger != null "> and inspect.danger = #{danger}</if>
<if test="memberName != null and memberName != ''">and us.nick_name like concat('%',#{memberName},'%')</if>
<if test="type != null">and inspect.type = #{type}</if>
<if test="village != null and type == 1"> and u.village = #{village}</if>
</where>
GROUP BY timeType
<if test="dateBegin != null and dateEnd != ''">HAVING timeType BETWEEN #{dateBegin} AND #{dateEnd}</if>
<if test="dateBegin != null and dateEnd != ''">HAVING CONCAT(timeType,' 00:00:00') BETWEEN #{dateBegin} AND #{dateEnd}</if>
</select>
<select id="jmAnjianDetail" parameterType="TUserInspect" resultType="com.zehong.system.domain.vo.Userinstpect">
SELECT u.id, u.username,u.phone,u.usernum,(SELECT name FROM t_community WHERE id = u.village)AS cunzhuang,p.type,
......@@ -500,7 +508,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_task_relation_info relation
LEFT JOIN t_user us ON us.village = relation.relation_id
WHERE
relation.type = '1' and us.village = 108
relation.type = '1'
<if test="village != null"> and relation.relation_id = #{village}</if>
GROUP BY
relation.task_id
) user_counts ON user_counts.task_id = task.id
......
......@@ -8,6 +8,7 @@
size="small"
style="width: 198px"
@keyup.enter.native="handleQuery"
@change="taskChange"
>
<el-option
v-for="task in taskInfoList"
......@@ -57,6 +58,22 @@
/>
</el-form-item>
<el-form-item label="所属村庄" prop="village">
<el-select
v-model="queryParams.village"
placeholder="请选择所属村庄/小区"
clearable
size="small"
>
<el-option
v-for="community in communityInfos"
:key="community.id"
:label="community.name"
:value="community.id"
/>
</el-select>
</el-form-item>
<el-form-item label="日期">
<el-date-picker
size="small"
......@@ -66,6 +83,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:clearable="false"
@change="timeChange"
>
</el-date-picker>
......@@ -89,6 +107,7 @@
import Charts from "../components/Charts";
import { taskInfoList }from "@/api/checktask/task";
import InspectTaskTable from "../components/InspectTaskTable";
import { communityList } from "@/api/baseinfo/community";
export default {
name: "resident-index",
components:{
......@@ -106,12 +125,15 @@
danger: null,
memberName: null,
type: 1,
village: null,
dateBegin: null,
dateEnd: null
},
//任务信息
taskInfoList: [],
dateRange: []
dateRange: [],
communityInfos: [],
communityList: []
}
},
created(){
......@@ -144,6 +166,7 @@
this.queryParams.taskId = this.taskInfoList[0].id;
this.getTableList();
this.getCharts();
this.getCommunityInfo();
}
}
})
......@@ -159,6 +182,19 @@
timeChange(val){
this.queryParams.dateBegin = val[0] + " 00:00:00";
this.queryParams.dateEnd = val[1] + " 23:59:59";
},
getCommunityInfo(){
communityList().then(res =>{
if(res.code == 200 && res.data){
this.communityList = res.data;
this.communityInfos = this.taskInfoList[0].relationInfoList ? res.data.filter(community => this.taskInfoList[0].relationInfoList.find(belongArea => belongArea.type == '1' && belongArea.relationId == community.id)) : [];
//this.communityInfos = res.data;
}
})
},
taskChange(value){
const taskInfo = this.taskInfoList.find(item => item.id == value);
this.communityInfos = taskInfo.relationInfoList ? this.communityList.filter(community => taskInfo.relationInfoList.find(belongArea => belongArea.type == '1' && belongArea.relationId == community.id)) : [];
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment