Authored by wangnan9279

ufo_score_product_rule fix

package com.yoho.search.dal;
import com.yoho.search.dal.model.ufo_product.ScoreProductRule;
import com.yoho.search.dal.model.UfoScoreProductRule;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,15 +8,15 @@ import java.util.List;
public interface UfoScoreProductRuleMapper {
int deleteByPrimaryKey(Integer id);
int insert(ScoreProductRule record);
int insert(UfoScoreProductRule record);
int insertSelective(ScoreProductRule record);
int insertSelective(UfoScoreProductRule record);
ScoreProductRule selectByPrimaryKey(Integer id);
UfoScoreProductRule selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ScoreProductRule record);
int updateByPrimaryKeySelective(UfoScoreProductRule record);
int updateByPrimaryKey(ScoreProductRule record);
int updateByPrimaryKey(UfoScoreProductRule record);
List<Integer> selectByIdList(@Param(value = "idList") List<Integer> idList);
}
\ No newline at end of file
... ...
<?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.UfoScoreProductRuleMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoScoreProductRule">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="product_id" property="productId" jdbcType="INTEGER"/>
<result column="update_time" property="updateTime" jdbcType="INTEGER"/>
... ... @@ -13,21 +13,21 @@
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from score_product_rule
from ufo_score_product_rule
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from score_product_rule
delete from ufo_score_product_rule
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
insert into score_product_rule (id, product_id, update_time,
<insert id="insert" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
insert into ufo_score_product_rule (id, product_id, update_time,
create_time)
values (#{id,jdbcType=INTEGER}, #{productId,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER},
#{createTime,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
insert into score_product_rule
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
insert into ufo_score_product_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
... ... @@ -57,8 +57,8 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
update score_product_rule
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
update ufo_score_product_rule
<set>
<if test="productId != null">
product_id = #{productId,jdbcType=INTEGER},
... ... @@ -72,8 +72,8 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
update score_product_rule
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
update ufo_score_product_rule
set product_id = #{productId,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=INTEGER}
... ... @@ -81,7 +81,7 @@
</update>
<select id="selectByIdList" resultType="java.lang.Integer">
select product_id
from score_product_rule
from ufo_score_product_rule
where product_id in
<foreach item="item" collection="idList" open="(" separator="," close=")">
#{item}
... ...
... ... @@ -7,7 +7,7 @@ import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.index.increment.ufo_product.UfoIndexUpdateHelper;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.UfoScoreProductRuleMapper;
import com.yoho.search.dal.model.ufo_product.ScoreProductRule;
import com.yoho.search.dal.model.UfoScoreProductRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -30,7 +30,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener {
@Override
protected void deleteData(String id) throws Exception {
ScoreProductRule scoreProductRule = ufoScoreProductRuleMapper.selectByPrimaryKey(Integer.valueOf(id));
UfoScoreProductRule scoreProductRule = ufoScoreProductRuleMapper.selectByPrimaryKey(Integer.valueOf(id));
ufoScoreProductRuleMapper.deleteByPrimaryKey(Integer.valueOf(id));
if (scoreProductRule != null) {
ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId());
... ... @@ -39,7 +39,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
ScoreProductRule scoreProductRule = ConvertUtils.toJavaObject(ScoreProductRule.class, data);
UfoScoreProductRule scoreProductRule = ConvertUtils.toJavaObject(UfoScoreProductRule.class, data);
if (scoreProductRule == null || scoreProductRule.getId() == null) {
return;
}
... ... @@ -47,7 +47,7 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener {
ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId());
}
private int saveOrUpdate(ScoreProductRule scoreProductRule) {
private int saveOrUpdate(UfoScoreProductRule scoreProductRule) {
if (scoreProductRule.getId() == null || ufoScoreProductRuleMapper.selectByPrimaryKey(scoreProductRule.getId()) == null) {
return ufoScoreProductRuleMapper.insertSelective(scoreProductRule);
} else {
... ...