UfoProductPoolDetailMapper.xml 3.73 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.UfoProductPoolDetailMapper">

    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ProductPoolDetail">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="pool_id" property="poolId" jdbcType="INTEGER"/>
        <result column="product_id" property="productId" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="INTEGER"/>
        <result column="order_by" property="orderBy" jdbcType="INTEGER"/>
    </resultMap>

    <sql id="Base_Column_List">
    id, pool_id, product_id, create_time,order_by
    </sql>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from product_pool_detail
        where id = #{id,jdbcType=INTEGER}
    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from product_pool_detail
    where id = #{id,jdbcType=INTEGER}
    </delete>

    <insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductPoolDetail" >
        insert into product_pool_detail
        <trim prefix="(" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                id,
            </if>
            <if test="poolId != null" >
                pool_id,
            </if>
            <if test="productId != null" >
                product_id,
            </if>
            <if test="createTime != null" >
                create_time,
            </if>
            <if test="orderBy != null" >
                order_by,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                #{id,jdbcType=INTEGER},
            </if>
            <if test="poolId != null" >
                #{poolId,jdbcType=INTEGER},
            </if>
            <if test="productId != null" >
                #{productId,jdbcType=INTEGER},
            </if>
            <if test="createTime != null" >
                #{createTime,jdbcType=INTEGER},
            </if>
            <if test="orderBy != null" >
                #{orderBy,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductPoolDetail">
        update product_pool_detail
        <set>
            <if test="poolId != null">
                pool_id = #{poolId,jdbcType=INTEGER},
            </if>
            <if test="productId != null">
                product_id = #{productId,jdbcType=INTEGER},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=INTEGER},
            </if>
            <if test="orderBy != null">
                order_by = #{orderBy,jdbcType=INTEGER},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ufo_product.ProductPoolDetail" >
        update product_pool_detail
        set pool_id = #{poolId,jdbcType=INTEGER},
        product_id = #{productId,jdbcType=INTEGER},
        create_time = #{createTime,jdbcType=INTEGER},
        order_by = #{orderBy,jdbcType=INTEGER}
        where id = #{id,jdbcType=INTEGER}
    </update>

    <select id="selectByProductId" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List"/>
        from product_pool_detail
        WHERE product_id = #{productId,jdbcType=INTEGER}
    </select>



</mapper>