ProductCoverActivityMapper.xml 8.24 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.ProductCoverActivityMapper" >
    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ProductCoverActivity" >
        <id column="id" property="id" jdbcType="INTEGER" />
        <result column="product_skn" property="productSkn" jdbcType="INTEGER" />
        <result column="begin_time" property="beginTime" jdbcType="INTEGER" />
        <result column="end_time" property="endTime" jdbcType="INTEGER" />
        <result column="content_one" property="contentOne" jdbcType="VARCHAR" />
        <result column="content_two" property="contentTwo" jdbcType="VARCHAR" />
        <result column="content_three" property="contentThree" jdbcType="VARCHAR" />
        <result column="order_by" property="orderBy" jdbcType="INTEGER" />
        <result column="left_image_url" property="leftImageUrl" jdbcType="VARCHAR" />
        <result column="bg_image_url" property="bgImageUrl" jdbcType="VARCHAR" />
        <result column="create_time" property="createTime" jdbcType="INTEGER" />
        <result column="update_time" property="updateTime" jdbcType="INTEGER" />
        <result column="status" property="status" jdbcType="TINYINT" />
    </resultMap>
    <sql id="Base_Column_List" >
    id, product_skn, begin_time, end_time, content_one, content_two, content_three, order_by,
    left_image_url, bg_image_url, create_time, update_time, status
  </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
        select
        <include refid="Base_Column_List" />
        from product_cover_activity
        where id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from product_cover_activity
    where id = #{id,jdbcType=INTEGER}
  </delete>
    <insert id="insert" parameterType="com.yoho.search.dal.model.ProductCoverActivity" >
    insert into product_cover_activity (id, product_skn, begin_time,
      end_time, content_one, content_two,
      content_three, order_by, left_image_url,
      bg_image_url, create_time, update_time,
      status)
    values (#{id,jdbcType=INTEGER}, #{productSkn,jdbcType=INTEGER}, #{beginTime,jdbcType=INTEGER},
      #{endTime,jdbcType=INTEGER}, #{contentOne,jdbcType=VARCHAR}, #{contentTwo,jdbcType=VARCHAR},
      #{contentThree,jdbcType=VARCHAR}, #{orderBy,jdbcType=INTEGER}, #{leftImageUrl,jdbcType=VARCHAR},
      #{bgImageUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER},
      #{status,jdbcType=TINYINT})
  </insert>
    <insert id="insertSelective" parameterType="com.yoho.search.dal.model.ProductCoverActivity" >
        insert into product_cover_activity
        <trim prefix="(" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                id,
            </if>
            <if test="productSkn != null" >
                product_skn,
            </if>
            <if test="beginTime != null" >
                begin_time,
            </if>
            <if test="endTime != null" >
                end_time,
            </if>
            <if test="contentOne != null" >
                content_one,
            </if>
            <if test="contentTwo != null" >
                content_two,
            </if>
            <if test="contentThree != null" >
                content_three,
            </if>
            <if test="orderBy != null" >
                order_by,
            </if>
            <if test="leftImageUrl != null" >
                left_image_url,
            </if>
            <if test="bgImageUrl != null" >
                bg_image_url,
            </if>
            <if test="createTime != null" >
                create_time,
            </if>
            <if test="updateTime != null" >
                update_time,
            </if>
            <if test="status != null" >
                status,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                #{id,jdbcType=INTEGER},
            </if>
            <if test="productSkn != null" >
                #{productSkn,jdbcType=INTEGER},
            </if>
            <if test="beginTime != null" >
                #{beginTime,jdbcType=INTEGER},
            </if>
            <if test="endTime != null" >
                #{endTime,jdbcType=INTEGER},
            </if>
            <if test="contentOne != null" >
                #{contentOne,jdbcType=VARCHAR},
            </if>
            <if test="contentTwo != null" >
                #{contentTwo,jdbcType=VARCHAR},
            </if>
            <if test="contentThree != null" >
                #{contentThree,jdbcType=VARCHAR},
            </if>
            <if test="orderBy != null" >
                #{orderBy,jdbcType=INTEGER},
            </if>
            <if test="leftImageUrl != null" >
                #{leftImageUrl,jdbcType=VARCHAR},
            </if>
            <if test="bgImageUrl != null" >
                #{bgImageUrl,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null" >
                #{createTime,jdbcType=INTEGER},
            </if>
            <if test="updateTime != null" >
                #{updateTime,jdbcType=INTEGER},
            </if>
            <if test="status != null" >
                #{status,jdbcType=TINYINT},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ProductCoverActivity" >
        update product_cover_activity
        <set >
            <if test="productSkn != null" >
                product_skn = #{productSkn,jdbcType=INTEGER},
            </if>
            <if test="beginTime != null" >
                begin_time = #{beginTime,jdbcType=INTEGER},
            </if>
            <if test="endTime != null" >
                end_time = #{endTime,jdbcType=INTEGER},
            </if>
            <if test="contentOne != null" >
                content_one = #{contentOne,jdbcType=VARCHAR},
            </if>
            <if test="contentTwo != null" >
                content_two = #{contentTwo,jdbcType=VARCHAR},
            </if>
            <if test="contentThree != null" >
                content_three = #{contentThree,jdbcType=VARCHAR},
            </if>
            <if test="orderBy != null" >
                order_by = #{orderBy,jdbcType=INTEGER},
            </if>
            <if test="leftImageUrl != null" >
                left_image_url = #{leftImageUrl,jdbcType=VARCHAR},
            </if>
            <if test="bgImageUrl != null" >
                bg_image_url = #{bgImageUrl,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null" >
                create_time = #{createTime,jdbcType=INTEGER},
            </if>
            <if test="updateTime != null" >
                update_time = #{updateTime,jdbcType=INTEGER},
            </if>
            <if test="status != null" >
                status = #{status,jdbcType=TINYINT},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ProductCoverActivity" >
    update product_cover_activity
    set product_skn = #{productSkn,jdbcType=INTEGER},
      begin_time = #{beginTime,jdbcType=INTEGER},
      end_time = #{endTime,jdbcType=INTEGER},
      content_one = #{contentOne,jdbcType=VARCHAR},
      content_two = #{contentTwo,jdbcType=VARCHAR},
      content_three = #{contentThree,jdbcType=VARCHAR},
      order_by = #{orderBy,jdbcType=INTEGER},
      left_image_url = #{leftImageUrl,jdbcType=VARCHAR},
      bg_image_url = #{bgImageUrl,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=INTEGER},
      status = #{status,jdbcType=TINYINT}
    where id = #{id,jdbcType=INTEGER}
  </update>

    <select id="selectCount" resultType="java.lang.Integer" timeout="20000">
        SELECT count(*) FROM product_cover_activity
    </select>
    <select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List"/>
        from product_cover_activity limit #{offset},#{pageSize}
    </select>
</mapper>