CutDownPriceUserRecordMapper.xml 1.93 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.activity.dal.CutDownPriceUserRecordMapper">
  <resultMap id="BaseResultMap" type="com.yoho.activity.dal.model.CutDownPriceUserRecord">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="user_id" property="userId" jdbcType="INTEGER"  />
    <result column="activity_id" property="activityId" jdbcType="INTEGER"  />
    <result column="product_skn" property="productSkn" jdbcType="INTEGER"  />
    <result column="create_time" property="createTime" jdbcType="INTEGER"  />
  </resultMap>
  <sql id="Base_Column_List" >
    id, user_id, activity_id, product_skn, create_time
  </sql>

  <insert id="addCutDownUserRecord" parameterType="com.yoho.activity.dal.model.CutDownPriceUserRecord">
    insert into cutdown_price_user_record (user_id, activity_id, product_skn, create_time)
    values (#{userId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{productSkn,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}
      )
  </insert>

  <select id="selectCutDownUserRecordCount" resultType="java.lang.Integer" >
    select
    count(id)
    from cutdown_price_user_record
    where 1=1
    and user_id = #{userId,jdbcType=INTEGER}
  </select>

  <select id="selectCutDownPriceUserRecordByPage" resultMap="BaseResultMap" >
    select
    <include refid="Base_Column_List" />
    from cutdown_price_user_record
    where 1=1
    and user_id = #{userId,jdbcType=INTEGER}
    limit #{start,jdbcType=INTEGER}, #{size,jdbcType=INTEGER}
  </select>

  <select id="selectCutDownPriceUserRecord" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from cutdown_price_user_record
    where activity_id = #{activityId,jdbcType=INTEGER}
    and user_id = #{userId,jdbcType=INTEGER}
    and product_skn = #{productSkn,jdbcType=INTEGER}
  </select>

</mapper>