【曝光值、曝光类型】 ctr 改成 bigdecimal
Showing
5 changed files
with
16 additions
and
13 deletions
1 | package com.yoho.search.dal.model; | 1 | package com.yoho.search.dal.model; |
2 | 2 | ||
3 | +import java.math.BigDecimal; | ||
4 | + | ||
3 | public class SknCtrValue { | 5 | public class SknCtrValue { |
4 | private Integer productSkn; | 6 | private Integer productSkn; |
5 | 7 | ||
6 | private String dateId; | 8 | private String dateId; |
7 | 9 | ||
8 | - private Integer ctrValue; | 10 | + private BigDecimal ctrValue; |
9 | 11 | ||
10 | private Integer createTime; | 12 | private Integer createTime; |
11 | 13 | ||
@@ -25,11 +27,11 @@ public class SknCtrValue { | @@ -25,11 +27,11 @@ public class SknCtrValue { | ||
25 | this.dateId = dateId == null ? null : dateId.trim(); | 27 | this.dateId = dateId == null ? null : dateId.trim(); |
26 | } | 28 | } |
27 | 29 | ||
28 | - public Integer getCtrValue() { | 30 | + public BigDecimal getCtrValue() { |
29 | return ctrValue; | 31 | return ctrValue; |
30 | } | 32 | } |
31 | 33 | ||
32 | - public void setCtrValue(Integer ctrValue) { | 34 | + public void setCtrValue(BigDecimal ctrValue) { |
33 | this.ctrValue = ctrValue; | 35 | this.ctrValue = ctrValue; |
34 | } | 36 | } |
35 | 37 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.SknCtrValue" > | 4 | <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.SknCtrValue" > |
5 | <id column="product_skn" property="productSkn" jdbcType="INTEGER" /> | 5 | <id column="product_skn" property="productSkn" jdbcType="INTEGER" /> |
6 | <result column="date_id" property="dateId" jdbcType="VARCHAR" /> | 6 | <result column="date_id" property="dateId" jdbcType="VARCHAR" /> |
7 | - <result column="ctr_value" property="ctrValue" jdbcType="INTEGER" /> | 7 | + <result column="ctr_value" property="ctrValue" jdbcType="BigDecimal" /> |
8 | <result column="create_time" property="createTime" jdbcType="INTEGER" /> | 8 | <result column="create_time" property="createTime" jdbcType="INTEGER" /> |
9 | </resultMap> | 9 | </resultMap> |
10 | <sql id="Base_Column_List" > | 10 | <sql id="Base_Column_List" > |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | <insert id="insert" parameterType="com.yoho.search.dal.model.SknCtrValue" > | 23 | <insert id="insert" parameterType="com.yoho.search.dal.model.SknCtrValue" > |
24 | insert into skn_ctr_value (product_skn, date_id, ctr_value, | 24 | insert into skn_ctr_value (product_skn, date_id, ctr_value, |
25 | create_time) | 25 | create_time) |
26 | - values (#{productSkn,jdbcType=INTEGER}, #{dateId,jdbcType=VARCHAR}, #{ctrValue,jdbcType=INTEGER}, | 26 | + values (#{productSkn,jdbcType=INTEGER}, #{dateId,jdbcType=VARCHAR}, #{ctrValue,jdbcType=BigDecimal}, |
27 | #{createTime,jdbcType=INTEGER}) | 27 | #{createTime,jdbcType=INTEGER}) |
28 | </insert> | 28 | </insert> |
29 | <insert id="insertSelective" parameterType="com.yoho.search.dal.model.SknCtrValue" > | 29 | <insert id="insertSelective" parameterType="com.yoho.search.dal.model.SknCtrValue" > |
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | #{dateId,jdbcType=VARCHAR}, | 50 | #{dateId,jdbcType=VARCHAR}, |
51 | </if> | 51 | </if> |
52 | <if test="ctrValue != null" > | 52 | <if test="ctrValue != null" > |
53 | - #{ctrValue,jdbcType=INTEGER}, | 53 | + #{ctrValue,jdbcType=BigDecimal}, |
54 | </if> | 54 | </if> |
55 | <if test="createTime != null" > | 55 | <if test="createTime != null" > |
56 | #{createTime,jdbcType=INTEGER}, | 56 | #{createTime,jdbcType=INTEGER}, |
@@ -64,7 +64,7 @@ | @@ -64,7 +64,7 @@ | ||
64 | date_id = #{dateId,jdbcType=VARCHAR}, | 64 | date_id = #{dateId,jdbcType=VARCHAR}, |
65 | </if> | 65 | </if> |
66 | <if test="ctrValue != null" > | 66 | <if test="ctrValue != null" > |
67 | - ctr_value = #{ctrValue,jdbcType=INTEGER}, | 67 | + ctr_value = #{ctrValue,jdbcType=BigDecimal}, |
68 | </if> | 68 | </if> |
69 | <if test="createTime != null" > | 69 | <if test="createTime != null" > |
70 | create_time = #{createTime,jdbcType=INTEGER}, | 70 | create_time = #{createTime,jdbcType=INTEGER}, |
@@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
75 | <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.SknCtrValue" > | 75 | <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.SknCtrValue" > |
76 | update skn_ctr_value | 76 | update skn_ctr_value |
77 | set date_id = #{dateId,jdbcType=VARCHAR}, | 77 | set date_id = #{dateId,jdbcType=VARCHAR}, |
78 | - ctr_value = #{ctrValue,jdbcType=INTEGER}, | 78 | + ctr_value = #{ctrValue,jdbcType=BigDecimal}, |
79 | create_time = #{createTime,jdbcType=INTEGER} | 79 | create_time = #{createTime,jdbcType=INTEGER} |
80 | where product_skn = #{productSkn,jdbcType=INTEGER} | 80 | where product_skn = #{productSkn,jdbcType=INTEGER} |
81 | </update> | 81 | </update> |
@@ -139,16 +139,16 @@ public class ProductIndexBO extends ProductIBO implements Serializable { | @@ -139,16 +139,16 @@ public class ProductIndexBO extends ProductIBO implements Serializable { | ||
139 | private String specialSearchFieldVideo; | 139 | private String specialSearchFieldVideo; |
140 | 140 | ||
141 | //from ctr_value | 141 | //from ctr_value |
142 | - private Integer ctrValue; | 142 | + private BigDecimal ctrValue; |
143 | 143 | ||
144 | //skn_flow | 144 | //skn_flow |
145 | private Integer flowType; | 145 | private Integer flowType; |
146 | 146 | ||
147 | - public Integer getCtrValue() { | 147 | + public BigDecimal getCtrValue() { |
148 | return ctrValue; | 148 | return ctrValue; |
149 | } | 149 | } |
150 | 150 | ||
151 | - public void setCtrValue(Integer ctrValue) { | 151 | + public void setCtrValue(BigDecimal ctrValue) { |
152 | this.ctrValue = ctrValue; | 152 | this.ctrValue = ctrValue; |
153 | } | 153 | } |
154 | 154 |
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; | @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
11 | 11 | ||
12 | +import java.math.BigDecimal; | ||
12 | import java.util.List; | 13 | import java.util.List; |
13 | import java.util.Map; | 14 | import java.util.Map; |
14 | import java.util.stream.Collectors; | 15 | import java.util.stream.Collectors; |
@@ -32,7 +33,7 @@ public class CtrValueBuilder implements ViewBuilder { | @@ -32,7 +33,7 @@ public class CtrValueBuilder implements ViewBuilder { | ||
32 | if (CollectionUtils.isEmpty(sknCtrValueList)) { | 33 | if (CollectionUtils.isEmpty(sknCtrValueList)) { |
33 | return; | 34 | return; |
34 | } | 35 | } |
35 | - Map<Integer,Integer> ctrValueMap = sknCtrValueList.stream().parallel().collect(Collectors.toMap(SknCtrValue::getProductSkn,SknCtrValue::getCtrValue)); | 36 | + Map<Integer,BigDecimal> ctrValueMap = sknCtrValueList.stream().parallel().collect(Collectors.toMap(SknCtrValue::getProductSkn,SknCtrValue::getCtrValue)); |
36 | productIndexBOs.stream().forEach(p->{ | 37 | productIndexBOs.stream().forEach(p->{ |
37 | if (ctrValueMap.containsKey(p.getProductSkn())) { | 38 | if (ctrValueMap.containsKey(p.getProductSkn())) { |
38 | p.setCtrValue(ctrValueMap.get(p.getProductSkn())); | 39 | p.setCtrValue(ctrValueMap.get(p.getProductSkn())); |
-
Please register or login to post a comment