shadowmapper.xml 5.87 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
<?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.ShadowMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Shadow">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="ownref" column="ownref" jdbcType="VARCHAR"/>
        <result property="lotnum" column="lotnum" jdbcType="VARCHAR"/>
        <result property="bndsta" column="bndsta" jdbcType="VARCHAR"/>
        <result property="extkey" column="extkey" jdbcType="VARCHAR"/>
        <result property="cretim" column="cretim" jdbcType="TIMESTAMP"/>
        <result property="updtim" column="updtim" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,ownref,lotnum,bndsta,extkey,cretim,updtim
    </sql>

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

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

    <insert id="insert">
        insert into shadow (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{ownref,jdbcType=VARCHAR},
            #{lotnum,jdbcType=VARCHAR},
            #{bndsta,jdbcType=VARCHAR},
            #{extkey,jdbcType=VARCHAR},
            #{cretim,jdbcType=TIMESTAMP},
            #{updtim,jdbcType=TIMESTAMP},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into shadow
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="ownref != null">ownref,</if>
            <if test="lotnum != null">lotnum,</if>
            <if test="bndsta != null">bndsta,</if>
            <if test="extkey != null">extkey,</if>
            <if test="cretim != null">cretim,</if>
            <if test="updtim != null">updtim,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="ownref != null">#{ownref,jdbcType=VARCHAR}, </if>
            <if test="lotnum != null">#{lotnum,jdbcType=VARCHAR},</if>
            <if test="bndsta != null">#{bndsta,jdbcType=VARCHAR},</if>
            <if test="extkey != null">#{extkey,jdbcType=VARCHAR},</if>
            <if test="cretim != null">#{cretim,jdbcType=TIMESTAMP},</if>
            <if test="updtim != null">#{updtim,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update shadow
        <set>
            <if test="ownref != null">ownref = #{ownref,jdbcType=VARCHAR}, </if>
            <if test="lotnum != null">lotnum = #{lotnum,jdbcType=VARCHAR},</if>
            <if test="bndsta != null">bndsta = #{bndsta,jdbcType=VARCHAR},</if>
            <if test="extkey != null">extkey = #{extkey,jdbcType=VARCHAR},</if>
            <if test="cretim != null">cretim = #{cretim,jdbcType=TIMESTAMP},</if>
            <if test="updtim != null">updtim = #{updtim,jdbcType=TIMESTAMP},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update shadow
        <set>
            ownref = #{ownref,jdbcType=VARCHAR},
            lotnum = #{lotnum,jdbcType=VARCHAR},
            bndsta = #{bndsta,jdbcType=VARCHAR},
            extkey = #{extkey,jdbcType=VARCHAR},
            cretim = #{cretim,jdbcType=TIMESTAMP},
            updtim = #{updtim,jdbcType=TIMESTAMP},
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <select id="listFuzzyByRecord" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from shadow
        <where>
            <if test="ownref != null and ownref != ''">
                and ownref like concat('%',#{ownref,jdbcType=VARCHAR},'%')
            </if>
            <if test="lotnum != null and lotnum != ''">
                and lotnum like concat('%',#{lotnum,jdbcType=VARCHAR},'%')
            </if>
            <if test="bndsta != null and bndsta != ''">
                and bndsta = #{bndsta,jdbcType=VARCHAR}
            </if>
            <if test="extkey != null and extkey != ''">
                and extkey = #{extkey,jdbcType=VARCHAR}
            </if>
            <if test="crebgn != null">
                and cretim &gt;= #{crebgn,jdbcType=DATE}
            </if>
            <if test="creend != null">
                and cretim &lt;= #{creend,jdbcType=DATE}
            </if>
            <if test="updbgn != null">
                and updtim &gt;= #{updbgn,jdbcType=DATE}
            </if>
            <if test="updend != null">
                and updtim &lt;= #{updend,jdbcType=DATE}
            </if>
        </where>
    </select>

    <select id="listFuzzyByBo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from shadow
        <where>
            <if test="ownref != null and ownref != ''">
                and ownref like concat('%',#{ownref,jdbcType=VARCHAR},'%')
            </if>
            <if test="lotnum != null and lotnum != ''">
                and lotnum like concat('%',#{lotnum,jdbcType=VARCHAR},'%')
            </if>
            <if test="bndsta != null and bndsta != ''">
                and bndsta = #{bndsta,jdbcType=VARCHAR}
            </if>
            <if test="extkey != null and extkey != ''">
                and extkey = #{extkey,jdbcType=VARCHAR}
            </if>
        </where>
    </select>

    <select id="selectByLotNum" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from shadow
        where lotnum = #{lotnum,jdbcType=VARCHAR}
    </select>

</mapper>