Commit 061c434e authored by 耿迪迪's avatar 耿迪迪

隐患调整

parent 49527cba
...@@ -172,6 +172,15 @@ public class TDanger extends BaseEntity ...@@ -172,6 +172,15 @@ public class TDanger extends BaseEntity
private TTaskInspect tTaskInspect; private TTaskInspect tTaskInspect;
/** 上报开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date beginDate;
/** 上报结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endDate;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
...@@ -545,6 +554,22 @@ public class TDanger extends BaseEntity ...@@ -545,6 +554,22 @@ public class TDanger extends BaseEntity
this.dealMethod = dealMethod; this.dealMethod = dealMethod;
} }
public Date getBeginDate() {
return beginDate;
}
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -48,101 +48,104 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -48,101 +48,104 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectTDangerVo"> <sql id="selectTDangerVo">
SELECT SELECT
id, danger.id,
task_id, danger.task_id,
inspect_id, danger.inspect_id,
type, danger.type,
receive_id, danger.receive_id,
title, danger.title,
LEVEL, danger.LEVEL,
category, danger.category,
before_content, danger.before_content,
phone, danger.phone,
address, danger.address,
longitude, danger.longitude,
latitude, danger.latitude,
before_img, danger.before_img,
before_video, danger.before_video,
flag, danger.flag,
after_content, danger.after_content,
reform_id, danger.reform_id,
after_img, danger.after_img,
reform_time, danger.reform_time,
start_time, danger.start_time,
end_time, danger.end_time,
STATUS, danger.STATUS,
admin_id, danger.admin_id,
(SELECT nick_name FROM sys_user where user_id = admin_id) as adminName, (SELECT nick_name FROM sys_user where user_id = danger.admin_id) as adminName,
create_time, danger.create_time,
remark, danger.remark,
finish, danger.finish,
check_id, danger.check_id,
check_time, danger.check_time,
check_remark, danger.check_remark,
check_img, danger.check_img,
file_id, danger.file_id,
file_time, danger.file_time,
is_visitor, danger.is_visitor,
governance_standards, danger.governance_standards,
governance_method, danger.governance_method,
funds_materials, danger.funds_materials,
safety_emergency_plan, danger.safety_emergency_plan,
deal_method, danger.deal_method,
(SELECT nick_name FROM sys_user where user_id = file_id) as fileName, (SELECT nick_name FROM sys_user where user_id = danger.file_id) as fileName,
( (
case type case type
when '1' then (select username from t_user tu where tu.id = receive_id) when '1' then (select username from t_user tu where tu.id = danger.receive_id)
when '2' then (select username from t_business bu where bu.id = receive_id) when '2' then (select username from t_business bu where bu.id = danger.receive_id)
when '3' then (select username from t_industry ind where ind.id = receive_id) when '3' then (select username from t_industry ind where ind.id = danger.receive_id)
when '6' then (select dev.device_name from t_device_info dev where dev.device_id = receive_id) when '6' then (select dev.device_name from t_device_info dev where dev.device_id = danger.receive_id)
when '5' then (select site.site_station_name from t_site_station_info site where site.site_station_id = receive_id) when '5' then (select site.site_station_name from t_site_station_info site where site.site_station_id = danger.receive_id)
else '-' else '-'
end end
) as receiveName, ) as receiveName,
(select nick_name from sys_user where user_id = reform_id) as reformName, (select nick_name from sys_user where user_id = danger.reform_id) as reformName,
(select nick_name from sys_user where user_id = admin_id) as reportName, us.nick_name as reportName,
(select nick_name from sys_user where user_id = check_id) as checkName (select nick_name from sys_user where user_id = danger.check_id) as checkName
FROM FROM
t_danger t_danger danger
LEFT JOIN sys_user us ON us.user_id = danger.admin_id
</sql> </sql>
<select id="selectTDangerList" parameterType="TDanger" resultMap="TDangerResult"> <select id="selectTDangerList" parameterType="TDanger" resultMap="TDangerResult">
<include refid="selectTDangerVo"/> <include refid="selectTDangerVo"/>
<where> <where>
<if test="taskId != null "> and task_id = #{taskId}</if> <if test="taskId != null "> and danger.task_id = #{taskId}</if>
<if test="inspectId != null "> and inspect_id = #{inspectId}</if> <if test="inspectId != null "> and danger.inspect_id = #{inspectId}</if>
<if test="category != null "> and category = #{category}</if> <if test="category != null "> and danger.category = #{category}</if>
<if test="type != null "> and type = #{type}</if> <if test="type != null "> and danger.type = #{type}</if>
<if test="receiveId != null "> and receive_id = #{receiveId}</if> <if test="receiveId != null "> and danger.receive_id = #{receiveId}</if>
<if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if> <if test="title != null and title != ''"> and danger.title like concat('%',#{title},'%')</if>
<if test="level != null "> and level = #{level}</if> <if test="level != null "> and danger.level = #{level}</if>
<if test="beforeContent != null and beforeContent != ''"> and before_content = #{beforeContent}</if> <if test="beforeContent != null and beforeContent != ''"> and danger.before_content = #{beforeContent}</if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and danger.address = #{address}</if>
<if test="longitude != null "> and longitude = #{longitude}</if> <if test="longitude != null "> and danger.longitude = #{longitude}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if> <if test="phone != null and phone != ''"> and danger.phone = #{phone}</if>
<if test="latitude != null "> and latitude = #{latitude}</if> <if test="latitude != null "> and danger.latitude = #{latitude}</if>
<if test="beforeImg != null and beforeImg != ''"> and before_img = #{beforeImg}</if> <if test="beforeImg != null and beforeImg != ''"> and danger.before_img = #{beforeImg}</if>
<if test="beforeVideo != null and beforeVideo != ''"> and before_video = #{beforeVideo}</if> <if test="beforeVideo != null and beforeVideo != ''"> and danger.before_video = #{beforeVideo}</if>
<if test="flag != null and adminId == null"> and flag = #{flag}</if> <if test="flag != null and adminId == null"> and danger.flag = #{flag}</if>
<if test="afterContent != null and afterContent != ''"> and after_content = #{afterContent}</if> <if test="afterContent != null and afterContent != ''"> and danger.after_content = #{afterContent}</if>
<if test="reformId != null "> and reform_id = #{reformId}</if> <if test="reformId != null "> and danger.reform_id = #{reformId}</if>
<if test="afterImg != null and afterImg != ''"> and after_img = #{afterImg}</if> <if test="afterImg != null and afterImg != ''"> and danger.after_img = #{afterImg}</if>
<if test="startTime != null "> and start_time = #{startTime}</if> <if test="startTime != null "> and danger.start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if> <if test="endTime != null "> and danger.end_time = #{endTime}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and danger.status = #{status}</if>
<if test="adminId != null and flag == null"> and admin_id = #{adminId}</if> <if test="adminId != null and flag == null"> and danger.admin_id = #{adminId}</if>
<if test="finish != null "> and finish = #{finish}</if> <if test="finish != null "> and danger.finish = #{finish}</if>
<if test="status == null "> and status not in (-1)</if> <if test="status == null "> and danger.status not in (-1)</if>
<if test="flag != null and adminId != null"> and (flag = #{flag} or admin_id = #{adminId})</if> <if test="flag != null and adminId != null"> and (danger.flag = #{flag} or danger.admin_id = #{adminId})</if>
<if test="isVisitor != null and isVisitor != ''"> and is_visitor = #{isVisitor}</if> <if test="isVisitor != null and isVisitor != ''"> and danger.is_visitor = #{isVisitor}</if>
<if test="dealMethod != null and dealMethod != ''"> and deal_method = #{dealMethod}</if> <if test="dealMethod != null and dealMethod != ''"> and danger.deal_method = #{dealMethod}</if>
<if test="reportName != null and reportName != ''"> and us.nick_name like concat('%',#{reportName},'%')</if>
<if test="beginDate != null and endDate != null"> and danger.create_time BETWEEN #{beginDate} and #{endDate}</if>
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="selectTDangerById" parameterType="Long" resultMap="TDangerResult"> <select id="selectTDangerById" parameterType="Long" resultMap="TDangerResult">
<include refid="selectTDangerVo"/> <include refid="selectTDangerVo"/>
where id = #{id} where danger.id = #{id}
</select> </select>
<insert id="insertTDanger" parameterType="TDanger" useGeneratedKeys="true" keyProperty="id"> <insert id="insertTDanger" parameterType="TDanger" useGeneratedKeys="true" keyProperty="id">
......
...@@ -50,6 +50,30 @@ ...@@ -50,6 +50,30 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="上报人" prop="reportName">
<el-input
v-model="queryParams.reportName"
placeholder="请输入隐患标题"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上报时间" prop="reportTimeRange">
<el-date-picker
v-model="reportTimeRange"
type="datetimerange"
size="small"
:clearable="false"
value-format="yyyy-MM-dd HH:mm"
@change="timeChange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -321,6 +345,9 @@ export default { ...@@ -321,6 +345,9 @@ export default {
startTime: null, startTime: null,
endTime: null, endTime: null,
status: null, status: null,
reportName: null,
beginDate: null,
endDate : null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -329,7 +356,8 @@ export default { ...@@ -329,7 +356,8 @@ export default {
}, },
dialogTableVisibles: false, dialogTableVisibles: false,
devicePos: [], devicePos: [],
dangerSource: [] dangerSource: [],
reportTimeRange: []
}; };
}, },
created() { created() {
...@@ -353,10 +381,11 @@ export default { ...@@ -353,10 +381,11 @@ export default {
}); });
}, },
typeFormatter(row){ typeFormatter(row){
const receiveName = row.receiveName ? '[' + row.receiveName + ']' : '';
return this.selectDictLabel( return this.selectDictLabel(
this.dangerSource, this.dangerSource,
row.type row.type
); ) + receiveName;
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
...@@ -398,6 +427,9 @@ export default { ...@@ -398,6 +427,9 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.reportTimeRange = [];
this.queryParams.beginDate = null;
this.queryParams.endDate = null;
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -495,7 +527,11 @@ export default { ...@@ -495,7 +527,11 @@ export default {
//详情 //详情
handleDetail(row){ handleDetail(row){
this.$refs.dangerDetail.handleDangerDetail(row.id); this.$refs.dangerDetail.handleDangerDetail(row.id);
} },
timeChange(val){
this.queryParams.beginDate = val[0];
this.queryParams.endDate = val[1];
},
} }
}; };
</script> </script>
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