<?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.factoryEvacuation.mapper.FactoryEvacuationMapper">
|
|
<resultMap type="com.ruoyi.project.dc.factoryEvacuation.domain.FactoryEvacuation" id="FactoryEvacuationResult">
|
<result property="factoryEvacuationId" column="factory_evacuation_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="areaName" column="area_name" />
|
<result property="ownedFile" column="owned_file" />
|
<result property="ownedPicture" column="owned_picture" />
|
</resultMap>
|
|
<sql id="selectFactoryEvacuationVo">
|
select factory_evacuation_id, company_id, create_by, create_user_id, create_time, update_by, update_user_id, update_time, remark, area_name, owned_file, owned_picture from dc_factory_evacuation
|
</sql>
|
|
<select id="selectFactoryEvacuationList" parameterType="FactoryEvacuation" resultMap="FactoryEvacuationResult">
|
<include refid="selectFactoryEvacuationVo"/>
|
<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="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
<if test="ownedFile != null and ownedFile != ''"> and owned_file = #{ownedFile}</if>
|
<if test="ownedPicture != null and ownedPicture != ''"> and owned_picture = #{ownedPicture}</if>
|
</where>
|
</select>
|
|
<select id="selectFactoryEvacuationById" parameterType="Long" resultMap="FactoryEvacuationResult">
|
<include refid="selectFactoryEvacuationVo"/>
|
where factory_evacuation_id = #{factoryEvacuationId}
|
</select>
|
|
<insert id="insertFactoryEvacuation" parameterType="FactoryEvacuation" useGeneratedKeys="true" keyProperty="factoryEvacuationId">
|
insert into dc_factory_evacuation
|
<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="areaName != null and areaName != ''">area_name,</if>
|
<if test="ownedFile != null and ownedFile != ''">owned_file,</if>
|
<if test="ownedPicture != null and ownedPicture != ''">owned_picture,</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="areaName != null and areaName != ''">#{areaName},</if>
|
<if test="ownedFile != null and ownedFile != ''">#{ownedFile},</if>
|
<if test="ownedPicture != null and ownedPicture != ''">#{ownedPicture},</if>
|
</trim>
|
</insert>
|
|
<update id="updateFactoryEvacuation" parameterType="FactoryEvacuation">
|
update dc_factory_evacuation
|
<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="areaName != null and areaName != ''">area_name = #{areaName},</if>
|
<if test="ownedFile != null and ownedFile != ''">owned_file = #{ownedFile},</if>
|
<if test="ownedPicture != null and ownedPicture != ''">owned_picture = #{ownedPicture},</if>
|
</trim>
|
where factory_evacuation_id = #{factoryEvacuationId}
|
</update>
|
|
<delete id="deleteFactoryEvacuationById" parameterType="Long">
|
delete from dc_factory_evacuation where factory_evacuation_id = #{factoryEvacuationId}
|
</delete>
|
|
<delete id="deleteFactoryEvacuationByIds" parameterType="String">
|
delete from dc_factory_evacuation where factory_evacuation_id in
|
<foreach item="factoryEvacuationId" collection="array" open="(" separator="," close=")">
|
#{factoryEvacuationId}
|
</foreach>
|
</delete>
|
|
</mapper>
|