88 lines
4.9 KiB
XML
88 lines
4.9 KiB
XML
|
<?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.fire.mapper.FireFacilityRepairMapper">
|
||
|
|
||
|
<resultMap type="FireFacilityRepair" id="FireFacilityRepairResult">
|
||
|
<result property="id" column="id" />
|
||
|
<result property="facilityId" column="facility_id" />
|
||
|
<result property="repairDate" column="repair_date" />
|
||
|
<result property="repairContent" column="repair_content" />
|
||
|
<result property="repairResult" column="repair_result" />
|
||
|
<result property="replacePerson" column="replace_person" />
|
||
|
<result property="remark" column="remark" />
|
||
|
<result property="nextCheckDate" column="next_check_date" />
|
||
|
<result property="createTime" column="create_time" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectFireFacilityRepairVo">
|
||
|
select id, facility_id, repair_date, repair_content, repair_result, replace_person, remark, next_check_date, create_time from fire_facility_repair
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectFireFacilityRepairList" parameterType="FireFacilityRepair" resultMap="FireFacilityRepairResult">
|
||
|
<include refid="selectFireFacilityRepairVo"/>
|
||
|
<where>
|
||
|
<if test="facilityId != null "> and facility_id = #{facilityId}</if>
|
||
|
<if test="params.beginRepairDate != null and params.beginRepairDate != '' and params.endRepairDate != null and params.endRepairDate != ''"> and repair_date between #{params.beginRepairDate} and #{params.endRepairDate}</if>
|
||
|
<if test="repairResult != null "> and repair_result = #{repairResult}</if>
|
||
|
<if test="replacePerson != null and replacePerson != ''"> and replace_person = #{replacePerson}</if>
|
||
|
<if test="params.beginNextCheckDate != null and params.beginNextCheckDate != '' and params.endNextCheckDate != null and params.endNextCheckDate != ''"> and next_check_date between #{params.beginNextCheckDate} and #{params.endNextCheckDate}</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectFireFacilityRepairById" parameterType="Long" resultMap="FireFacilityRepairResult">
|
||
|
<include refid="selectFireFacilityRepairVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertFireFacilityRepair" parameterType="FireFacilityRepair" useGeneratedKeys="true" keyProperty="id">
|
||
|
insert into fire_facility_repair
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="facilityId != null">facility_id,</if>
|
||
|
<if test="repairDate != null">repair_date,</if>
|
||
|
<if test="repairContent != null and repairContent != ''">repair_content,</if>
|
||
|
<if test="repairResult != null">repair_result,</if>
|
||
|
<if test="replacePerson != null and replacePerson != ''">replace_person,</if>
|
||
|
<if test="remark != null">remark,</if>
|
||
|
<if test="nextCheckDate != null">next_check_date,</if>
|
||
|
<if test="createTime != null">create_time,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="facilityId != null">#{facilityId},</if>
|
||
|
<if test="repairDate != null">#{repairDate},</if>
|
||
|
<if test="repairContent != null and repairContent != ''">#{repairContent},</if>
|
||
|
<if test="repairResult != null">#{repairResult},</if>
|
||
|
<if test="replacePerson != null and replacePerson != ''">#{replacePerson},</if>
|
||
|
<if test="remark != null">#{remark},</if>
|
||
|
<if test="nextCheckDate != null">#{nextCheckDate},</if>
|
||
|
<if test="createTime != null">#{createTime},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateFireFacilityRepair" parameterType="FireFacilityRepair">
|
||
|
update fire_facility_repair
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="facilityId != null">facility_id = #{facilityId},</if>
|
||
|
<if test="repairDate != null">repair_date = #{repairDate},</if>
|
||
|
<if test="repairContent != null and repairContent != ''">repair_content = #{repairContent},</if>
|
||
|
<if test="repairResult != null">repair_result = #{repairResult},</if>
|
||
|
<if test="replacePerson != null and replacePerson != ''">replace_person = #{replacePerson},</if>
|
||
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
<if test="nextCheckDate != null">next_check_date = #{nextCheckDate},</if>
|
||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteFireFacilityRepairById" parameterType="Long">
|
||
|
delete from fire_facility_repair where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteFireFacilityRepairByIds" parameterType="String">
|
||
|
delete from fire_facility_repair where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|