Browse Source

优化代码

master
xyiege 4 years ago
parent
commit
ef0b24adce
  1. 5
      src/main/java/cn/chjyj/szwh/controller/admin/AdminGoodsController.java
  2. 2
      src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java
  3. 6
      src/main/resources/application.properties
  4. 2
      src/main/resources/mapper/szwh/GoodsMapper.xml

5
src/main/java/cn/chjyj/szwh/controller/admin/AdminGoodsController.java

@ -1,11 +1,6 @@
package cn.chjyj.szwh.controller.admin;
import cn.chjyj.szwh.bean.Goods;
import cn.chjyj.szwh.bean.GoodsDetail;
import cn.chjyj.szwh.bean.GoodsSource;
import cn.chjyj.szwh.bean.User;
import cn.chjyj.szwh.controller.BaseController;
import cn.chjyj.szwh.exception.ChException;
import cn.chjyj.szwh.service.GoodsDetailService;
import cn.chjyj.szwh.service.GoodsService;
import cn.chjyj.szwh.service.GoodsSourceService;

2
src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java

@ -100,7 +100,7 @@ public class GoodsServiceImpl implements GoodsService {
//推荐,just 8
if(type==3){
limit=8;
order="recommend_sort ";
order="recommend_sort";
where+= "and is_recommend=1";
}

6
src/main/resources/application.properties

@ -52,7 +52,8 @@ org.quartz.jobStore.misfireThreshold=60000
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
# 输出mybatis sql语句
#mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#是否启用StatFilter默认值true
spring.datasource.druid.web-stat-filter.enabled= true
@ -60,6 +61,9 @@ spring.datasource.druid.web-stat-filter.enabled= true
spring.datasource.druid.web-stat-filter.url-pattern=/*
#忽略过滤的格式
spring.datasource.druid.web-stat-filter.exclusions=*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
# 过滤器
spring.datasource.druid.web
#是否启用StatViewServlet默认值true
spring.datasource.druid.stat-view-servlet.enabled= true
# 链接时间

2
src/main/resources/mapper/szwh/GoodsMapper.xml

@ -83,7 +83,7 @@
</if>
</where>
<if test="orderkey!=null">
ORDER BY #{orderkey} #{orderval}
ORDER BY concat(#{orderkey},#{orderval})
</if>
limit #{startrs},#{limit}
</select>

Loading…
Cancel
Save