TInsSurListInforMapper.xml 4.97 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<?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.TInsSurListInforMapper">
    
    <resultMap type="TInsSurListInfor" id="TInsSurListInforResult">
        <result property="fInsSurListInforId"    column="f_ins_sur_list_infor_id"    />
        <result property="fCheckTaskCode"    column="f_check_task_code"    />
        <result property="fTypeCode"    column="f_type_code"    />
        <result property="fContents"    column="f_contents"    />
        <result property="fResType"    column="f_res_type"    />
        <result property="fResOption"    column="f_res_option"    />
        <result property="ord"    column="ord"    />
        <result property="fLastUpdateTime"    column="f_last_update_time"    />
    </resultMap>

    <sql id="selectTInsSurListInforVo">
        select f_ins_sur_list_infor_id, f_check_task_code, f_type_code, f_contents, f_res_type, f_res_option, ord, f_last_update_time from t_ins_sur_list_infor
    </sql>

    <select id="selectTInsSurListInforList" parameterType="TInsSurListInfor" resultMap="TInsSurListInforResult">
        <include refid="selectTInsSurListInforVo"/>
        <where>  
            <if test="fTypeCode != null  and fTypeCode != ''"> and f_type_code = #{fTypeCode}</if>
            <if test="fResType != null "> and f_res_type = #{fResType}</if>
27
            <if test="fCheckTaskCode != null  and fCheckTaskCode != ''"> and f_check_task_code = #{fCheckTaskCode}</if>
耿迪迪's avatar
耿迪迪 committed
28
        </where>
耿迪迪's avatar
耿迪迪 committed
29
        ORDER BY f_last_update_time DESC
耿迪迪's avatar
耿迪迪 committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
    </select>
    
    <select id="selectTInsSurListInforById" parameterType="Long" resultMap="TInsSurListInforResult">
        <include refid="selectTInsSurListInforVo"/>
        where f_ins_sur_list_infor_id = #{fInsSurListInforId}
    </select>
        
    <insert id="insertTInsSurListInfor" parameterType="TInsSurListInfor" useGeneratedKeys="true" keyProperty="fInsSurListInforId">
        insert into t_ins_sur_list_infor
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fCheckTaskCode != null">f_check_task_code,</if>
            <if test="fTypeCode != null">f_type_code,</if>
            <if test="fContents != null">f_contents,</if>
            <if test="fResType != null">f_res_type,</if>
            <if test="fResOption != null">f_res_option,</if>
            <if test="ord != null">ord,</if>
            <if test="fLastUpdateTime != null">f_last_update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fCheckTaskCode != null">#{fCheckTaskCode},</if>
            <if test="fTypeCode != null">#{fTypeCode},</if>
            <if test="fContents != null">#{fContents},</if>
            <if test="fResType != null">#{fResType},</if>
            <if test="fResOption != null">#{fResOption},</if>
            <if test="ord != null">#{ord},</if>
            <if test="fLastUpdateTime != null">#{fLastUpdateTime},</if>
         </trim>
    </insert>

    <update id="updateTInsSurListInfor" parameterType="TInsSurListInfor">
        update t_ins_sur_list_infor
        <trim prefix="SET" suffixOverrides=",">
            <if test="fCheckTaskCode != null">f_check_task_code = #{fCheckTaskCode},</if>
            <if test="fTypeCode != null">f_type_code = #{fTypeCode},</if>
            <if test="fContents != null">f_contents = #{fContents},</if>
            <if test="fResType != null">f_res_type = #{fResType},</if>
            <if test="fResOption != null">f_res_option = #{fResOption},</if>
            <if test="ord != null">ord = #{ord},</if>
            <if test="fLastUpdateTime != null">f_last_update_time = #{fLastUpdateTime},</if>
        </trim>
        where f_ins_sur_list_infor_id = #{fInsSurListInforId}
    </update>

    <delete id="deleteTInsSurListInforById" parameterType="Long">
        delete from t_ins_sur_list_infor where f_ins_sur_list_infor_id = #{fInsSurListInforId}
    </delete>

    <delete id="deleteTInsSurListInforByIds" parameterType="String">
        delete from t_ins_sur_list_infor where f_ins_sur_list_infor_id in 
        <foreach item="fInsSurListInforId" collection="array" open="(" separator="," close=")">
            #{fInsSurListInforId}
        </foreach>
    </delete>
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105

    <insert id="batchInsertTInsSurListInfor" parameterType="TInsSurListInfor" useGeneratedKeys="true" keyProperty="fInsSurListInforId">
        insert into t_ins_sur_list_infor(
            f_check_task_code,
            f_type_code,
            f_contents,
            f_res_type,
            f_res_option,
            ord,
            f_last_update_time
        )VALUES
        <foreach collection="list" separator="," item="item">
            (
                #{item.fCheckTaskCode},
                #{item.fTypeCode},
                #{item.fContents},
                #{item.fResType},
                #{item.fResOption},
                #{item.ord},
                #{item.fLastUpdateTime}
            )
        </foreach>
    </insert>
耿迪迪's avatar
耿迪迪 committed
106
</mapper>