ProductCoverActivityMapper.xml 9.76 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="share_content" property="shareContent" jdbcType="VARCHAR" />
        <result column="detail_title" property="detailTitle" jdbcType="VARCHAR" />
        <result column="detail_note" property="detailNote" jdbcType="VARCHAR" />
        <result column="detail_left_img" property="detailLeftImg" jdbcType="VARCHAR" />
        <result column="detail_bg_img" property="detailBgImg" jdbcType="VARCHAR" />
        <result column="list_title" property="listTitle" jdbcType="VARCHAR" />
        <result column="list_note" property="listNote" jdbcType="VARCHAR" />
        <result column="list_bg_img" property="listBgImg" 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" />
        <result column="order_by" property="orderBy" jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List" >
    id, product_skn, begin_time, end_time, share_content, detail_title, detail_note,
    detail_left_img, detail_bg_img, list_title, list_note, list_bg_img, create_time,
    update_time, status, order_by
  </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, share_content, detail_title,
      detail_note, detail_left_img, detail_bg_img,
      list_title, list_note, list_bg_img,
      create_time, update_time, status,
      order_by)
    values (#{id,jdbcType=INTEGER}, #{productSkn,jdbcType=INTEGER}, #{beginTime,jdbcType=INTEGER},
      #{endTime,jdbcType=INTEGER}, #{shareContent,jdbcType=VARCHAR}, #{detailTitle,jdbcType=VARCHAR},
      #{detailNote,jdbcType=VARCHAR}, #{detailLeftImg,jdbcType=VARCHAR}, #{detailBgImg,jdbcType=VARCHAR},
      #{listTitle,jdbcType=VARCHAR}, #{listNote,jdbcType=VARCHAR}, #{listBgImg,jdbcType=VARCHAR},
      #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{status,jdbcType=TINYINT},
      #{orderBy,jdbcType=INTEGER})
  </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="shareContent != null" >
                share_content,
            </if>
            <if test="detailTitle != null" >
                detail_title,
            </if>
            <if test="detailNote != null" >
                detail_note,
            </if>
            <if test="detailLeftImg != null" >
                detail_left_img,
            </if>
            <if test="detailBgImg != null" >
                detail_bg_img,
            </if>
            <if test="listTitle != null" >
                list_title,
            </if>
            <if test="listNote != null" >
                list_note,
            </if>
            <if test="listBgImg != null" >
                list_bg_img,
            </if>
            <if test="createTime != null" >
                create_time,
            </if>
            <if test="updateTime != null" >
                update_time,
            </if>
            <if test="status != null" >
                status,
            </if>
            <if test="orderBy != null" >
                order_by,
            </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="shareContent != null" >
                #{shareContent,jdbcType=VARCHAR},
            </if>
            <if test="detailTitle != null" >
                #{detailTitle,jdbcType=VARCHAR},
            </if>
            <if test="detailNote != null" >
                #{detailNote,jdbcType=VARCHAR},
            </if>
            <if test="detailLeftImg != null" >
                #{detailLeftImg,jdbcType=VARCHAR},
            </if>
            <if test="detailBgImg != null" >
                #{detailBgImg,jdbcType=VARCHAR},
            </if>
            <if test="listTitle != null" >
                #{listTitle,jdbcType=VARCHAR},
            </if>
            <if test="listNote != null" >
                #{listNote,jdbcType=VARCHAR},
            </if>
            <if test="listBgImg != null" >
                #{listBgImg,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>
            <if test="orderBy != null" >
                #{orderBy,jdbcType=INTEGER},
            </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="shareContent != null" >
                share_content = #{shareContent,jdbcType=VARCHAR},
            </if>
            <if test="detailTitle != null" >
                detail_title = #{detailTitle,jdbcType=VARCHAR},
            </if>
            <if test="detailNote != null" >
                detail_note = #{detailNote,jdbcType=VARCHAR},
            </if>
            <if test="detailLeftImg != null" >
                detail_left_img = #{detailLeftImg,jdbcType=VARCHAR},
            </if>
            <if test="detailBgImg != null" >
                detail_bg_img = #{detailBgImg,jdbcType=VARCHAR},
            </if>
            <if test="listTitle != null" >
                list_title = #{listTitle,jdbcType=VARCHAR},
            </if>
            <if test="listNote != null" >
                list_note = #{listNote,jdbcType=VARCHAR},
            </if>
            <if test="listBgImg != null" >
                list_bg_img = #{listBgImg,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>
            <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.ProductCoverActivity" >
    update product_cover_activity
    set product_skn = #{productSkn,jdbcType=INTEGER},
      begin_time = #{beginTime,jdbcType=INTEGER},
      end_time = #{endTime,jdbcType=INTEGER},
      share_content = #{shareContent,jdbcType=VARCHAR},
      detail_title = #{detailTitle,jdbcType=VARCHAR},
      detail_note = #{detailNote,jdbcType=VARCHAR},
      detail_left_img = #{detailLeftImg,jdbcType=VARCHAR},
      detail_bg_img = #{detailBgImg,jdbcType=VARCHAR},
      list_title = #{listTitle,jdbcType=VARCHAR},
      list_note = #{listNote,jdbcType=VARCHAR},
      list_bg_img = #{listBgImg,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=INTEGER},
      status = #{status,jdbcType=TINYINT},
      order_by = #{orderBy,jdbcType=INTEGER}
    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>