CsRecallConfigProductMapper.xml 4.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.CsRecallConfigProductMapper">
    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.CsRecallConfigProduct">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="config_page" property="configPage" jdbcType="INTEGER"/>
        <result column="config_type" property="configType" jdbcType="VARCHAR"/>
        <result column="config_type_id" property="configTypeId" jdbcType="VARCHAR"/>
        <result column="config_status" property="configStatus" jdbcType="INTEGER"/>
        <result column="new_shelve" property="newShelve" jdbcType="INTEGER"/>
        <result column="promotion" property="promotion" jdbcType="INTEGER"/>
        <result column="reduce_price" property="reducePrice" jdbcType="INTEGER"/>
        <result column="ctr_value" property="ctrValue" jdbcType="INTEGER"/>
        <result column="heat_value" property="heatValue" jdbcType="INTEGER"/>
        <result column="random" property="random" jdbcType="INTEGER"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        id, config_page, config_type,config_type_id,config_status,new_shelve,promotion,reduce_price,ctr_value,heat_value,random,update_time
    </sql>

    <insert id="insert" parameterType="com.yoho.search.dal.model.CsRecallConfigProduct" timeout="20000">
        insert ignore into cs_recall_config_product (id,config_page,config_type, config_type_id,config_status,new_shelve,promotion,reduce_price,ctr_value,heat_value,random)
        values (#{id,jdbcType=INTEGER},#{configPage,jdbcType=INTEGER},#{configType,jdbcType=VARCHAR}, #{configTypeId,jdbcType=INTEGER}, #{configStatus,jdbcType=INTEGER}, #{newShelve,jdbcType=INTEGER},#{promotion,jdbcType=INTEGER}, #{reducePrice,jdbcType=INTEGER}, #{ctrValue,jdbcType=INTEGER}, #{heatValue,jdbcType=INTEGER}, #{random,jdbcType=INTEGER})
    </insert>

    <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.CsRecallConfigProduct" timeout="20000">
        update cs_recall_config_product
        <set>
            <if test="configPage != null">
                config_page = #{configPage,jdbcType=INTEGER},
            </if>
            <if test="configType != null">
                config_type = #{configType,jdbcType=VARCHAR},
            </if>
            <if test="configTypeId != null">
                config_type_id = #{configTypeId,jdbcType=VARCHAR},
            </if>
            <if test="configStatus != null">
                config_status = #{configStatus,jdbcType=INTEGER},
            </if>
            <if test="newShelve != null">
                new_shelve = #{newShelve,jdbcType=INTEGER},
            </if>
            <if test="promotion != null">
                promotion = #{promotion,jdbcType=INTEGER},
            </if>
            <if test="reducePrice != null">
                reduce_price = #{reducePrice,jdbcType=INTEGER},
            </if>
            <if test="ctrValue != null">
                ctr_value = #{ctrValue,jdbcType=INTEGER},
            </if>
            <if test="heatValue != null">
                heat_value = #{heatValue,jdbcType=INTEGER},
            </if>
            <if test="random != null">
                random = #{random,jdbcType=INTEGER},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

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

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

    <select id="selectCount" resultType="int">
        select count(0) from cs_recall_config_product
    </select>

    <select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
        select <include refid="Base_Column_List" /> from cs_recall_config_product limit #{start}, #{limit}
    </select>

</mapper>