Browse Source

调整商品查询列表mapper

master
xyiege 4 years ago
parent
commit
c1ac1adede
  1. 9
      conf/db.properties
  2. 2
      src/main/java/cn/chjyj/szwh/SzwhApplication.java
  3. 1
      src/main/java/cn/chjyj/szwh/mapper/GoodsMapper.java
  4. 3
      src/main/resources/application.properties
  5. 6
      src/main/resources/mapper/szwh/GoodsMapper.xml

9
conf/db.properties

@ -1,9 +1,12 @@
# 数据库服务器配置
type=com.alibaba.druid.pool.DruidDataSource
driver-class-name=com.mysql.cj.jdbc.Driver
druid.url=jdbc:mysql://192.168.1.8:3306/szwhtrans?useUnioncode=true&charsetEncoding=UTF-8
druid.username=szwhtrans
druid.password=rRyPkT2XYW6mMRiX
#druid.url=jdbc:mysql://192.168.1.8:3306/szwhtrans?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
druid.url=jdbc:mysql://localhost:3306/szwhtrans?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#druid.username=szwhtrans
#druid.password=rRyPkT2XYW6mMRiX
druid.username=root
druid.password=xc1123
druid.initial-size=10
druid.max-active=100
druid.min-idle=10

2
src/main/java/cn/chjyj/szwh/SzwhApplication.java

@ -1,9 +1,11 @@
package cn.chjyj.szwh;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan("cn.chjyj.szwh.mapper")
public class SzwhApplication {
public static void main(String[] args) {

1
src/main/java/cn/chjyj/szwh/mapper/GoodsMapper.java

@ -1,6 +1,7 @@
package cn.chjyj.szwh.mapper;
import cn.chjyj.szwh.bean.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

3
src/main/resources/application.properties

@ -6,5 +6,4 @@ logging.path=./logs/
server.port=9090
# 服务请求上下文
#server.servlet.context-path=/chapi
spring.flyway.script-placeholder-prefix=
mybatis.mapper-locations=classpath*:/mapper/**/*.xml

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

@ -21,10 +21,10 @@
<!--查询记录列表-->
<select id="getGoodsList" parameterType="java.lang.Integer" resultType="cn.chjyj.szwh.bean.Goods">
select * from
WITH mm as (select * from
<include refid="tbName"/>
order by uid DESC
limit #{pageSize} where id> #{startRs};
where id>#{startRs} limit #{pageSize}
)SELECT * FROM mm ORDER BY id DESC;
</select>
<!--根据uid查询用户-->

Loading…
Cancel
Save