|
|
package com.yoho.search.consumer.service.daoService;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.search.consumer.service.bo.ProductGoodsBO;
|
|
|
import com.yoho.search.consumer.service.logicService.ProductGoodsLogicService;
|
|
|
import com.yoho.search.dal.GoodsMapper;
|
|
|
import com.yoho.search.dal.model.Goods;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Component
|
|
|
public class GoodsService {
|
...
|
...
|
@@ -30,14 +29,14 @@ public class GoodsService { |
|
|
}
|
|
|
|
|
|
public int update(Goods goods) {
|
|
|
return goodsMapper.updateByPrimaryKeySelective(goods);
|
|
|
return goodsMapper.updateByPrimaryKey(goods);
|
|
|
}
|
|
|
|
|
|
public int saveOrUpdate(Goods goods) {
|
|
|
if (goods.getId() == null || goodsMapper.selectByPrimaryKey(goods.getId()) == null) {
|
|
|
return goodsMapper.insert(goods);
|
|
|
} else {
|
|
|
return goodsMapper.updateByPrimaryKeySelective(goods);
|
|
|
return goodsMapper.updateByPrimaryKey(goods);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|