PromotionParamsMapper.xml 1.94 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.PromotionParamsMapper">
    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.PromotionParams">
        <id column="promotion_id" property="promotionId" jdbcType="INTEGER"/>
        <result column="condition_param" property="conditionParam" jdbcType="VARCHAR"/>
        <result column="is_del" property="isDel" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
    promotion_id, condition_param, is_del
    </sql>

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

    <select id="selectByPromotionIdList" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from promotion_params where promotion_id in
        <foreach item="item" index="index" collection="list"
                 open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>

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

    <insert id="insert" parameterType="com.yoho.search.dal.model.PromotionParams">
    insert into promotion_params (promotion_id, condition_param, is_del)
    values (#{promotionId,jdbcType=INTEGER},
    #{conditionParam,jdbcType=VARCHAR},
    #{isDel,jdbcType=VARCHAR})
    </insert>

    <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.PromotionParams">
    update promotion_params
    set condition_param = #{conditionParam,jdbcType=VARCHAR},
    is_del = #{isDel,jdbcType=VARCHAR}
    where promotion_id = #{promotionId,jdbcType=INTEGER}
  </update>
</mapper>