pmsmapper.xml 5.58 KB
Newer Older
hulei 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 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
<?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.brilliance.isc.mda.dao.PmsMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Pms">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="ptcptbk" column="ptcptbk" jdbcType="VARCHAR"/>
        <result property="regsta" column="regsta" jdbcType="VARCHAR"/>
        <result property="sndrcv" column="sndrcv" jdbcType="VARCHAR"/>
        <result property="msgtyp" column="msgtyp" jdbcType="VARCHAR"/>
        <result property="prmsta" column="prmsta" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,ptcptbk,regsta,sndrcv,msgtyp,prmsta
    </sql>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap">
        select
            <include refid="Base_Column_List" />
        from pms
        where inr = #{inr,jdbcType=VARCHAR}
    </select>

    <delete id="deleteByPrimaryKey">
        delete from pms
        where inr = #{inr,jdbcType=VARCHAR}
    </delete>

    <insert id="insert">
        insert into pms (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{ptcptbk,jdbcType=VARCHAR},
            #{regsta,jdbcType=VARCHAR},
            #{sndrcv,jdbcType=VARCHAR},
            #{msgtyp,jdbcType=VARCHAR},
            #{prmsta,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into pms
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="ptcptbk != null">ptcptbk,</if>
            <if test="regsta != null">regsta,</if>
            <if test="sndrcv != null">sndrcv,</if>
            <if test="msgtyp != null">msgtyp,</if>
            <if test="prmsta != null">prmsta,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="ptcptbk != null">#{ptcptbk,jdbcType=VARCHAR}, </if>
            <if test="regsta != null">#{regsta,jdbcType=VARCHAR}, </if>
            <if test="sndrcv != null">#{sndrcv,jdbcType=VARCHAR}, </if>
            <if test="msgtyp != null">#{msgtyp,jdbcType=VARCHAR}, </if>
            <if test="prmsta != null">#{prmsta,jdbcType=VARCHAR}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update pms
        <set>
            <if test="ptcptbk != null">ptcptbk = #{ptcptbk,jdbcType=VARCHAR},</if>
            <if test="regsta != null">regsta = #{regsta,jdbcType=VARCHAR},</if>
            <if test="sndrcv != null">sndrcv = #{sndrcv,jdbcType=VARCHAR},</if>
            <if test="msgtyp != null">msgtyp = #{msgtyp,jdbcType=VARCHAR},</if>
            <if test="prmsta != null">prmsta = #{prmsta,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update pms
        <set>
            ptcptbk = #{ptcptbk,jdbcType=VARCHAR},
            regsta = #{regsta,jdbcType=VARCHAR},
            sndrcv = #{sndrcv,jdbcType=VARCHAR},
            msgtyp = #{msgtyp,jdbcType=VARCHAR},
            prmsta = #{prmsta,jdbcType=VARCHAR},
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>
    <update id="updatePrmstaBySyscd">
        update pms
            set prmsta = '0'
        where ptcptbk = #{ptcptbk,jdbcType=VARCHAR}
        and upper(substr(msgtyp,1,4)) = #{msgtyp,jdbcType=VARCHAR}
    </update>

    <delete id="deleteByIds">
        delete from act where inr in
        <foreach item="item" index="index" collection="collection" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <update id="dyncUpdate">
        update pms
        <set>
            <if test="module.ptcptbk != null">ptcptbk = #{module.ptcptbk,jdbcType=VARCHAR},</if>
            <if test="module.regsta != null">regsta = #{module.regsta,jdbcType=VARCHAR},</if>
            <if test="module.sndrcv != null">sndrcv = #{module.sndrcv,jdbcType=VARCHAR},</if>
            <if test="module.msgtyp != null">msgtyp = #{module.msgtyp,jdbcType=VARCHAR},</if>
            <if test="module.prmsta != null">prmsta = #{module.prmsta,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

    <delete id="dyncDelete">
        ${sql}
    </delete>

    <select id="dyncRead" resultMap="BaseResultMap">
        ${sql}
    </select>

    <select id="selectByWhere" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from pms WHERE 1=1
        <if test="ptcptbk != null and ptcptbk != ''">and ptcptbk = #{ptcptbk,jdbcType=VARCHAR}</if>
        <if test="msgtyp != null and msgtyp != ''">and msgtyp = #{msgtyp,jdbcType=VARCHAR}</if>
        <if test="sndrcv != null and sndrcv != ''">and sndrcv = #{sndrcv,jdbcType=VARCHAR}</if>
        <if test="prmsta != null">and prmsta = #{prmsta,jdbcType=INTEGER}</if>
        <if test="inr != null and inr != ''">and inr = #{inr,jdbcType=VARCHAR}</if>
        limit 1
    </select>

    <select id="selectByPSM" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from pms WHERE 1=1
        <if test="ptcptbk != null and ptcptbk != ''">and ptcptbk = #{ptcptbk,jdbcType=VARCHAR}</if>
        <if test="sndrcv != null and sndrcv != ''">and sndrcv = #{sndrcv,jdbcType=VARCHAR}</if>
        <if test="msgtyp != null and msgtyp != ''">and msgtyp = #{msgtyp,jdbcType=VARCHAR}</if>
    </select>

</mapper>