|
|
<?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.yohoufo.dal.product.PriceTrendMonthMapper" >
|
|
|
<resultMap id="BaseResultMap" type="com.yohoufo.dal.product.model.PriceTrendModel" >
|
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
|
<result column="product_id" property="productId" jdbcType="INTEGER" />
|
|
|
<result column="size_id" property="sizeId" jdbcType="INTEGER" />
|
|
|
<result column="skn_price" property="sknPrice" jdbcType="DECIMAL" />
|
|
|
<result column="sku_price" property="skuPrice" jdbcType="DECIMAL" />
|
|
|
<result column="create_time" property="createTime" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
<mapper namespace="com.yohoufo.dal.product.PriceTrendMonthMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.yohoufo.dal.product.model.PriceTrendModel">
|
|
|
<id column="id" property="id" jdbcType="INTEGER"/>
|
|
|
<result column="product_id" property="productId" jdbcType="INTEGER"/>
|
|
|
<result column="size_id" property="sizeId" jdbcType="INTEGER"/>
|
|
|
<result column="skn_price" property="sknPrice" jdbcType="DECIMAL"/>
|
|
|
<result column="sku_price" property="skuPrice" jdbcType="DECIMAL"/>
|
|
|
<result column="create_time" property="createTime" jdbcType="INTEGER"/>
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, product_id, size_id, skn_price, sku_price, create_time
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectByProductId" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from price_trend_month
|
|
|
where product_id = #{productId, jdbcType=INTEGER}
|
|
|
<if test="sizeId != null and sizeId !=''">
|
|
|
AND size_id = #{sizeId, jdbcType=INTEGER}
|
|
|
</if>
|
|
|
AND create_time >= #{startTime, jdbcType=INTEGER}
|
|
|
AND create_time <= #{endTime, jdbcType=INTEGER}
|
|
|
<if test="sizeId == null or sizeId == ''">
|
|
|
GROUP BY product_id, create_time
|
|
|
</if>
|
|
|
ORDER BY create_time ASC
|
|
|
</select>
|
|
|
<select id="selectByProductId" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
from price_trend_month
|
|
|
where product_id = #{productId, jdbcType=INTEGER}
|
|
|
<if test="sizeId != null and sizeId !=''">
|
|
|
AND size_id = #{sizeId, jdbcType=INTEGER}
|
|
|
</if>
|
|
|
AND create_time >= #{startTime, jdbcType=INTEGER}
|
|
|
AND create_time <= #{endTime, jdbcType=INTEGER}
|
|
|
<if test="sizeId == null or sizeId == ''">
|
|
|
GROUP BY product_id, create_time
|
|
|
</if>
|
|
|
ORDER BY create_time ASC
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByProductIdAndSizeId" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
from price_trend_month
|
|
|
where product_id = #{productId, jdbcType=INTEGER}
|
|
|
and size_id = #{sizeId, jdbcType=INTEGER}
|
|
|
order by create_time asc
|
|
|
limit #{limit}
|
|
|
</select>
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|