Commit de9ea6fd853b6c97cd6534354ed51d4c18036805

Authored by liquanyu
1 parent c039bada20

code update

Showing 2 changed files with 21 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java View file @ de9ea6f
... ... @@ -179,7 +179,9 @@
179 179 @RequestParam(required = false) String syphilis,
180 180 @RequestParam(required = false) String hiv,
181 181 @RequestParam(required = false) String hcv,
182   - @RequestParam(required = false) String doctorNo
  182 + @RequestParam(required = false) String doctorNo,
  183 + @RequestParam(required = false) Integer page,
  184 + @RequestParam(required = false) Integer limit
183 185 ){
184 186 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
185 187 BaseObjectResponse objectResponse = bookbuildingFacade.queryChanJianReport(loginState.getId(),
... ... @@ -195,7 +197,10 @@
195 197 syphilis,
196 198 hiv,
197 199 hcv,
198   - doctorNo
  200 + doctorNo,
  201 + page,
  202 + limit
  203 +
199 204 );
200 205 return objectResponse;
201 206 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ de9ea6f
... ... @@ -1061,10 +1061,21 @@
1061 1061 String syphilis,
1062 1062 String hiv,
1063 1063 String hcv,
1064   - String doctorNo) {
  1064 + String doctorNo,
  1065 + Integer page,
  1066 + Integer limit) {
1065 1067  
1066 1068 String hospitalId = autoMatchFacade.getHospitalId(userId);
1067   - String sql = "SELECT A.EXAMINE_DATE,\n" +
  1069 +
  1070 + int start = 0;
  1071 + int end = 1000;
  1072 + if (page != null && limit != null)
  1073 + {
  1074 + start = (page -1) * limit+1;
  1075 + end = page*limit;
  1076 + }
  1077 +
  1078 + String sql = "SELECT * FROM ( SELECT A.*, ROWNUM RN FROM ( SELECT A.EXAMINE_DATE,\n" +
1068 1079 " A.NAME,\n" +
1069 1080 " A.AGE,\n" +
1070 1081 " A.NOW_WEEKS,\n" +
... ... @@ -1161,6 +1172,7 @@
1161 1172 {
1162 1173 sql += " AND A.DOCTOR_NO = "+doctorNo;
1163 1174 }
  1175 + sql+=" ) A WHERE ROWNUM <= "+end+" ) WHERE RN >= "+start;
1164 1176  
1165 1177 List<Map<String,Object>> list = JdbcUtil.getListDataBySql(sql);
1166 1178 BaseObjectResponse objectResponse = new BaseObjectResponse();