CutDownPriceProductMapper.xml 1.69 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.CutDownPriceProductMapper">
  <resultMap id="BaseResultMap" type="com.yoho.activity.dal.model.CutDownPriceProduct">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="activity_id" property="activityId" jdbcType="INTEGER"  />
    <result column="product_skn" property="productSkn" jdbcType="INTEGER"  />
    <result column="high_price" property="highPrice" jdbcType="DECIMAL"  />
    <result column="low_price" property="lowPrice" jdbcType="DECIMAL"  />
    <result column="join_num" property="joinNum" jdbcType="INTEGER"  />
    <result column="create_time" property="createTime" jdbcType="INTEGER"  />
    <result column="update_time" property="updateTime" jdbcType="INTEGER"  />
  </resultMap>

  <sql id="Base_Column_List" >
    id, activity_id, product_skn, high_price, low_price, join_num, create_time, update_time
  </sql>

  <select id="selectCutDownPriceProduct" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from cutdown_price_product
    where activity_id = #{activityId,jdbcType=INTEGER}
    AND product_skn = #{productSkn,jdbcType=INTEGER}
  </select>

  <select id="selectCutDownPriceProductList" resultMap="BaseResultMap" parameterType="java.util.List">
    select
    <include refid="Base_Column_List" />
    from cutdown_price_product
    where
    <foreach collection="list" item="item" index="index" separator="OR">
      (activity_id=#{item.activityId,jdbcType=INTEGER} and product_skn=#{item.productSkn,jdbcType=INTEGER})
    </foreach>
  </select>
</mapper>