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

居民安检统计-区域筛选

parent ac1ebe82
...@@ -88,6 +88,8 @@ public class TTaskInspect extends BaseEntity ...@@ -88,6 +88,8 @@ public class TTaskInspect extends BaseEntity
//任务类型 //任务类型
private String taskType; private String taskType;
private Long village;
public String getMeterImg() { public String getMeterImg() {
return meterImg; return meterImg;
} }
...@@ -285,6 +287,14 @@ public class TTaskInspect extends BaseEntity ...@@ -285,6 +287,14 @@ public class TTaskInspect extends BaseEntity
this.taskType = taskType; this.taskType = taskType;
} }
public Long getVillage() {
return village;
}
public void setVillage(Long village) {
this.village = village;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inspect.meter_img, inspect.meter_img,
su.nick_name as member_name, 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 '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) 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) 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" ...@@ -55,6 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM FROM
t_task_inspect inspect t_task_inspect inspect
LEFT JOIN sys_user su ON su.user_id = inspect.member_id 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> </sql>
<select id="selectJuminInspectList" parameterType="TTaskInspect" resultMap="TTaskInspectResult"> <select id="selectJuminInspectList" parameterType="TTaskInspect" resultMap="TTaskInspectResult">
...@@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="danger != null "> and inspect.danger = #{danger}</if> <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="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="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> </where>
ORDER BY inspect.create_time DESC ORDER BY inspect.create_time DESC
</select> </select>
...@@ -252,6 +256,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -252,6 +256,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_task_inspect inspect t_task_inspect inspect
LEFT JOIN t_task task ON task.id = inspect.task_id LEFT JOIN t_task task ON task.id = inspect.task_id
LEFT JOIN sys_user us ON us.user_id = inspect.member_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> <where>
<if test="taskId != null">and inspect.task_id = #{taskId}</if> <if test="taskId != null">and inspect.task_id = #{taskId}</if>
<if test="status != null "> and inspect.status = #{status}</if> <if test="status != null "> and inspect.status = #{status}</if>
...@@ -259,9 +266,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -259,9 +266,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="danger != null "> and inspect.danger = #{danger}</if> <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="memberName != null and memberName != ''">and us.nick_name like concat('%',#{memberName},'%')</if>
<if test="type != null">and inspect.type = #{type}</if> <if test="type != null">and inspect.type = #{type}</if>
<if test="village != null and type == 1"> and u.village = #{village}</if>
</where> </where>
GROUP BY timeType 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>
<select id="jmAnjianDetail" parameterType="TUserInspect" resultType="com.zehong.system.domain.vo.Userinstpect"> <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, 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" ...@@ -500,7 +508,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_task_relation_info relation t_task_relation_info relation
LEFT JOIN t_user us ON us.village = relation.relation_id LEFT JOIN t_user us ON us.village = relation.relation_id
WHERE WHERE
relation.type = '1' and us.village = 108 relation.type = '1'
<if test="village != null"> and relation.relation_id = #{village}</if>
GROUP BY GROUP BY
relation.task_id relation.task_id
) user_counts ON user_counts.task_id = task.id ) user_counts ON user_counts.task_id = task.id
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
size="small" size="small"
style="width: 198px" style="width: 198px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@change="taskChange"
> >
<el-option <el-option
v-for="task in taskInfoList" v-for="task in taskInfoList"
...@@ -57,6 +58,22 @@ ...@@ -57,6 +58,22 @@
/> />
</el-form-item> </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-form-item label="日期">
<el-date-picker <el-date-picker
size="small" size="small"
...@@ -66,6 +83,7 @@ ...@@ -66,6 +83,7 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:clearable="false"
@change="timeChange" @change="timeChange"
> >
</el-date-picker> </el-date-picker>
...@@ -89,6 +107,7 @@ ...@@ -89,6 +107,7 @@
import Charts from "../components/Charts"; import Charts from "../components/Charts";
import { taskInfoList }from "@/api/checktask/task"; import { taskInfoList }from "@/api/checktask/task";
import InspectTaskTable from "../components/InspectTaskTable"; import InspectTaskTable from "../components/InspectTaskTable";
import { communityList } from "@/api/baseinfo/community";
export default { export default {
name: "resident-index", name: "resident-index",
components:{ components:{
...@@ -106,12 +125,15 @@ ...@@ -106,12 +125,15 @@
danger: null, danger: null,
memberName: null, memberName: null,
type: 1, type: 1,
village: null,
dateBegin: null, dateBegin: null,
dateEnd: null dateEnd: null
}, },
//任务信息 //任务信息
taskInfoList: [], taskInfoList: [],
dateRange: [] dateRange: [],
communityInfos: [],
communityList: []
} }
}, },
created(){ created(){
...@@ -144,6 +166,7 @@ ...@@ -144,6 +166,7 @@
this.queryParams.taskId = this.taskInfoList[0].id; this.queryParams.taskId = this.taskInfoList[0].id;
this.getTableList(); this.getTableList();
this.getCharts(); this.getCharts();
this.getCommunityInfo();
} }
} }
}) })
...@@ -159,6 +182,19 @@ ...@@ -159,6 +182,19 @@
timeChange(val){ timeChange(val){
this.queryParams.dateBegin = val[0] + " 00:00:00"; this.queryParams.dateBegin = val[0] + " 00:00:00";
this.queryParams.dateEnd = val[1] + " 23:59:59"; 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