<?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.project.dc.incidentReport.mapper.IncidentReportMapper">
|
|
<resultMap type="com.ruoyi.project.dc.incidentReport.domain.IncidentReport" id="IncidentReportResult">
|
<result property="incidentReportId" column="incident_report_id" />
|
<result property="companyId" column="company_id"/>
|
<result property="createBy" column="create_by" />
|
<result property="createUserId" column="create_user_id" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateUserId" column="update_user_id" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="eventName" column="event_name" />
|
<result property="introduction" column="introduction" />
|
<result property="eventLocation" column="event_location" />
|
<result property="eventTime" column="event_time" />
|
<result property="whetherToReport" column="whether_to_report" />
|
<result property="processingStatus" column="processing_status" />
|
<result property="ownedPicture" column="owned_picture" />
|
<result property="ownedFile" column="owned_file" />
|
</resultMap>
|
|
<sql id="selectIncidentReportVo">
|
select incident_report_id, company_id, create_by, create_user_id, create_time, update_by, update_user_id, update_time, remark, event_name, introduction, event_location, event_time, whether_to_report, processing_status, owned_picture, owned_file from dc_incident_report
|
</sql>
|
|
<select id="selectIncidentReportList" parameterType="IncidentReport" resultMap="IncidentReportResult">
|
<include refid="selectIncidentReportVo"/>
|
<where>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
|
<if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
|
<if test="eventName != null and eventName != ''"> and event_name like concat('%', #{eventName}, '%')</if>
|
<if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if>
|
<if test="eventLocation != null and eventLocation != ''"> and event_location = #{eventLocation}</if>
|
<if test="params.beginEventTime != null and params.beginEventTime != '' and params.endEventTime != null and params.endEventTime != ''"> and event_time between #{params.beginEventTime} and #{params.endEventTime}</if>
|
<if test="whetherToReport != null and whetherToReport != ''"> and whether_to_report = #{whetherToReport}</if>
|
<if test="processingStatus != null and processingStatus != ''"> and processing_status = #{processingStatus}</if>
|
<if test="ownedPicture != null and ownedPicture != ''"> and owned_picture = #{ownedPicture}</if>
|
<if test="ownedFile != null and ownedFile != ''"> and owned_file = #{ownedFile}</if>
|
</where>
|
</select>
|
|
<select id="selectIncidentReportById" parameterType="Long" resultMap="IncidentReportResult">
|
<include refid="selectIncidentReportVo"/>
|
where incident_report_id = #{incidentReportId}
|
</select>
|
|
<insert id="insertIncidentReport" parameterType="IncidentReport" useGeneratedKeys="true" keyProperty="incidentReportId">
|
insert into dc_incident_report
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">company_id,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createUserId != null ">create_user_id,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateUserId != null ">update_user_id,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="eventName != null and eventName != ''">event_name,</if>
|
<if test="introduction != null and introduction != ''">introduction,</if>
|
<if test="eventLocation != null and eventLocation != ''">event_location,</if>
|
<if test="eventTime != null ">event_time,</if>
|
<if test="whetherToReport != null and whetherToReport != ''">whether_to_report,</if>
|
<if test="processingStatus != null and processingStatus != ''">processing_status,</if>
|
<if test="ownedPicture != null and ownedPicture != ''">owned_picture,</if>
|
<if test="ownedFile != null and ownedFile != ''">owned_file,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">#{companyId},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createUserId != null ">#{createUserId},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateUserId != null ">#{updateUserId},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="eventName != null and eventName != ''">#{eventName},</if>
|
<if test="introduction != null and introduction != ''">#{introduction},</if>
|
<if test="eventLocation != null and eventLocation != ''">#{eventLocation},</if>
|
<if test="eventTime != null ">#{eventTime},</if>
|
<if test="whetherToReport != null and whetherToReport != ''">#{whetherToReport},</if>
|
<if test="processingStatus != null and processingStatus != ''">#{processingStatus},</if>
|
<if test="ownedPicture != null and ownedPicture != ''">#{ownedPicture},</if>
|
<if test="ownedFile != null and ownedFile != ''">#{ownedFile},</if>
|
</trim>
|
</insert>
|
|
<update id="updateIncidentReport" parameterType="IncidentReport">
|
update dc_incident_report
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createUserId != null ">create_user_id = #{createUserId},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateUserId != null ">update_user_id = #{updateUserId},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="eventName != null and eventName != ''">event_name = #{eventName},</if>
|
<if test="introduction != null and introduction != ''">introduction = #{introduction},</if>
|
<if test="eventLocation != null and eventLocation != ''">event_location = #{eventLocation},</if>
|
<if test="eventTime != null ">event_time = #{eventTime},</if>
|
<if test="whetherToReport != null and whetherToReport != ''">whether_to_report = #{whetherToReport},</if>
|
<if test="processingStatus != null and processingStatus != ''">processing_status = #{processingStatus},</if>
|
<if test="ownedPicture != null and ownedPicture != ''">owned_picture = #{ownedPicture},</if>
|
<if test="ownedFile != null and ownedFile != ''">owned_file = #{ownedFile},</if>
|
</trim>
|
where incident_report_id = #{incidentReportId}
|
</update>
|
|
<delete id="deleteIncidentReportById" parameterType="Long">
|
delete from dc_incident_report where incident_report_id = #{incidentReportId}
|
</delete>
|
|
<delete id="deleteIncidentReportByIds" parameterType="String">
|
delete from dc_incident_report where incident_report_id in
|
<foreach item="incidentReportId" collection="array" open="(" separator="," close=")">
|
#{incidentReportId}
|
</foreach>
|
</delete>
|
|
</mapper>
|