TComplainDealOverSuperMapper.xml 4.69 KB
Newer Older
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 27 28 29 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 83
<?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.TComplainDealOverSuperMapper">
    
    <resultMap type="TComplainDealOverSuper" id="TComplainDealOverSuperResult">
        <result property="complainDealOverSuperId"    column="complain_deal_over_super_id"    />
        <result property="complainDealId"    column="complain_deal_id"    />
        <result property="supervisionReasons"    column="supervision_reasons"    />
        <result property="concent"    column="concent"    />
        <result property="overtimeSupervision"    column="overtime_supervision"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>

    <sql id="selectTComplainDealOverSuperVo">
        select complain_deal_over_super_id, complain_deal_id, supervision_reasons, concent, overtime_supervision, create_by, create_time from t_complain_deal_over_super
    </sql>

    <select id="selectTComplainDealOverSuperList" parameterType="TComplainDealOverSuper" resultMap="TComplainDealOverSuperResult">
        <include refid="selectTComplainDealOverSuperVo"/>
        <where>  
            <if test="complainDealId != null "> and complain_deal_id = #{complainDealId}</if>
            <if test="supervisionReasons != null  and supervisionReasons != ''"> and supervision_reasons = #{supervisionReasons}</if>
            <if test="concent != null  and concent != ''"> and concent = #{concent}</if>
            <if test="overtimeSupervision != null  and overtimeSupervision != ''"> and overtime_supervision = #{overtimeSupervision}</if>
        </where>
    </select>
    
    <select id="selectTComplainDealOverSuperById" parameterType="Long" resultMap="TComplainDealOverSuperResult">
        <include refid="selectTComplainDealOverSuperVo"/>
        where complain_deal_over_super_id = #{complainDealOverSuperId}
    </select>
    <select id="getOverSuperByComplainDealIdAndStatus" resultMap="TComplainDealOverSuperResult">
        <include refid="selectTComplainDealOverSuperVo"/>
        where complain_deal_id= #{complainDealId} and overtime_supervision = #{overtimeSupervision}
    </select>
        
    <insert id="insertTComplainDealOverSuper" parameterType="TComplainDealOverSuper" useGeneratedKeys="true" keyProperty="complainDealOverSuperId">
        insert into t_complain_deal_over_super
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="complainDealId != null">complain_deal_id,</if>
            <if test="supervisionReasons != null">supervision_reasons,</if>
            <if test="concent != null">concent,</if>
            <if test="overtimeSupervision != null">overtime_supervision,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="complainDealId != null">#{complainDealId},</if>
            <if test="supervisionReasons != null">#{supervisionReasons},</if>
            <if test="concent != null">#{concent},</if>
            <if test="overtimeSupervision != null">#{overtimeSupervision},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
         </trim>
    </insert>

    <update id="updateTComplainDealOverSuper" parameterType="TComplainDealOverSuper">
        update t_complain_deal_over_super
        <trim prefix="SET" suffixOverrides=",">
            <if test="complainDealId != null">complain_deal_id = #{complainDealId},</if>
            <if test="supervisionReasons != null">supervision_reasons = #{supervisionReasons},</if>
            <if test="concent != null">concent = #{concent},</if>
            <if test="overtimeSupervision != null">overtime_supervision = #{overtimeSupervision},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
        </trim>
        where complain_deal_over_super_id = #{complainDealOverSuperId}
    </update>

    <delete id="deleteTComplainDealOverSuperById" parameterType="Long">
        delete from t_complain_deal_over_super where complain_deal_over_super_id = #{complainDealOverSuperId}
    </delete>

    <delete id="deleteTComplainDealOverSuperByIds" parameterType="String">
        delete from t_complain_deal_over_super where complain_deal_over_super_id in 
        <foreach item="complainDealOverSuperId" collection="array" open="(" separator="," close=")">
            #{complainDealOverSuperId}
        </foreach>
    </delete>
</mapper>