|
@@ -1,223 +0,0 @@
|
|
|
-<?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.sooka.sponest.event.emergency.inspectionrecord.mapper.CentereventTEmergencyInspectionrecordMapper">
|
|
|
-
|
|
|
- <resultMap type="CentereventTEmergencyInspectionrecord" id="CentereventTEmergencyInspectionrecordResult">
|
|
|
- <result property="id" column="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="deleteBy" column="delete_by" />
|
|
|
- <result property="deleteTime" column="delete_time" />
|
|
|
- <result property="dataStatus" column="data_status" />
|
|
|
- <result property="enterpriseId" column="enterprise_id" />
|
|
|
- <result property="enterpriseName" column="enterprise_name" />
|
|
|
- <result property="inspectionTime" column="inspection_time" />
|
|
|
- <result property="userId" column="user_id" />
|
|
|
- <result property="userName" column="user_name" />
|
|
|
- <result property="longitude" column="longitude" />
|
|
|
- <result property="latitude" column="latitude" />
|
|
|
- <result property="isHavedanger" column="is_havedanger" />
|
|
|
- <result property="dangerId" column="danger_id" />
|
|
|
- <result property="owndeptid" column="owndeptid" />
|
|
|
- <result property="deptId" column="dept_id" />
|
|
|
- </resultMap>
|
|
|
- <resultMap type="CentereventTEmergencyInspectionrecordBdody" id="CentereventTEmergencyInspectionrecordBdody">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="itemName" column="item_name" />
|
|
|
- <result property="itemRemark" column="item_remark" />
|
|
|
- <result property="imspectiontypeId" column="imspectiontype_id" />
|
|
|
- <result property="imspectiontypeName" column="imspectiontype_name" />
|
|
|
- <result property="imspectiontypefirstName" column="imspectiontypefirst_name" />
|
|
|
- <result property="enterpriseName" column="enterprise_name" />
|
|
|
- <result property="userId" column="user_id" />
|
|
|
- <result property="userName" column="user_name" />
|
|
|
- <result property="enterpriseId" column="enterprise_id" />
|
|
|
- <result property="Content" column="Content" />
|
|
|
- <result property="inspectionitemCheck" column="inspectionitem_check" />
|
|
|
-
|
|
|
- </resultMap>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <sql id="selectCentereventTEmergencyInspectionrecordVo">
|
|
|
- select id, create_by, create_time, update_by, update_time, delete_by, delete_time, data_status, enterprise_id, enterprise_name, inspection_time, user_id, user_name, longitude, latitude, is_havedanger, danger_id, owndeptid, dept_id from centerevent_t_emergency_inspectionrecord
|
|
|
- </sql>
|
|
|
-
|
|
|
- <select id="selectCentereventTEmergencyInspectionrecordList" parameterType="CentereventTEmergencyInspectionrecord" resultMap="CentereventTEmergencyInspectionrecordResult">
|
|
|
- <include refid="selectCentereventTEmergencyInspectionrecordVo"/>
|
|
|
- <where>
|
|
|
- <if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if>
|
|
|
- <if test="deleteTime != null "> and delete_time = #{deleteTime}</if>
|
|
|
- <if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus}</if>
|
|
|
- <if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
|
|
|
- <if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
|
|
|
- <if test="inspectionTime != null "> and inspection_time = #{inspectionTime}</if>
|
|
|
- <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
- <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
- <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
|
|
|
- <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
|
|
|
- <if test="isHavedanger != null and isHavedanger != ''"> and is_havedanger = #{isHavedanger}</if>
|
|
|
- <if test="dangerId != null and dangerId != ''"> and danger_id = #{dangerId}</if>
|
|
|
- <if test="owndeptid != null "> and owndeptid = #{owndeptid}</if>
|
|
|
- <if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
|
- </where>
|
|
|
- order by create_time desc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectCentereventTEmergencyInspectionrecordById" parameterType="String" resultMap="CentereventTEmergencyInspectionrecordResult">
|
|
|
- <include refid="selectCentereventTEmergencyInspectionrecordVo"/>
|
|
|
- where id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insertCentereventTEmergencyInspectionrecord" parameterType="CentereventTEmergencyInspectionrecord">
|
|
|
- insert into centerevent_t_emergency_inspectionrecord
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">id,</if>
|
|
|
- <if test="createBy != null">create_by,</if>
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
- <if test="updateBy != null">update_by,</if>
|
|
|
- <if test="updateTime != null">update_time,</if>
|
|
|
- <if test="deleteBy != null">delete_by,</if>
|
|
|
- <if test="deleteTime != null">delete_time,</if>
|
|
|
- <if test="dataStatus != null">data_status,</if>
|
|
|
- <if test="enterpriseId != null">enterprise_id,</if>
|
|
|
- <if test="enterpriseName != null">enterprise_name,</if>
|
|
|
- <if test="inspectionTime != null">inspection_time,</if>
|
|
|
- <if test="userId != null">user_id,</if>
|
|
|
- <if test="userName != null">user_name,</if>
|
|
|
- <if test="longitude != null">longitude,</if>
|
|
|
- <if test="latitude != null">latitude,</if>
|
|
|
- <if test="isHavedanger != null">is_havedanger,</if>
|
|
|
- <if test="dangerId != null">danger_id,</if>
|
|
|
- <if test="owndeptid != null">owndeptid,</if>
|
|
|
- <if test="deptId != null">dept_id,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">#{id},</if>
|
|
|
- <if test="createBy != null">#{createBy},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="updateBy != null">#{updateBy},</if>
|
|
|
- <if test="updateTime != null">#{updateTime},</if>
|
|
|
- <if test="deleteBy != null">#{deleteBy},</if>
|
|
|
- <if test="deleteTime != null">#{deleteTime},</if>
|
|
|
- <if test="dataStatus != null">#{dataStatus},</if>
|
|
|
- <if test="enterpriseId != null">#{enterpriseId},</if>
|
|
|
- <if test="enterpriseName != null">#{enterpriseName},</if>
|
|
|
- <if test="inspectionTime != null">#{inspectionTime},</if>
|
|
|
- <if test="userId != null">#{userId},</if>
|
|
|
- <if test="userName != null">#{userName},</if>
|
|
|
- <if test="longitude != null">#{longitude},</if>
|
|
|
- <if test="latitude != null">#{latitude},</if>
|
|
|
- <if test="isHavedanger != null">#{isHavedanger},</if>
|
|
|
- <if test="dangerId != null">#{dangerId},</if>
|
|
|
- <if test="owndeptid != null">#{owndeptid},</if>
|
|
|
- <if test="deptId != null">#{deptId},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateCentereventTEmergencyInspectionrecord" parameterType="CentereventTEmergencyInspectionrecord">
|
|
|
- update centerevent_t_emergency_inspectionrecord
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
- <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
- <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
- <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
- <if test="deleteBy != null">delete_by = #{deleteBy},</if>
|
|
|
- <if test="deleteTime != null">delete_time = #{deleteTime},</if>
|
|
|
- <if test="dataStatus != null">data_status = #{dataStatus},</if>
|
|
|
- <if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
|
|
|
- <if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
|
|
|
- <if test="inspectionTime != null">inspection_time = #{inspectionTime},</if>
|
|
|
- <if test="userId != null">user_id = #{userId},</if>
|
|
|
- <if test="userName != null">user_name = #{userName},</if>
|
|
|
- <if test="longitude != null">longitude = #{longitude},</if>
|
|
|
- <if test="latitude != null">latitude = #{latitude},</if>
|
|
|
- <if test="isHavedanger != null">is_havedanger = #{isHavedanger},</if>
|
|
|
- <if test="dangerId != null">danger_id = #{dangerId},</if>
|
|
|
- <if test="owndeptid != null">owndeptid = #{owndeptid},</if>
|
|
|
- <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
- </trim>
|
|
|
- where id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteCentereventTEmergencyInspectionrecordById" parameterType="String">
|
|
|
- delete from centerevent_t_emergency_inspectionrecord where id = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteCentereventTEmergencyInspectionrecordByIds" parameterType="String">
|
|
|
- delete from centerevent_t_emergency_inspectionrecord where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-<select id="selectCentereventTEmergencyInspectionrecordMessageList" parameterType="EmergencyInspectionrecordSelectBody" resultMap="CentereventTEmergencyInspectionrecordBdody">
|
|
|
-
|
|
|
- SELECT
|
|
|
- cet.id,
|
|
|
- cet.inspectionitem_name AS item_name,
|
|
|
- cei.item_remark,
|
|
|
- cet.inspectionitem_id AS imspectiontype_id,
|
|
|
- ctei.enterprise_name,
|
|
|
- ctei.enterprise_id,
|
|
|
- cet.inspectionitem_desc as content,
|
|
|
- CASE
|
|
|
- cet.inspection_result
|
|
|
- WHEN 1 THEN
|
|
|
- TRUE
|
|
|
- WHEN 0 THEN
|
|
|
- FALSE
|
|
|
- END AS inspectionitem_check,
|
|
|
- cep.inspection_name AS imspectiontype_name,
|
|
|
- cep2.inspection_name AS imspectiontypefirst_name,
|
|
|
- ctei.user_id,
|
|
|
- ctei.user_name
|
|
|
- FROM
|
|
|
- ${database_event}.centerevent_t_emergency_inspectionrecorddetail cet
|
|
|
- LEFT JOIN ${database_event}.centerevent_t_emergency_inspectionrecord ctei ON ctei.id = cet.inspectionrecord_id
|
|
|
- LEFT JOIN ${database_data}.centerdata_t_emergency_inspectionitem cei ON cet.inspectionitem_id = cei.id
|
|
|
- LEFT JOIN ${database_data}.centerdata_t_emergency_inspectiontype cep ON cei.imspectiontype_id = cep.id
|
|
|
- LEFT JOIN ${database_data}.centerdata_t_emergency_inspectiontype cep2 ON cep.parent_id = cep2.id
|
|
|
- WHERE
|
|
|
- inspectionrecord_id = #{id}
|
|
|
-
|
|
|
-</select>
|
|
|
- <select id="selectEmergencyList" parameterType="EmergencyInspectionrecordSelectBody" resultType="java.util.Map">
|
|
|
- SELECT
|
|
|
- d.dept_name as name,
|
|
|
- COUNT(a.id) AS value
|
|
|
- FROM
|
|
|
- ${database_event}.centerevent_t_emergency_inspectionrecord a
|
|
|
- LEFT JOIN ${database_system}.sys_user u ON u.user_id= a.user_id
|
|
|
- RIGHT JOIN ${database_system}.sys_user_dept ud ON ud.user_id = u.user_id
|
|
|
- RIGHT JOIN ${database_system}.sys_dept d ON d.dept_id = ud.dept_id
|
|
|
- WHERE
|
|
|
- u.del_flag = '0'
|
|
|
- AND (
|
|
|
- d.dept_id = #{id}
|
|
|
- OR d.dept_id IN ( SELECT t.dept_id FROM ${database_system}.sys_dept t WHERE find_in_set( #{id}, ancestors ) ))
|
|
|
- ${params.dataScope}
|
|
|
- GROUP BY
|
|
|
- d.dept_name
|
|
|
- UNION
|
|
|
- SELECT
|
|
|
- d.dept_name,
|
|
|
- COUNT(a.id)
|
|
|
- FROM
|
|
|
- ${database_event}.centerevent_t_emergency_inspectionrecord a
|
|
|
- RIGHT JOIN ${database_system}.sys_user u ON u.user_id= a.user_id
|
|
|
- RIGHT JOIN ${database_system}.sys_user_dept ud ON ud.user_id = u.user_id
|
|
|
- RIGHT JOIN ${database_system}.sys_dept d ON d.dept_id = ud.dept_id
|
|
|
- WHERE
|
|
|
- u.del_flag = '0'
|
|
|
- AND (
|
|
|
- d.dept_id = #{id}
|
|
|
- OR d.dept_id IN ( SELECT t.dept_id FROM ${database_system}.sys_dept t WHERE find_in_set( #{id}, ancestors ) ))
|
|
|
- ${params.dataScope}
|
|
|
- GROUP BY
|
|
|
- d.dept_name
|
|
|
- </select>
|
|
|
-</mapper>
|