|
|
<?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.ProductHeatValuesOneDayMapper" >
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ProductHeatValues" >
|
|
|
<id column="product_skn" property="productSkn" jdbcType="INTEGER" />
|
|
|
<result column="date_id" property="dateId" jdbcType="VARCHAR" />
|
|
|
<result column="shareorder_num" property="shareorderNum" jdbcType="DECIMAL" />
|
|
|
<result column="sale_num" property="saleNum" jdbcType="DECIMAL" />
|
|
|
<result column="cart_num" property="cartNum" jdbcType="DECIMAL" />
|
|
|
<result column="favorite_num" property="favoriteNum" jdbcType="DECIMAL" />
|
|
|
<result column="comments_score" property="commentsScore" jdbcType="DECIMAL" />
|
|
|
<result column="ctr_value" property="ctrValue" jdbcType="DECIMAL" />
|
|
|
<result column="sale_amount" property="saleAmount" jdbcType="DECIMAL" />
|
|
|
<result column="profit_amount" property="profitAmount" jdbcType="DECIMAL" />
|
|
|
<result column="last_update_time" property="lastUpdateTime" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List" >
|
|
|
product_skn, date_id, shareorder_num, sale_num, cart_num, favorite_num, comments_score,
|
|
|
ctr_value, sale_amount, profit_amount, last_update_time
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectHeatValuesOfLatestDateBySkn" resultMap="BaseResultMap" timeout="20000">
|
|
|
<![CDATA[
|
|
|
select * from product_heat_values_oneday p
|
|
|
where
|
|
|
date_id = #{dateId}
|
|
|
and
|
|
|
p.product_skn in
|
|
|
]]>
|
|
|
<foreach item="item" index="index" collection="sknList"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectHeatValuesOfLatestDate" resultMap="BaseResultMap" timeout="20000">
|
|
|
select * from product_heat_values_oneday p
|
|
|
where
|
|
|
date_id = #{dateId}
|
|
|
limit #{offset},#{pageSize}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectLatestDateId" resultType="java.lang.Integer">
|
|
|
select max(date_id) from product_heat_values_oneday
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
|
|
|
SELECT count(*) FROM product_heat_values_oneday
|
|
|
where
|
|
|
date_id = #{dateId}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSknByDate" resultType="java.lang.Long" timeout="20000">
|
|
|
SELECT product_skn FROM product_heat_values_oneday where date_id = #{dateId,jdbcType=VARCHAR} limit #{pageSize}
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteBatch">
|
|
|
<![CDATA[
|
|
|
DELETE FROM product_heat_values_oneday
|
|
|
WHERE
|
|
|
date_id = #{dateId,jdbcType=VARCHAR}
|
|
|
AND
|
|
|
]]>
|
|
|
product_skn in
|
|
|
<foreach item="item" index="index" collection="sknList" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|