ufo_score_product_rule fix
Showing
3 changed files
with
22 additions
and
22 deletions
1 | package com.yoho.search.dal; | 1 | package com.yoho.search.dal; |
2 | 2 | ||
3 | -import com.yoho.search.dal.model.ufo_product.ScoreProductRule; | 3 | +import com.yoho.search.dal.model.UfoScoreProductRule; |
4 | import org.apache.ibatis.annotations.Param; | 4 | import org.apache.ibatis.annotations.Param; |
5 | 5 | ||
6 | import java.util.List; | 6 | import java.util.List; |
@@ -8,15 +8,15 @@ import java.util.List; | @@ -8,15 +8,15 @@ import java.util.List; | ||
8 | public interface UfoScoreProductRuleMapper { | 8 | public interface UfoScoreProductRuleMapper { |
9 | int deleteByPrimaryKey(Integer id); | 9 | int deleteByPrimaryKey(Integer id); |
10 | 10 | ||
11 | - int insert(ScoreProductRule record); | 11 | + int insert(UfoScoreProductRule record); |
12 | 12 | ||
13 | - int insertSelective(ScoreProductRule record); | 13 | + int insertSelective(UfoScoreProductRule record); |
14 | 14 | ||
15 | - ScoreProductRule selectByPrimaryKey(Integer id); | 15 | + UfoScoreProductRule selectByPrimaryKey(Integer id); |
16 | 16 | ||
17 | - int updateByPrimaryKeySelective(ScoreProductRule record); | 17 | + int updateByPrimaryKeySelective(UfoScoreProductRule record); |
18 | 18 | ||
19 | - int updateByPrimaryKey(ScoreProductRule record); | 19 | + int updateByPrimaryKey(UfoScoreProductRule record); |
20 | 20 | ||
21 | List<Integer> selectByIdList(@Param(value = "idList") List<Integer> idList); | 21 | List<Integer> selectByIdList(@Param(value = "idList") List<Integer> idList); |
22 | } | 22 | } |
1 | <?xml version="1.0" encoding="UTF-8" ?> | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
3 | <mapper namespace="com.yoho.search.dal.UfoScoreProductRuleMapper"> | 3 | <mapper namespace="com.yoho.search.dal.UfoScoreProductRuleMapper"> |
4 | - <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ScoreProductRule"> | 4 | + <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoScoreProductRule"> |
5 | <id column="id" property="id" jdbcType="INTEGER"/> | 5 | <id column="id" property="id" jdbcType="INTEGER"/> |
6 | <result column="product_id" property="productId" jdbcType="INTEGER"/> | 6 | <result column="product_id" property="productId" jdbcType="INTEGER"/> |
7 | <result column="update_time" property="updateTime" jdbcType="INTEGER"/> | 7 | <result column="update_time" property="updateTime" jdbcType="INTEGER"/> |
@@ -13,21 +13,21 @@ | @@ -13,21 +13,21 @@ | ||
13 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> | 13 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> |
14 | select | 14 | select |
15 | <include refid="Base_Column_List"/> | 15 | <include refid="Base_Column_List"/> |
16 | - from score_product_rule | 16 | + from ufo_score_product_rule |
17 | where id = #{id,jdbcType=INTEGER} | 17 | where id = #{id,jdbcType=INTEGER} |
18 | </select> | 18 | </select> |
19 | <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | 19 | <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> |
20 | - delete from score_product_rule | 20 | + delete from ufo_score_product_rule |
21 | where id = #{id,jdbcType=INTEGER} | 21 | where id = #{id,jdbcType=INTEGER} |
22 | </delete> | 22 | </delete> |
23 | - <insert id="insert" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule"> | ||
24 | - insert into score_product_rule (id, product_id, update_time, | 23 | + <insert id="insert" parameterType="com.yoho.search.dal.model.UfoScoreProductRule"> |
24 | + insert into ufo_score_product_rule (id, product_id, update_time, | ||
25 | create_time) | 25 | create_time) |
26 | values (#{id,jdbcType=INTEGER}, #{productId,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, | 26 | values (#{id,jdbcType=INTEGER}, #{productId,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, |
27 | #{createTime,jdbcType=INTEGER}) | 27 | #{createTime,jdbcType=INTEGER}) |
28 | </insert> | 28 | </insert> |
29 | - <insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule"> | ||
30 | - insert into score_product_rule | 29 | + <insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoScoreProductRule"> |
30 | + insert into ufo_score_product_rule | ||
31 | <trim prefix="(" suffix=")" suffixOverrides=","> | 31 | <trim prefix="(" suffix=")" suffixOverrides=","> |
32 | <if test="id != null"> | 32 | <if test="id != null"> |
33 | id, | 33 | id, |
@@ -57,8 +57,8 @@ | @@ -57,8 +57,8 @@ | ||
57 | </if> | 57 | </if> |
58 | </trim> | 58 | </trim> |
59 | </insert> | 59 | </insert> |
60 | - <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule"> | ||
61 | - update score_product_rule | 60 | + <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoScoreProductRule"> |
61 | + update ufo_score_product_rule | ||
62 | <set> | 62 | <set> |
63 | <if test="productId != null"> | 63 | <if test="productId != null"> |
64 | product_id = #{productId,jdbcType=INTEGER}, | 64 | product_id = #{productId,jdbcType=INTEGER}, |
@@ -72,8 +72,8 @@ | @@ -72,8 +72,8 @@ | ||
72 | </set> | 72 | </set> |
73 | where id = #{id,jdbcType=INTEGER} | 73 | where id = #{id,jdbcType=INTEGER} |
74 | </update> | 74 | </update> |
75 | - <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule"> | ||
76 | - update score_product_rule | 75 | + <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.UfoScoreProductRule"> |
76 | + update ufo_score_product_rule | ||
77 | set product_id = #{productId,jdbcType=INTEGER}, | 77 | set product_id = #{productId,jdbcType=INTEGER}, |
78 | update_time = #{updateTime,jdbcType=INTEGER}, | 78 | update_time = #{updateTime,jdbcType=INTEGER}, |
79 | create_time = #{createTime,jdbcType=INTEGER} | 79 | create_time = #{createTime,jdbcType=INTEGER} |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | </update> | 81 | </update> |
82 | <select id="selectByIdList" resultType="java.lang.Integer"> | 82 | <select id="selectByIdList" resultType="java.lang.Integer"> |
83 | select product_id | 83 | select product_id |
84 | - from score_product_rule | 84 | + from ufo_score_product_rule |
85 | where product_id in | 85 | where product_id in |
86 | <foreach item="item" collection="idList" open="(" separator="," close=")"> | 86 | <foreach item="item" collection="idList" open="(" separator="," close=")"> |
87 | #{item} | 87 | #{item} |
@@ -7,7 +7,7 @@ import com.yoho.search.consumer.index.increment.AbstractMqListener; | @@ -7,7 +7,7 @@ import com.yoho.search.consumer.index.increment.AbstractMqListener; | ||
7 | import com.yoho.search.consumer.index.increment.ufo_product.UfoIndexUpdateHelper; | 7 | import com.yoho.search.consumer.index.increment.ufo_product.UfoIndexUpdateHelper; |
8 | import com.yoho.search.core.message.beans.SearchMqConsumerListerner; | 8 | import com.yoho.search.core.message.beans.SearchMqConsumerListerner; |
9 | import com.yoho.search.dal.UfoScoreProductRuleMapper; | 9 | import com.yoho.search.dal.UfoScoreProductRuleMapper; |
10 | -import com.yoho.search.dal.model.ufo_product.ScoreProductRule; | 10 | +import com.yoho.search.dal.model.UfoScoreProductRule; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.stereotype.Component; | 12 | import org.springframework.stereotype.Component; |
13 | 13 | ||
@@ -30,7 +30,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener { | @@ -30,7 +30,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener { | ||
30 | 30 | ||
31 | @Override | 31 | @Override |
32 | protected void deleteData(String id) throws Exception { | 32 | protected void deleteData(String id) throws Exception { |
33 | - ScoreProductRule scoreProductRule = ufoScoreProductRuleMapper.selectByPrimaryKey(Integer.valueOf(id)); | 33 | + UfoScoreProductRule scoreProductRule = ufoScoreProductRuleMapper.selectByPrimaryKey(Integer.valueOf(id)); |
34 | ufoScoreProductRuleMapper.deleteByPrimaryKey(Integer.valueOf(id)); | 34 | ufoScoreProductRuleMapper.deleteByPrimaryKey(Integer.valueOf(id)); |
35 | if (scoreProductRule != null) { | 35 | if (scoreProductRule != null) { |
36 | ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId()); | 36 | ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId()); |
@@ -39,7 +39,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener { | @@ -39,7 +39,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener { | ||
39 | 39 | ||
40 | @Override | 40 | @Override |
41 | protected void updateData(JSONObject data) throws Exception { | 41 | protected void updateData(JSONObject data) throws Exception { |
42 | - ScoreProductRule scoreProductRule = ConvertUtils.toJavaObject(ScoreProductRule.class, data); | 42 | + UfoScoreProductRule scoreProductRule = ConvertUtils.toJavaObject(UfoScoreProductRule.class, data); |
43 | if (scoreProductRule == null || scoreProductRule.getId() == null) { | 43 | if (scoreProductRule == null || scoreProductRule.getId() == null) { |
44 | return; | 44 | return; |
45 | } | 45 | } |
@@ -47,7 +47,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener { | @@ -47,7 +47,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener { | ||
47 | ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId()); | 47 | ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId()); |
48 | } | 48 | } |
49 | 49 | ||
50 | - private int saveOrUpdate(ScoreProductRule scoreProductRule) { | 50 | + private int saveOrUpdate(UfoScoreProductRule scoreProductRule) { |
51 | if (scoreProductRule.getId() == null || ufoScoreProductRuleMapper.selectByPrimaryKey(scoreProductRule.getId()) == null) { | 51 | if (scoreProductRule.getId() == null || ufoScoreProductRuleMapper.selectByPrimaryKey(scoreProductRule.getId()) == null) { |
52 | return ufoScoreProductRuleMapper.insertSelective(scoreProductRule); | 52 | return ufoScoreProductRuleMapper.insertSelective(scoreProductRule); |
53 | } else { | 53 | } else { |
-
Please register or login to post a comment