From 5ea8ef80312e8c1d3365abe7106622d676def195 Mon Sep 17 00:00:00 2001
From: huangzhen <867127663@qq.com>
Date: 星期五, 30 九月 2022 16:41:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml |  111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 111 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml b/src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml
new file mode 100644
index 0000000..435914b
--- /dev/null
+++ b/src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ruoyi.doublePrevention.repository.TrHiddenDangerCheckPointRepository">
+    <resultMap id="BaseFields" type="com.ruoyi.doublePrevention.entity.TrHiddenDangerCheckPoint">
+        <result property="id" column="id"/>
+        <result property="checkPointId" column="check_point_id"/>
+        <result property="checkId" column="check_id"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+        <result property="whetherDanger" column="whether_danger"/>
+        <result property="dangerName" column="danger_name"/>
+        <result property="dangerDescription" column="danger_description"/>
+        <result property="dangerLevel" column="danger_level"/>
+        <result property="troubleTypeId" column="trouble_type_id"/>
+        <result property="troubleTypeName" column="trouble_type_name"/>
+        <result property="checkTime" column="check_time"/>
+        <result property="preRectifyPhoto" column="pre_rectify_photo"/>
+        <result property="registerUserId" column="register_user_id"/>
+        <result property="registerUserName" column="register_user_name"/>
+        <result property="registerCreateTime" column="register_create_time"/>
+        <result property="registerSubmitTime" column="register_submit_time"/>
+        <result property="judgeUserId" column="judge_user_id"/>
+        <result property="judgeUserName" column="judge_user_name"/>
+        <result property="judgeCreateTime" column="judge_create_time"/>
+        <result property="judgeCreateUserId" column="judge_create_user_id"/>
+        <result property="dangerSources" column="danger_sources"/>
+        <result property="reportStatus" column="report_status"/>
+        <result property="examineUserId" column="examine_user_id"/>
+        <result property="examineUserName" column="examine_user_name"/>
+        <result property="examineStatus" column="examine_status"/>
+        <result property="examineOpinion" column="examine_opinion"/>
+        <result property="examineResult" column="examine_result"/>
+        <result property="examineCreateTime" column="examine_create_time"/>
+        <result property="treatMeasure" column="treat_measure"/>
+        <result property="rectifyUserId" column="rectify_user_id"/>
+        <result property="rectifyUserName" column="rectify_user_name"/>
+        <result property="rectifyDeptId" column="rectify_dept_id"/>
+        <result property="rectifyDeptName" column="rectify_dept_name"/>
+        <result property="rectifyDeadlineTime" column="rectify_deadline_time"/>
+        <result property="rectifyType" column="rectify_type"/>
+        <result property="rectifyAttachment" column="rectify_attachment"/>
+        <result property="rectifyMeasure" column="rectify_measure"/>
+        <result property="rectifyCondition" column="rectify_condition"/>
+        <result property="rectifyFund" column="rectify_fund"/>
+        <result property="rectifyCompleteTime" column="rectify_complete_time"/>
+        <result property="rectifyStatus" column="rectify_status"/>
+        <result property="rectifyCreateTime" column="rectify_create_time"/>
+        <result property="acceptUserId" column="accept_user_id"/>
+        <result property="acceptUserName" column="accept_user_name"/>
+        <result property="postRectifyPhoto" column="post_rectify_photo"/>
+        <result property="acceptResult" column="accept_result"/>
+        <result property="acceptOpinion" column="accept_opinion"/>
+        <result property="acceptFile" column="accept_file"/>
+        <result property="acceptCreateTime" column="accept_create_time"/>
+        <result property="acceptStatus" column="accept_status"/>
+        <result property="stage" column="stage"/>
+        <result property="scheduleCheckStatus" column="schedule_check_status"/>
+        <result property="checkType" column="check_type"/>
+        <result property="companyId" column="company_id"/>
+    </resultMap>
+
+
+
+    <resultMap id="ListDangerLevelCountByTime" type="com.ruoyi.doublePrevention.entity.dto.DataCountDangerLevelRespDO">
+        <result property="heavyRiskCount" column="heavy_risk_count" />
+        <result property="lightRiskCount" column="light_risk_count" />
+    </resultMap>
+    <select id="listDangerLevelCountByTime" resultMap="ListDangerLevelCountByTime">
+        select
+            IFNULL(sum(CASE WHEN danger_level='0' then 1 else 0 END),0) light_risk_count,
+            IFNULL(sum(CASE WHEN danger_level='1' then 1 else 0 END),0) heavy_risk_count
+        from tr_hidden_danger_check_point
+        WHERE whether_danger = '1'
+          and examine_status = '1'
+          and examine_create_time >= #{startTime}
+          and examine_create_time &lt;= #{endTime}
+          <if test="depIds != null and depIds.size() > 0">
+              and rectify_dept_id in (
+              <foreach collection="depIds"  item="depId" index="index" separator=",">
+                  #{depId}
+              </foreach> )
+          </if>
+    </select>
+
+
+    <resultMap id="ListDangerLevelRectifiedCountByTime" type="com.ruoyi.doublePrevention.entity.dto.DataCountDangerLevelRectifiedRespDO">
+        <result property="heavyRiskRectifyCount" column="heavy_risk_rectify_count" />
+        <result property="lightRiskRectifyCount" column="light_risk_rectify_count" />
+    </resultMap>
+    <select id="listDangerLevelRectifiedCountByTime" resultMap="ListDangerLevelRectifiedCountByTime">
+        select
+            IFNULL(sum(CASE WHEN danger_level='0' then 1 else 0 END),0) light_risk_rectify_count,
+            IFNULL(sum(CASE WHEN danger_level='1' then 1 else 0 END),0) heavy_risk_rectify_count
+        from tr_hidden_danger_check_point
+        WHERE whether_danger = '1'
+          and examine_status = '1'
+          and accept_status = '1'
+          and accept_create_time >= #{startTime}
+          and accept_create_time &lt;= #{endTime}
+          <if test="depIds != null and depIds.size() > 0">
+              and rectify_dept_id in (
+              <foreach collection="depIds"  item="depId" index="index" separator=",">
+                  #{depId}
+              </foreach> )
+          </if>
+    </select>
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.2