Commit 3833f30d7862592977808ba683b6609ae835a1d3

Authored by xujiahong
1 parent 6ac0952387
Exists in master

修改分页方式

Showing 3 changed files with 69 additions and 17 deletions

parent/hospital.mac/src/main/java/com/lyms/hospital/service/changehospital/HighriskChangeHospitalService.java View file @ 3833f30
1 1 package com.lyms.hospital.service.changehospital;
2 2  
3 3 import java.io.Serializable;
4   -import java.util.List;
5 4  
  5 +import com.baomidou.mybatisplus.plugins.Page;
6 6 import com.lyms.hospital.entity.changehospital.HighriskChangeHospital;
7 7 import com.lyms.web.service.BaseService;
8 8  
... ... @@ -58,7 +58,7 @@
58 58 * <li>修改人:
59 59 * <li>修改时间:
60 60 */
61   - public List<HighriskChangeHospital> listOfIn(String orgId,Integer pageNo,Integer pageSize);
  61 + public Page<HighriskChangeHospital> pageOfIn(String orgId,Page<HighriskChangeHospital> page);
62 62  
63 63 /**
64 64 * <li>@Description:查询“转出”列表
... ... @@ -69,7 +69,8 @@
69 69 * <li>修改人:
70 70 * <li>修改时间:
71 71 */
72   - public List<HighriskChangeHospital> listOfOut(String orgId,Integer pageNo,Integer pageSize);
  72 + public Page<HighriskChangeHospital> pageOfOut(String orgId,Page<HighriskChangeHospital> page);
  73 +
73 74  
74 75 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/changehospital/impl/HighriskChangeHospitalServiceImpl.java View file @ 3833f30
... ... @@ -58,20 +58,21 @@
58 58 }
59 59  
60 60 @Override
61   - public List<HighriskChangeHospital> listOfIn(String orgId, Integer pageNo, Integer pageSize) {
62   - return this.listOfInOrOut(orgId, "INTO_ORGID",pageNo,pageSize);
  61 + public Page<HighriskChangeHospital> pageOfIn(String orgId, Page<HighriskChangeHospital> page) {
  62 + return this.pageOfInOrOut(orgId, "INTO_ORGID",page);
63 63 }
64 64  
65 65 @Override
66   - public List<HighriskChangeHospital> listOfOut(String orgId, Integer pageNo, Integer pageSize) {
67   - return this.listOfInOrOut(orgId, "OUT_ORGID",pageNo,pageSize);
  66 + public Page<HighriskChangeHospital> pageOfOut(String orgId, Page<HighriskChangeHospital> page) {
  67 + return this.pageOfInOrOut(orgId, "OUT_ORGID",page);
68 68 }
69 69  
70   - private List<HighriskChangeHospital> listOfInOrOut(String orgId, String flag, Integer pageNo, Integer pageSize) {
71   - List<HighriskChangeHospital> list = baseMapper.selectPage(
72   - new Page<HighriskChangeHospital>(pageNo==null?1:pageNo, pageSize==null?10:pageSize),
  70 + private Page<HighriskChangeHospital> pageOfInOrOut(String orgId, String flag, Page<HighriskChangeHospital> page) {
  71 + List<HighriskChangeHospital> list = baseMapper.selectPage(page,
73 72 new EntityWrapper<HighriskChangeHospital>().eq(flag, orgId).orderBy("CREATE_TIME", false));
74   - return list;
  73 + page.setRecords(list);
  74 + return page;
75 75 }
  76 +
76 77 }
parent/hospital.web/src/test/java/test/hospital/service/HighriskChangeHospitalTest.java View file @ 3833f30
1 1 package test.hospital.service;
2 2  
3   -import java.util.List;
4   -
5 3 import org.junit.Test;
6 4 import org.springframework.beans.factory.annotation.Autowired;
7 5  
  6 +import com.baomidou.mybatisplus.plugins.Page;
8 7 import com.lyms.hospital.entity.changehospital.HighriskChangeHospital;
9 8 import com.lyms.hospital.service.changehospital.HighriskChangeHospitalService;
10 9  
... ... @@ -39,10 +38,8 @@
39 38  
40 39 @Test
41 40 public void list(){
42   - List<HighriskChangeHospital> list = service.listOfIn("1", 2, 3);
43   - for(HighriskChangeHospital c : list){
44   - System.out.println(c.getWomanId()+"-"+c.getCreateTime());
45   - }
  41 + Page<HighriskChangeHospital> page = service.pageOfIn("1", new Page<HighriskChangeHospital>(2,3));
  42 + outJson(page);
46 43 /*
47 44 cs033012-Thu Mar 30 15:11:38 CST 2017
48 45 cs033017-Thu Mar 30 15:11:38 CST 2017
49 46  
... ... @@ -54,8 +51,61 @@
54 51 cs033016-Thu Mar 30 15:11:38 CST 2017
55 52 cs033010-Thu Mar 30 15:11:37 CST 2017
56 53 cs033011-Thu Mar 30 15:11:37 CST 2017
  54 +
  55 + {
  56 + "asc": true,
  57 + "condition": {},
  58 + "current": 2,
  59 + "limit": 2147483647,
  60 + "offset": 0,
  61 + "offsetCurrent": 3,
  62 + "optimizeCount": false,
  63 + "pages": 10,
  64 + "records": [
  65 + {
  66 + "applyDoctorid": "doctorID1",
  67 + "changeway": "转院方式",
  68 + "createId": "doctorID1",
  69 + "createTime": 1490857898000,
  70 + "description": "病情描述",
  71 + "id": "7E24B219E8D0417582292C3AFFF8319E",
  72 + "intoOrgid": "1",
  73 + "outOrgid": "2",
  74 + "status": 1,
  75 + "womanId": "cs033018"
  76 + },
  77 + {
  78 + "applyDoctorid": "doctorID1",
  79 + "changeway": "转院方式",
  80 + "createId": "doctorID1",
  81 + "createTime": 1490857898000,
  82 + "description": "病情描述",
  83 + "id": "8C04A1E4D203482D8FEC1381EC4D1F12",
  84 + "intoOrgid": "1",
  85 + "outOrgid": "2",
  86 + "status": 1,
  87 + "womanId": "cs033019"
  88 + },
  89 + {
  90 + "applyDoctorid": "doctorID1",
  91 + "changeway": "转院方式",
  92 + "createId": "doctorID1",
  93 + "createTime": 1490857898000,
  94 + "description": "病情描述",
  95 + "id": "A9573F7251A849B5BCF34B50A3DE12A5",
  96 + "intoOrgid": "1",
  97 + "outOrgid": "2",
  98 + "status": 1,
  99 + "womanId": "cs033013"
  100 + }
  101 + ],
  102 + "searchCount": true,
  103 + "size": 3,
  104 + "total": 30
  105 + }
57 106 */
58 107 }
  108 +
59 109  
60 110 }