TEmergencyDrillsMapper.xml 5.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
<?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.zehong.system.mapper.TEmergencyDrillsMapper">
    
    <resultMap type="TEmergencyDrills" id="TEmergencyDrillsResult">
        <result property="fDrillsId"    column="f_drills_id"    />
        <result property="fDrillsTime"    column="f_drills_time"    />
        <result property="fEvent"    column="f_event"    />
        <result property="fPlace"    column="f_place"    />
        <result property="fPerDep"    column="f_per_dep"    />
        <result property="fDrillsContent"    column="f_drills_content"    />
军师中郎将's avatar
军师中郎将 committed
14
        <result property="fDrillDepartment"    column="f_drill_department"    />
15 16 17 18 19 20 21
        <result property="fCreateTime"    column="f_create_time"    />
        <result property="fUpdateTime"    column="f_update_time"    />
        <result property="fIsDel"    column="f_is_del"    />
        <result property="fRemarks"    column="f_remarks"    />
    </resultMap>

    <sql id="selectTEmergencyDrillsVo">
军师中郎将's avatar
军师中郎将 committed
22
        select f_drills_id, f_drills_time, f_event, f_place, f_per_dep, f_drills_content, f_drill_department, f_create_time, f_update_time, f_is_del, f_remarks from t_emergency_drills
23 24 25 26 27 28 29 30 31 32 33
    </sql>

    <select id="selectTEmergencyDrillsList" parameterType="TEmergencyDrills" resultMap="TEmergencyDrillsResult">
        <include refid="selectTEmergencyDrillsVo"/>
        <where>  
            <if test="fDrillsId != null "> and f_drills_id = #{fDrillsId}</if>
            <if test="fDrillsTime != null  and fDrillsTime != ''"> and f_drills_time = #{fDrillsTime}</if>
            <if test="fEvent != null  and fEvent != ''"> and f_event = #{fEvent}</if>
            <if test="fPlace != null  and fPlace != ''"> and f_place = #{fPlace}</if>
            <if test="fPerDep != null  and fPerDep != ''"> and f_per_dep = #{fPerDep}</if>
            <if test="fDrillsContent != null  and fDrillsContent != ''"> and f_drills_content = #{fDrillsContent}</if>
军师中郎将's avatar
军师中郎将 committed
34
            <if test="fDrillDepartment != null  and fDrillDepartment != ''"> and f_drill_department = #{fDrillDepartment}</if>
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
            <if test="fCreateTime != null "> and f_create_time = #{fCreateTime}</if>
            <if test="fUpdateTime != null "> and f_update_time = #{fUpdateTime}</if>
            <if test="fIsDel != null  and fIsDel != ''"> and f_is_del = #{fIsDel}</if>
            <if test="fRemarks != null  and fRemarks != ''"> and f_remarks = #{fRemarks}</if>
        </where>
    </select>
    
    <select id="selectTEmergencyDrillsById" parameterType="Long" resultMap="TEmergencyDrillsResult">
        <include refid="selectTEmergencyDrillsVo"/>
        where f_drills_id = #{fDrillsId}
    </select>
        
    <insert id="insertTEmergencyDrills" parameterType="TEmergencyDrills">
        insert into t_emergency_drills
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fDrillsId != null">f_drills_id,</if>
            <if test="fDrillsTime != null">f_drills_time,</if>
            <if test="fEvent != null">f_event,</if>
            <if test="fPlace != null">f_place,</if>
            <if test="fPerDep != null">f_per_dep,</if>
            <if test="fDrillsContent != null">f_drills_content,</if>
军师中郎将's avatar
军师中郎将 committed
56
            <if test="fDrillDepartment != null">f_drill_department,</if>
57 58 59 60 61 62 63 64 65 66 67 68
            <if test="fCreateTime != null">f_create_time,</if>
            <if test="fUpdateTime != null">f_update_time,</if>
            <if test="fIsDel != null">f_is_del,</if>
            <if test="fRemarks != null">f_remarks,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fDrillsId != null">#{fDrillsId},</if>
            <if test="fDrillsTime != null">#{fDrillsTime},</if>
            <if test="fEvent != null">#{fEvent},</if>
            <if test="fPlace != null">#{fPlace},</if>
            <if test="fPerDep != null">#{fPerDep},</if>
            <if test="fDrillsContent != null">#{fDrillsContent},</if>
军师中郎将's avatar
军师中郎将 committed
69
            <if test="fDrillDepartment != null">#{fDrillDepartment},</if>
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
            <if test="fCreateTime != null">#{fCreateTime},</if>
            <if test="fUpdateTime != null">#{fUpdateTime},</if>
            <if test="fIsDel != null">#{fIsDel},</if>
            <if test="fRemarks != null">#{fRemarks},</if>
         </trim>
    </insert>

    <update id="updateTEmergencyDrills" parameterType="TEmergencyDrills">
        update t_emergency_drills
        <trim prefix="SET" suffixOverrides=",">
            <if test="fDrillsTime != null">f_drills_time = #{fDrillsTime},</if>
            <if test="fEvent != null">f_event = #{fEvent},</if>
            <if test="fPlace != null">f_place = #{fPlace},</if>
            <if test="fPerDep != null">f_per_dep = #{fPerDep},</if>
            <if test="fDrillsContent != null">f_drills_content = #{fDrillsContent},</if>
军师中郎将's avatar
军师中郎将 committed
85
            <if test="fDrillDepartment != null">f_drill_department = #{fDrillDepartment},</if>
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
            <if test="fCreateTime != null">f_create_time = #{fCreateTime},</if>
            <if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
            <if test="fIsDel != null">f_is_del = #{fIsDel},</if>
            <if test="fRemarks != null">f_remarks = #{fRemarks},</if>
        </trim>
        where f_drills_id = #{fDrillsId}
    </update>

    <delete id="deleteTEmergencyDrillsById" parameterType="Long">
        delete from t_emergency_drills where f_drills_id = #{fDrillsId}
    </delete>

    <delete id="deleteTEmergencyDrillsByIds" parameterType="String">
        delete from t_emergency_drills where f_drills_id in 
        <foreach item="fDrillsId" collection="array" open="(" separator="," close=")">
            #{fDrillsId}
        </foreach>
    </delete>
</mapper>