正在显示
5 个修改的文件
包含
26 行增加
和
7 行删除
@@ -23,8 +23,9 @@ public class PayOrderController { | @@ -23,8 +23,9 @@ public class PayOrderController { | ||
23 | 23 | ||
24 | @ApiOperation(value = "查询缴费订单") | 24 | @ApiOperation(value = "查询缴费订单") |
25 | @RequestMapping("/list") | 25 | @RequestMapping("/list") |
26 | - public ResultJson<PageInfo> getOrder(){ | ||
27 | - return new ResultJson("200","wokao"); | 26 | + public PageInfo<PayRecords> getOrder(@RequestParam(value = "pageSize", required = false, defaultValue = "1") int pageSize, |
27 | + @RequestParam(value = "pageNum", required = false, defaultValue = "5") int pageNum){ | ||
28 | + return payOrderService.getOrder(pageSize, pageNum); | ||
28 | } | 29 | } |
29 | 30 | ||
30 | 31 |
@@ -2,6 +2,8 @@ package com.sunyo.energy.location.dao; | @@ -2,6 +2,8 @@ package com.sunyo.energy.location.dao; | ||
2 | 2 | ||
3 | import com.sunyo.energy.location.model.PayRecords; | 3 | import com.sunyo.energy.location.model.PayRecords; |
4 | 4 | ||
5 | +import java.util.List; | ||
6 | + | ||
5 | public interface PayRecordsMapper { | 7 | public interface PayRecordsMapper { |
6 | int deleteByPrimaryKey(Integer id); | 8 | int deleteByPrimaryKey(Integer id); |
7 | 9 | ||
@@ -14,4 +16,6 @@ public interface PayRecordsMapper { | @@ -14,4 +16,6 @@ public interface PayRecordsMapper { | ||
14 | int updateByPrimaryKeySelective(PayRecords record); | 16 | int updateByPrimaryKeySelective(PayRecords record); |
15 | 17 | ||
16 | int updateByPrimaryKey(PayRecords record); | 18 | int updateByPrimaryKey(PayRecords record); |
19 | + | ||
20 | + List<PayRecords> findAll(); | ||
17 | } | 21 | } |
@@ -7,8 +7,11 @@ import com.sunyo.energy.location.model.PayRecords; | @@ -7,8 +7,11 @@ import com.sunyo.energy.location.model.PayRecords; | ||
7 | * Created by XYH on 2019/12/16. | 7 | * Created by XYH on 2019/12/16. |
8 | */ | 8 | */ |
9 | public interface PayOrderService { | 9 | public interface PayOrderService { |
10 | - PageInfo<PayRecords> getOrder(PayRecords payRecords, int currentPage, int pageSize); | 10 | + PageInfo<PayRecords> getOrder(int pageSize, int pageNum); |
11 | + | ||
11 | int addOrder(PayRecords payRecords); | 12 | int addOrder(PayRecords payRecords); |
13 | + | ||
12 | int ediOrder(PayRecords payRecords); | 14 | int ediOrder(PayRecords payRecords); |
15 | + | ||
13 | int delOrder(PayRecords payRecords); | 16 | int delOrder(PayRecords payRecords); |
14 | } | 17 | } |
1 | package com.sunyo.energy.location.service.imp; | 1 | package com.sunyo.energy.location.service.imp; |
2 | 2 | ||
3 | +import com.github.pagehelper.Page; | ||
4 | +import com.github.pagehelper.PageHelper; | ||
3 | import com.github.pagehelper.PageInfo; | 5 | import com.github.pagehelper.PageInfo; |
4 | import com.sunyo.energy.location.dao.PayRecordsMapper; | 6 | import com.sunyo.energy.location.dao.PayRecordsMapper; |
5 | import com.sunyo.energy.location.model.PayRecords; | 7 | import com.sunyo.energy.location.model.PayRecords; |
@@ -7,6 +9,8 @@ import com.sunyo.energy.location.service.PayOrderService; | @@ -7,6 +9,8 @@ import com.sunyo.energy.location.service.PayOrderService; | ||
7 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
8 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
9 | 11 | ||
12 | +import java.util.List; | ||
13 | + | ||
10 | /** | 14 | /** |
11 | * Created by XYH on 2019/12/16. | 15 | * Created by XYH on 2019/12/16. |
12 | */ | 16 | */ |
@@ -14,9 +18,16 @@ import org.springframework.stereotype.Service; | @@ -14,9 +18,16 @@ import org.springframework.stereotype.Service; | ||
14 | public class PayOrderImpl implements PayOrderService { | 18 | public class PayOrderImpl implements PayOrderService { |
15 | @Autowired | 19 | @Autowired |
16 | PayRecordsMapper recordsMapper; | 20 | PayRecordsMapper recordsMapper; |
21 | + | ||
22 | + | ||
17 | @Override | 23 | @Override |
18 | - public PageInfo<PayRecords> getOrder(PayRecords payRecords, int currentPage, int pageSize) { | ||
19 | - return null; | 24 | + public PageInfo<PayRecords> getOrder(int pageSize, int pageNum) { |
25 | + | ||
26 | + Page<PayRecords> page = PageHelper.startPage(pageNum,pageSize); | ||
27 | + List<PayRecords> list = recordsMapper.findAll(); | ||
28 | + | ||
29 | + PageInfo<PayRecords> result = new PageInfo<>(list); | ||
30 | + return result; | ||
20 | } | 31 | } |
21 | 32 | ||
22 | @Override | 33 | @Override |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> |
5 | <generatorConfiguration> | 5 | <generatorConfiguration> |
6 | <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包--> | 6 | <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包--> |
7 | - <classPathEntry location="/Users/mrz/Downloads/mybatis-generator-core-1.3.2/lib/mysql-connector-java-5.1.25-bin.jar"/> | 7 | + <classPathEntry location="/Users/shenhailong/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar"/> |
8 | <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>--> | 8 | <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>--> |
9 | <context id="DB2Tables" targetRuntime="MyBatis3"> | 9 | <context id="DB2Tables" targetRuntime="MyBatis3"> |
10 | <commentGenerator> | 10 | <commentGenerator> |
@@ -45,6 +45,6 @@ | @@ -45,6 +45,6 @@ | ||
45 | <property name="enableSubPackages" value="true"/> | 45 | <property name="enableSubPackages" value="true"/> |
46 | </javaClientGenerator> | 46 | </javaClientGenerator> |
47 | <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> | 47 | <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> |
48 | - <table tableName="location" domainObjectName="Location" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> | 48 | + <table tableName="pay_records" domainObjectName="PayRecords" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="true"></table> |
49 | </context> | 49 | </context> |
50 | </generatorConfiguration> | 50 | </generatorConfiguration> |
-
请 注册 或 登录 后发表评论