|
@@ -0,0 +1,132 @@
|
|
|
|
+<?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.qdtl.mapper.TlIncidentFaultMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="TlIncidentFault" id="TlIncidentFaultResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="name" column="name" />
|
|
|
|
+ <result property="detail" column="detail" />
|
|
|
|
+ <result property="incLevel" column="inc_level" />
|
|
|
|
+ <result property="incType" column="inc_type" />
|
|
|
|
+ <result property="uploadUser" column="upload_user" />
|
|
|
|
+ <result property="happenTime" column="happen_time" />
|
|
|
|
+ <result property="pics" column="pics" />
|
|
|
|
+ <result property="area" column="area" />
|
|
|
|
+ <result property="address" column="address" />
|
|
|
|
+ <result property="planId" column="plan_id" />
|
|
|
|
+ <result property="acceptUser" column="accept_user" />
|
|
|
|
+ <result property="acceptUserName" column="accept_user_name" />
|
|
|
|
+ <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="status" column="status" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectTlIncidentFaultVo">
|
|
|
|
+ select id, name, detail, inc_level, inc_type, upload_user, happen_time, pics, area, address, plan_id, accept_user, accept_user_name, create_by, create_time, update_by, update_time, status from tl_incident_fault
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectTlIncidentFaultList" parameterType="TlIncidentFault" resultMap="TlIncidentFaultResult">
|
|
|
|
+ <include refid="selectTlIncidentFaultVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="detail != null and detail != ''"> and detail = #{detail}</if>
|
|
|
|
+ <if test="incLevel != null and incLevel != ''"> and inc_level = #{incLevel}</if>
|
|
|
|
+ <if test="incType != null and incType != ''"> and inc_type = #{incType}</if>
|
|
|
|
+ <if test="uploadUser != null and uploadUser != ''"> and upload_user = #{uploadUser}</if>
|
|
|
|
+ <if test="happenTime != null "> and happen_time = #{happenTime}</if>
|
|
|
|
+ <if test="pics != null and pics != ''"> and pics = #{pics}</if>
|
|
|
|
+ <if test="area != null and area != ''"> and area = #{area}</if>
|
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
|
+ <if test="planId != null and planId != ''"> and plan_id = #{planId}</if>
|
|
|
|
+ <if test="acceptUser != null and acceptUser != ''"> and accept_user = #{acceptUser}</if>
|
|
|
|
+ <if test="acceptUserName != null and acceptUserName != ''"> and accept_user_name like concat('%', #{acceptUserName}, '%')</if>
|
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectTlIncidentFaultById" parameterType="Long" resultMap="TlIncidentFaultResult">
|
|
|
|
+ <include refid="selectTlIncidentFaultVo"/>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertTlIncidentFault" parameterType="TlIncidentFault" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ insert into tl_incident_fault
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="name != null">name,</if>
|
|
|
|
+ <if test="detail != null">detail,</if>
|
|
|
|
+ <if test="incLevel != null">inc_level,</if>
|
|
|
|
+ <if test="incType != null">inc_type,</if>
|
|
|
|
+ <if test="uploadUser != null">upload_user,</if>
|
|
|
|
+ <if test="happenTime != null">happen_time,</if>
|
|
|
|
+ <if test="pics != null">pics,</if>
|
|
|
|
+ <if test="area != null">area,</if>
|
|
|
|
+ <if test="address != null">address,</if>
|
|
|
|
+ <if test="planId != null">plan_id,</if>
|
|
|
|
+ <if test="acceptUser != null">accept_user,</if>
|
|
|
|
+ <if test="acceptUserName != null">accept_user_name,</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="status != null">status,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
|
+ <if test="detail != null">#{detail},</if>
|
|
|
|
+ <if test="incLevel != null">#{incLevel},</if>
|
|
|
|
+ <if test="incType != null">#{incType},</if>
|
|
|
|
+ <if test="uploadUser != null">#{uploadUser},</if>
|
|
|
|
+ <if test="happenTime != null">#{happenTime},</if>
|
|
|
|
+ <if test="pics != null">#{pics},</if>
|
|
|
|
+ <if test="area != null">#{area},</if>
|
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
|
+ <if test="planId != null">#{planId},</if>
|
|
|
|
+ <if test="acceptUser != null">#{acceptUser},</if>
|
|
|
|
+ <if test="acceptUserName != null">#{acceptUserName},</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="status != null">#{status},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateTlIncidentFault" parameterType="TlIncidentFault">
|
|
|
|
+ update tl_incident_fault
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
|
+ <if test="detail != null">detail = #{detail},</if>
|
|
|
|
+ <if test="incLevel != null">inc_level = #{incLevel},</if>
|
|
|
|
+ <if test="incType != null">inc_type = #{incType},</if>
|
|
|
|
+ <if test="uploadUser != null">upload_user = #{uploadUser},</if>
|
|
|
|
+ <if test="happenTime != null">happen_time = #{happenTime},</if>
|
|
|
|
+ <if test="pics != null">pics = #{pics},</if>
|
|
|
|
+ <if test="area != null">area = #{area},</if>
|
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
|
+ <if test="planId != null">plan_id = #{planId},</if>
|
|
|
|
+ <if test="acceptUser != null">accept_user = #{acceptUser},</if>
|
|
|
|
+ <if test="acceptUserName != null">accept_user_name = #{acceptUserName},</if>
|
|
|
|
+ <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="status != null">status = #{status},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteTlIncidentFaultById" parameterType="Long">
|
|
|
|
+ delete from tl_incident_fault where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteTlIncidentFaultByIds" parameterType="String">
|
|
|
|
+ delete from tl_incident_fault where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|