UfoStoragePriceMapper.xml 5.72 KB
<?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.yoho.search.dal.UfoStoragePriceMapper">
    
    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.StoragePrice">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="product_id" property="productId" jdbcType="INTEGER"/>
        <result column="skup" property="skup" jdbcType="INTEGER"/>
        <result column="goods_id" property="goodsId" jdbcType="INTEGER"/>
        <result column="storage_id" property="storageId" jdbcType="SMALLINT"/>
        <result column="depot_num" property="depotNum" jdbcType="INTEGER"/>
        <result column="seller_uid" property="sellerUid" jdbcType="INTEGER"/>
        <result column="price" property="price" jdbcType="DECIMAL"/>
        <result column="status" property="status" jdbcType="INTEGER"/>
        <result column="update_time" property="updateTime" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="INTEGER"/>
    </resultMap>
    
    <sql id="Base_Column_List">
    id,skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status, update_time,
    create_time
    </sql>
    
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from storage_price
        where id = #{id,jdbcType=INTEGER}
    </select>
    
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from storage_price
    where id = #{id,jdbcType=INTEGER}
    </delete>

    <insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.StoragePrice" >
        insert into storage_price
        <trim prefix="(" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                id,
            </if>
            <if test="skup != null" >
                skup,
            </if>
            <if test="productId != null" >
                product_id,
            </if>
            <if test="goodsId != null" >
                goods_id,
            </if>
            <if test="storageId != null" >
                storage_id,
            </if>
            <if test="depotNum != null" >
                depot_num,
            </if>
            <if test="sellerUid != null" >
                seller_uid,
            </if>
            <if test="price != null" >
                price,
            </if>
            <if test="status != null" >
                status,
            </if>
            <if test="updateTime != null" >
                update_time,
            </if>
            <if test="createTime != null" >
                create_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                #{id,jdbcType=INTEGER},
            </if>
            <if test="skup != null" >
                #{skup,jdbcType=INTEGER},
            </if>
            <if test="productId != null" >
                #{productId,jdbcType=INTEGER},
            </if>
            <if test="goodsId != null" >
                #{goodsId,jdbcType=INTEGER},
            </if>
            <if test="storageId != null" >
                #{storageId,jdbcType=INTEGER},
            </if>
            <if test="depotNum != null" >
                #{depotNum,jdbcType=INTEGER},
            </if>
            <if test="sellerUid != null" >
                #{sellerUid,jdbcType=INTEGER},
            </if>
            <if test="price != null" >
                #{price,jdbcType=DECIMAL},
            </if>
            <if test="status != null" >
                #{status,jdbcType=INTEGER},
            </if>
            <if test="updateTime != null" >
                #{updateTime,jdbcType=INTEGER},
            </if>
            <if test="createTime != null" >
                #{createTime,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.StoragePrice">
        update storage_price
        <set>
            <if test="skup != null">
                skup = #{skup,jdbcType=INTEGER},
            </if>
            <if test="productId != null">
                product_id = #{productId,jdbcType=INTEGER},
            </if>
            <if test="goodsId != null">
                goods_id = #{goodsId,jdbcType=INTEGER},
            </if>
            <if test="storageId != null">
                storage_id = #{storageId,jdbcType=SMALLINT},
            </if>
            <if test="depotNum != null">
                depot_num = #{depotNum,jdbcType=INTEGER},
            </if>
            <if test="sellerUid != null">
                seller_uid = #{sellerUid,jdbcType=INTEGER},
            </if>
            <if test="price != null">
                price = #{price,jdbcType=DECIMAL},
            </if>
            <if test="status != null">
                status = #{status,jdbcType=INTEGER},
            </if>
            <if test="updateTime != null">
                update_time = #{updateTime,jdbcType=INTEGER},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=INTEGER},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <select id="selectByProductIdList" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List"/>
        from storage_price
        where
        product_id in
        <foreach item="item" index="index" collection="list"
                 open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
</mapper>