数据统计分析点击图标可查看隐患详情bug修复

main
15036302109 4 months ago
parent 54cabc1253
commit 9313619cf6

@ -4,12 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
@ -150,4 +150,11 @@ public class EhsHiddenDanger extends BaseEntity
private Integer currMonth;
@TableField(exist = false)
private String overTimeId;//超时隐患的id合集
// 以下是数据统计分析中的临时字段
@TableField(exist = false)
private String targetTime;
@TableField(exist = false)
private Date targetStartTime;
@TableField(exist = false)
private Date targetEndTime;
}

@ -1,5 +1,7 @@
package com.ruoyi.ehsHiddenDanger.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -62,6 +64,13 @@ public class EhsHiddenDangerServiceImpl extends ServiceImpl<EhsHiddenDangerMappe
if(StringUtils.isNotEmpty(ehsHiddenDanger.getAssistDept())){//协办就不限制只能查询本部门的数据了。
ehsHiddenDanger.setDeptId(null);
}
if (StringUtils.isNotBlank(ehsHiddenDanger.getTargetTime())) {
String targetTime = ehsHiddenDanger.getTargetTime() + "-01 00:00:00";
DateTime targetStartTime = DateUtil.parse(targetTime, "yyyy-MM-dd HH:mm:ss");
DateTime targetEndTime = DateUtil.endOfMonth(targetStartTime);
ehsHiddenDanger.setTargetStartTime(targetStartTime);
ehsHiddenDanger.setTargetEndTime(targetEndTime);
}
return ehsHiddenDangerMapper.selectEhsHiddenDangerList(ehsHiddenDanger);
}

@ -84,6 +84,9 @@ FROM ehs_hidden_danger h LEFT JOIN sys_dept d ON h.dept_id = d.dept_id
FIND_IN_SET(#{item}, hidden_danger_label)
</foreach>
</if>
<if test="targetTime != null and targetTime != ''">
AND h.check_time BETWEEN #{targetStartTime} AND #{targetEndTime}
</if>
</where>
</select>
<select id="selectOverTimeId" parameterType="EhsHiddenDanger" resultMap="EhsHiddenDangerResult">

Loading…
Cancel
Save