Authored by Gino Zhang

修改增量API的方法

1 package com.yoho.search.consumer.service.base; 1 package com.yoho.search.consumer.service.base;
2 2
3 import com.yoho.search.dal.SuggestConversionCustomMapper; 3 import com.yoho.search.dal.SuggestConversionCustomMapper;
4 -import com.yoho.search.dal.model.SuggestConversion;  
5 import com.yoho.search.dal.model.SuggestConversionCustom; 4 import com.yoho.search.dal.model.SuggestConversionCustom;
6 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.stereotype.Component; 6 import org.springframework.stereotype.Component;
@@ -44,4 +43,12 @@ public class SuggestConversionCustomService { @@ -44,4 +43,12 @@ public class SuggestConversionCustomService {
44 public void delete(Integer id) { 43 public void delete(Integer id) {
45 suggestConversionCustomMapper.deleteByPrimaryKey(id); 44 suggestConversionCustomMapper.deleteByPrimaryKey(id);
46 } 45 }
  46 +
  47 + public int insertSelective(SuggestConversionCustom record){
  48 + return suggestConversionCustomMapper.insertSelective(record);
  49 + }
  50 +
  51 + public int updateByPrimaryKeySelective(SuggestConversionCustom record){
  52 + return suggestConversionCustomMapper.updateByPrimaryKeySelective(record);
  53 + }
47 } 54 }
@@ -64,12 +64,12 @@ public class SuggestConvertorService { @@ -64,12 +64,12 @@ public class SuggestConvertorService {
64 suggestConversion.setDest(dest); 64 suggestConversion.setDest(dest);
65 suggestConversion.setUpdateTime(DateUtil.getCurrentTimeSecond()); 65 suggestConversion.setUpdateTime(DateUtil.getCurrentTimeSecond());
66 suggestConversion.setStatus(1); 66 suggestConversion.setStatus(1);
67 - suggestConversionService.insertBatch(Arrays.asList(suggestConversion)); 67 + suggestConversionCustomService.insertSelective(suggestConversion);
68 } else { 68 } else {
69 suggestConversion.setDest(dest); 69 suggestConversion.setDest(dest);
70 suggestConversion.setUpdateTime(DateUtil.getCurrentTimeSecond()); 70 suggestConversion.setUpdateTime(DateUtil.getCurrentTimeSecond());
71 suggestConversion.setStatus(1); 71 suggestConversion.setStatus(1);
72 - suggestConversionService.updateByPrimaryKey(suggestConversion); 72 + suggestConversionCustomService.updateByPrimaryKeySelective(suggestConversion);
73 } 73 }
74 } 74 }
75 75