yptuidmapper.xml 8.03 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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
<?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.YptuidMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Yptuid">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="userid" column="userid" jdbcType="VARCHAR"/>
        <result property="qzid" column="qzid" jdbcType="VARCHAR"/>
        <result property="ver" column="ver" jdbcType="VARCHAR"/>
        <result property="branch" column="branch" jdbcType="VARCHAR"/>
        <result property="stbtbl" column="stbtbl" jdbcType="VARCHAR"/>
        <result property="keyword" column="keyword" jdbcType="VARCHAR"/>
        <result property="enkeyword" column="enkeyword" jdbcType="VARCHAR"/>
        <result property="offsetcoordx" column="offsetcoordx" jdbcType="VARCHAR"/>
        <result property="offsetcoordy" column="offsetcoordy" jdbcType="VARCHAR"/>
        <result property="imagewidth" column="imagewidth" jdbcType="VARCHAR"/>
        <result property="imageheight" column="imageheight" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,userid,qzid,
        ver,branch,stbtbl,
        keyword,enkeyword,offsetcoordx,
        offsetcoordy,imagewidth,imageheight
    </sql>

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

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

    <insert id="insert">
        insert into yptuid
        (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{userid,jdbcType=VARCHAR},
            #{qzid,jdbcType=VARCHAR},
            #{ver,jdbcType=VARCHAR},
            #{branch,jdbcType=VARCHAR},
            #{stbtbl,jdbcType=VARCHAR},
            #{keyword,jdbcType=VARCHAR},
            #{enkeyword,jdbcType=VARCHAR},
            #{offsetcoordx,jdbcType=VARCHAR},
            #{offsetcoordy,jdbcType=VARCHAR},
            #{imagewidth,jdbcType=VARCHAR},
            #{imageheight,jdbcType=VARCHAR}
        </trim>
    </insert>
    <insert id="insertSelective">
        insert into yptuid
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="userid != null">userid,</if>
            <if test="qzid != null">QZID,</if>
            <if test="ver != null">ver,</if>
            <if test="branch != null">branch,</if>
            <if test="stbtbl != null">stbtbl,</if>
            <if test="keyword != null">keyword,</if>
            <if test="enkeyword != null">enkeyword,</if>
            <if test="offsetcoordx != null">offsetcoordx,</if>
            <if test="offsetcoordy != null">offsetcoordy,</if>
            <if test="imagewidth != null">imagewidth,</if>
            <if test="imageheight != null">imageheight,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="userid != null">#{userid,jdbcType=VARCHAR},</if>
            <if test="qzid != null">#{qzid,jdbcType=VARCHAR},</if>
            <if test="ver != null">#{ver,jdbcType=VARCHAR},</if>
            <if test="branch != null">#{branch,jdbcType=VARCHAR},</if>
            <if test="stbtbl != null">#{stbtbl,jdbcType=VARCHAR},</if>
            <if test="keyword != null">#{keyword,jdbcType=VARCHAR},</if>
            <if test="enkeyword != null">#{enkeyword,jdbcType=VARCHAR},</if>
            <if test="offsetcoordx != null">#{offsetcoordx,jdbcType=VARCHAR},</if>
            <if test="offsetcoordy != null">#{offsetcoordy,jdbcType=VARCHAR},</if>
            <if test="imagewidth != null">#{imagewidth,jdbcType=VARCHAR},</if>
            <if test="imageheight != null">#{imageheight,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.brilliance.isc.bo.Yptuid">
        update yptuid
        <set>
            <if test="inr != null">
                inr = #{inr,jdbcType=VARCHAR},
            </if>
            <if test="userid != null">
                userid = #{userid,jdbcType=VARCHAR},
            </if>
            <if test="qzid != null">
                qzid = #{qzid,jdbcType=VARCHAR},
            </if>
            <if test="ver != null">
                ver = #{ver,jdbcType=VARCHAR},
            </if>
            <if test="branch != null">
                branch = #{branch,jdbcType=VARCHAR},
            </if>
            <if test="stbtbl != null">
                stbtbl = #{stbtbl,jdbcType=VARCHAR},
            </if>
            <if test="keyword != null">
                keyword = #{keyword,jdbcType=VARCHAR},
            </if>
            <if test="enkeyword != null">
                enkeyword = #{enkeyword,jdbcType=VARCHAR},
            </if>
            <if test="offsetcoordx != null">
                offsetcoordx = #{offsetcoordx,jdbcType=VARCHAR},
            </if>
            <if test="offsetcoordy != null">
                offsetcoordy = #{offsetcoordy,jdbcType=VARCHAR},
            </if>
            <if test="imagewidth != null">
                imagewidth = #{imagewidth,jdbcType=VARCHAR},
            </if>
            <if test="imageheight != null">
                imageheight = #{imageheight,jdbcType=VARCHAR},
            </if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.brilliance.isc.bo.Yptuid">
        update yptuid
        set
        inr =  #{inr,jdbcType=VARCHAR},
        userid =  #{userid,jdbcType=VARCHAR},
        qzid =  #{qzid,jdbcType=VARCHAR},
        ver =  #{ver,jdbcType=VARCHAR},
        branch =  #{branch,jdbcType=VARCHAR},
        stbtbl =  #{stbtbl,jdbcType=VARCHAR},
        keyword =  #{keyword,jdbcType=VARCHAR},
        enkeyword =  #{enkeyword,jdbcType=VARCHAR},
        offsetcoordx =  #{offsetcoordx,jdbcType=VARCHAR},
        offsetcoordy =  #{offsetcoordy,jdbcType=VARCHAR},
        imagewidth =  #{imagewidth,jdbcType=VARCHAR},
        imageheight =  #{imageheight,jdbcType=VARCHAR}
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <select id="listByRecord" parameterType="com.brilliance.isc.vo.manager.YptuidVo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yptuid
        <where>
            <if test="branchList != null and branchList.size() !=0">
                branch in
                <foreach collection="branchList" item="item" index="index" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="stbtbl != null and stbtbl != ''">
                AND stbtbl = #{stbtbl}
            </if>
            <if test="keyword != null and keyword != ''">
                AND keyword = #{keyword}
            </if>
            <if test="userid != null and userid != ''">
                AND userid = #{userid}
            </if>
            <if test="qzid != null and qzid != ''">
                AND qzid = #{qzid}
            </if>
        </where>
    </select>

    <insert id="addYptUid">
        insert into yptuid(userid, qzid, ver, branch, stbtbl, keyword, enkeyword, offsetcoordx, offsetcoordy, imagewidth, imageheight)
		values (#{userid}, #{qzid}, #{ver}, #{branch}, #{stbtbl}, #{keyword}, #{enkeyword}, #{offsetcoordx}, #{offsetcoordy}, #{imagewidth}, #{imageheight})
    </insert>
    <select id="selectByStbtblAndBranchinr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from yptuid
        where
        stbtbl = #{stbtbl,jdbcType=VARCHAR}
        AND BRANCH IN(SELECT branch FROM BCH WHERE INR=#{branchinr,jdbcType=VARCHAR} )
    </select>

    <select id="selectCountByBranch" resultType="int">
        select count(1)
        from yptuid
        where branch = #{branch}
    </select>
</mapper>