作者 shenhailong

订单

... ... @@ -23,8 +23,9 @@ public class PayOrderController {
@ApiOperation(value = "查询缴费订单")
@RequestMapping("/list")
public ResultJson<PageInfo> getOrder(){
return new ResultJson("200","wokao");
public PageInfo<PayRecords> getOrder(@RequestParam(value = "pageSize", required = false, defaultValue = "1") int pageSize,
@RequestParam(value = "pageNum", required = false, defaultValue = "5") int pageNum){
return payOrderService.getOrder(pageSize, pageNum);
}
... ...
... ... @@ -2,6 +2,8 @@ package com.sunyo.energy.location.dao;
import com.sunyo.energy.location.model.PayRecords;
import java.util.List;
public interface PayRecordsMapper {
int deleteByPrimaryKey(Integer id);
... ... @@ -14,4 +16,6 @@ public interface PayRecordsMapper {
int updateByPrimaryKeySelective(PayRecords record);
int updateByPrimaryKey(PayRecords record);
List<PayRecords> findAll();
}
\ No newline at end of file
... ...
... ... @@ -7,8 +7,11 @@ import com.sunyo.energy.location.model.PayRecords;
* Created by XYH on 2019/12/16.
*/
public interface PayOrderService {
PageInfo<PayRecords> getOrder(PayRecords payRecords, int currentPage, int pageSize);
PageInfo<PayRecords> getOrder(int pageSize, int pageNum);
int addOrder(PayRecords payRecords);
int ediOrder(PayRecords payRecords);
int delOrder(PayRecords payRecords);
}
... ...
package com.sunyo.energy.location.service.imp;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.dao.PayRecordsMapper;
import com.sunyo.energy.location.model.PayRecords;
... ... @@ -7,6 +9,8 @@ import com.sunyo.energy.location.service.PayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by XYH on 2019/12/16.
*/
... ... @@ -14,9 +18,16 @@ import org.springframework.stereotype.Service;
public class PayOrderImpl implements PayOrderService {
@Autowired
PayRecordsMapper recordsMapper;
@Override
public PageInfo<PayRecords> getOrder(PayRecords payRecords, int currentPage, int pageSize) {
return null;
public PageInfo<PayRecords> getOrder(int pageSize, int pageNum) {
Page<PayRecords> page = PageHelper.startPage(pageNum,pageSize);
List<PayRecords> list = recordsMapper.findAll();
PageInfo<PayRecords> result = new PageInfo<>(list);
return result;
}
@Override
... ...
... ... @@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
<classPathEntry location="/Users/mrz/Downloads/mybatis-generator-core-1.3.2/lib/mysql-connector-java-5.1.25-bin.jar"/>
<classPathEntry location="/Users/shenhailong/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar"/>
<!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
... ... @@ -45,6 +45,6 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="location" domainObjectName="Location" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="pay_records" domainObjectName="PayRecords" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="true"></table>
</context>
</generatorConfiguration>
\ No newline at end of file
... ...