Authored by hugufei

fix bug

... ... @@ -12,8 +12,6 @@ public interface GoodsMapper {
Goods selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Goods record);
int updateByPrimaryKey(Goods record);
List<Goods> selectPageLists(@Param(value="offset")Integer offset, @Param(value="pageSize")Integer pageSize);
... ...
... ... @@ -49,9 +49,9 @@ if [ $PRODUCTION_MODE = "PRODUCT" ]; then
if [ -n "$str" ]; then
let memTotal=`cat /proc/meminfo |grep MemTotal|awk '{printf "%d", $2/1024 }'`
if [ $memTotal -gt 10000 ];then
JAVA_MEM_OPTS=" -server -Xmx4000M -Xms1000M -Xmn400M -XX:PermSize=200M -XX:MaxPermSize=200M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/logs/heapdump.hprof "
else
JAVA_MEM_OPTS=" -server -Xmx2500M -Xms2500M -Xmn400M -XX:PermSize=200M -XX:MaxPermSize=200M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/logs/heapdump.hprof "
JAVA_MEM_OPTS=" -server -Xmx4000M -Xms4000M -Xmn1024M -XX:PermSize=200M -XX:MaxPermSize=400M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/.tomcat/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/.tomcat/logs/heapdump.hprof "
else
JAVA_MEM_OPTS=" -server -Xmx3000M -Xms3000M -Xmn1024M -XX:PermSize=200M -XX:MaxPermSize=400M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/.tomcat/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/.tomcat/logs/heapdump.hprof "
fi
else
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
... ...
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);
}
}
... ...