Commit e7af0dc8c77e992ceb7fb1afbdf86ab0f6913e23
1 parent
8ed1f00429
Exists in
master
and in
1 other branch
add data import :机构、部门、用户(医生)
Showing 9 changed files with 317 additions and 53 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-data-api/src/main/java/com/lyms/platform/data/controller/TaskController.java
- platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java
- platform-data-api/src/main/webapp/WEB-INF/vm/task/index.vm
- platform-mommyData/src/main/java/com/lymsh/mommybaby/earlydata/dao/PlatMapper.java
- platform-mommyData/src/main/java/com/lymsh/mommybaby/earlydata/service/PlatService.java
- platform-mommyData/src/main/java/com/lymsh/mommybaby/earlydata/service/impl/PlatServiceImpl.java
- platform-mommyData/src/main/resources/earlyOrm/Plat.xml
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
e7af0dc
| ... | ... | @@ -44,6 +44,16 @@ |
| 44 | 44 | return iPatientDao.queryPatient(query.addOrder(Sort.Direction.DESC, "id")); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | + public int queryPatientCount(PatientsQuery patientsQuery) { | |
| 48 | + return iPatientDao.queryPatientCount(patientsQuery.convertToQuery()); | |
| 49 | + } | |
| 50 | + | |
| 51 | + public int queryPatientCount(String _id) { | |
| 52 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 53 | + patientsQuery.setId(_id); | |
| 54 | + return iPatientDao.queryPatientCount(patientsQuery.convertToQuery()); | |
| 55 | + } | |
| 56 | + | |
| 47 | 57 | /** |
| 48 | 58 | * 根据身份证号码查询某一个患者 |
| 49 | 59 | * |
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
e7af0dc
| ... | ... | @@ -61,6 +61,86 @@ |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | + * 产后休养地 | |
| 65 | + */ | |
| 66 | + private String addressPostRest; | |
| 67 | + private String provincePostRestId; | |
| 68 | + private String cityPostRestId; | |
| 69 | + private String areaPostRestId; | |
| 70 | + | |
| 71 | + public String getAddressPostRest() { | |
| 72 | + return addressPostRest; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setAddressPostRest(String addressPostRest) { | |
| 76 | + this.addressPostRest = addressPostRest; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getProvincePostRestId() { | |
| 80 | + return provincePostRestId; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setProvincePostRestId(String provincePostRestId) { | |
| 84 | + this.provincePostRestId = provincePostRestId; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getCityPostRestId() { | |
| 88 | + return cityPostRestId; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setCityPostRestId(String cityPostRestId) { | |
| 92 | + this.cityPostRestId = cityPostRestId; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public String getAreaPostRestId() { | |
| 96 | + return areaPostRestId; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setAreaPostRestId(String areaPostRestId) { | |
| 100 | + this.areaPostRestId = areaPostRestId; | |
| 101 | + } | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 户籍 | |
| 105 | + */ | |
| 106 | + private String addressRegister; | |
| 107 | + private String provinceRegisterId; | |
| 108 | + private String cityRegisterId; | |
| 109 | + private String areaRegisterId; | |
| 110 | + | |
| 111 | + public String getAddressRegister() { | |
| 112 | + return addressRegister; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setAddressRegister(String addressRegister) { | |
| 116 | + this.addressRegister = addressRegister; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public String getProvinceRegisterId() { | |
| 120 | + return provinceRegisterId; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setProvinceRegisterId(String provinceRegisterId) { | |
| 124 | + this.provinceRegisterId = provinceRegisterId; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public String getCityRegisterId() { | |
| 128 | + return cityRegisterId; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void setCityRegisterId(String cityRegisterId) { | |
| 132 | + this.cityRegisterId = cityRegisterId; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public String getAreaRegisterId() { | |
| 136 | + return areaRegisterId; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setAreaRegisterId(String areaRegisterId) { | |
| 140 | + this.areaRegisterId = areaRegisterId; | |
| 141 | + } | |
| 142 | + | |
| 143 | + /** | |
| 64 | 144 | * 社区id |
| 65 | 145 | */ |
| 66 | 146 | private String communityId; |
| ... | ... | @@ -120,6 +200,42 @@ |
| 120 | 200 | private Integer serviceType; |
| 121 | 201 | private Integer vip; |
| 122 | 202 | private String lastReportDoctorName; |
| 203 | + private String mommyPatientId; | |
| 204 | + private String husbandName; | |
| 205 | + private String husbandPhone; | |
| 206 | + private String vcCardNo; | |
| 207 | + | |
| 208 | + public String getVcCardNo() { | |
| 209 | + return vcCardNo; | |
| 210 | + } | |
| 211 | + | |
| 212 | + public void setVcCardNo(String vcCardNo) { | |
| 213 | + this.vcCardNo = vcCardNo; | |
| 214 | + } | |
| 215 | + | |
| 216 | + public String getHusbandName() { | |
| 217 | + return husbandName; | |
| 218 | + } | |
| 219 | + | |
| 220 | + public void setHusbandName(String husbandName) { | |
| 221 | + this.husbandName = husbandName; | |
| 222 | + } | |
| 223 | + | |
| 224 | + public String getHusbandPhone() { | |
| 225 | + return husbandPhone; | |
| 226 | + } | |
| 227 | + | |
| 228 | + public void setHusbandPhone(String husbandPhone) { | |
| 229 | + this.husbandPhone = husbandPhone; | |
| 230 | + } | |
| 231 | + | |
| 232 | + public String getMommyPatientId() { | |
| 233 | + return mommyPatientId; | |
| 234 | + } | |
| 235 | + | |
| 236 | + public void setMommyPatientId(String mommyPatientId) { | |
| 237 | + this.mommyPatientId = mommyPatientId; | |
| 238 | + } | |
| 123 | 239 | |
| 124 | 240 | public String getLastCheckEmployeeId() { |
| 125 | 241 | return lastCheckEmployeeId; |
platform-data-api/src/main/java/com/lyms/platform/data/controller/TaskController.java
View file @
e7af0dc
| ... | ... | @@ -59,6 +59,9 @@ |
| 59 | 59 | } else if ("fullUpdateUsers".equals(sid)) { |
| 60 | 60 | dataImportTaskService.fullUpdateUsers(); |
| 61 | 61 | writeString(response, "success"); |
| 62 | + } else if ("fullUpdatePatients".equals(sid)) { | |
| 63 | + dataImportTaskService.fullUpdatePatients(); | |
| 64 | + writeString(response, "success"); | |
| 62 | 65 | } else if ("codeinit111".equals(sid)) { |
| 63 | 66 | try { |
| 64 | 67 | List<String> list = FileUtils.readLines(new File("d:/streets.csv")); |
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java
View file @
e7af0dc
| 1 | 1 | package com.lyms.platform.data.service.impl; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.BabyService; | |
| 3 | 4 | import com.lyms.platform.biz.service.BasicConfigService; |
| 5 | +import com.lyms.platform.biz.service.PatientsService; | |
| 4 | 6 | import com.lyms.platform.common.enums.PermissionTypeEnums; |
| 5 | 7 | import com.lyms.platform.common.enums.YnEnums; |
| 6 | 8 | import com.lyms.platform.common.utils.JsonUtil; |
| 7 | 9 | |
| ... | ... | @@ -9,7 +11,10 @@ |
| 9 | 11 | import com.lyms.platform.data.service.DataImportTaskService; |
| 10 | 12 | import com.lyms.platform.permission.model.*; |
| 11 | 13 | import com.lyms.platform.permission.service.*; |
| 14 | +import com.lyms.platform.pojo.BabyModel; | |
| 12 | 15 | import com.lyms.platform.pojo.BasicConfig; |
| 16 | +import com.lyms.platform.pojo.Patients; | |
| 17 | +import com.lyms.platform.pojo.PuerperaModel; | |
| 13 | 18 | import com.lymsh.mommybaby.earlydata.dao.PlatMapper; |
| 14 | 19 | import com.lymsh.mommybaby.earlydata.model.PlatDataContent; |
| 15 | 20 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -46,6 +51,12 @@ |
| 46 | 51 | private UserRoleMapsService userRoleMapsService; |
| 47 | 52 | |
| 48 | 53 | @Autowired |
| 54 | + private PatientsService patientsService; | |
| 55 | + | |
| 56 | + @Autowired | |
| 57 | + private BabyService babyService; | |
| 58 | + | |
| 59 | + @Autowired | |
| 49 | 60 | private PlatMapper platMapper; |
| 50 | 61 | |
| 51 | 62 | |
| 52 | 63 | |
| 53 | 64 | |
| ... | ... | @@ -65,9 +76,63 @@ |
| 65 | 76 | } |
| 66 | 77 | } |
| 67 | 78 | |
| 79 | + /** | |
| 80 | + * 每个小时的57分钟同步一次 | |
| 81 | + */ | |
| 68 | 82 | @Override |
| 83 | + public void updateBasicConfig() { | |
| 84 | + try { | |
| 85 | + List<PlatDataContent> list = platMapper.selectPlatDataContent(); | |
| 86 | + for (PlatDataContent data : list) { | |
| 87 | + try { | |
| 88 | + if (StringUtils.isBlank(data.getDcId())) { | |
| 89 | + continue; | |
| 90 | + } | |
| 91 | + BasicConfig config = new BasicConfig(); | |
| 92 | + config.setId(data.getDcId()); | |
| 93 | + config.setCode(data.getDcNo()); | |
| 94 | + config.setName(data.getDcName()); | |
| 95 | + config.setParentId(data.getDcParentid()); | |
| 96 | + config.setTypeId(data.getDcDatatypeid()); | |
| 97 | + config.setYn(YnEnums.YES.getId()); | |
| 98 | + BasicConfig db = basicConfigService.getOneBasicConfigById(data.getDcId()); | |
| 99 | + if (db == null) { | |
| 100 | + basicConfigService.addBasicConfig(config); | |
| 101 | + } else { | |
| 102 | + basicConfigService.updateBasicConfig(config); | |
| 103 | + } | |
| 104 | + } catch (Exception ee) { | |
| 105 | + ee.printStackTrace(); | |
| 106 | + LogUtil.taskError(ee.getMessage(), ee); | |
| 107 | + } | |
| 108 | + } | |
| 109 | + } catch (Exception e) { | |
| 110 | + e.printStackTrace(); | |
| 111 | + LogUtil.taskError(e.getMessage(), e); | |
| 112 | + } | |
| 113 | + } | |
| 114 | + | |
| 115 | + @Override | |
| 116 | + public void updateAssay() { | |
| 117 | + | |
| 118 | + } | |
| 119 | + | |
| 120 | + @Override | |
| 121 | + public void fullUpdateAssay() { | |
| 122 | + | |
| 123 | + } | |
| 124 | + | |
| 125 | + @Override | |
| 126 | + public void updateAssayByHospital(String hospitalForeignId, Integer hospitalId, Date startTime) { | |
| 127 | + | |
| 128 | + } | |
| 129 | + | |
| 130 | + /** | |
| 131 | + * 每10分钟同步一次(早六点到晚九点) | |
| 132 | + */ | |
| 133 | + @Override | |
| 69 | 134 | public void updateUsers() { |
| 70 | - Date startTime = new DateTime().minusMinutes(7).toDate(); | |
| 135 | + Date startTime = new DateTime().minusMinutes(14).toDate(); | |
| 71 | 136 | OrganizationQuery query = new OrganizationQuery(); |
| 72 | 137 | query.setYn(YnEnums.YES.getId()); |
| 73 | 138 | List<Organization> list = organizationService.queryOrganization(query); |
| ... | ... | @@ -78,6 +143,9 @@ |
| 78 | 143 | } |
| 79 | 144 | } |
| 80 | 145 | |
| 146 | + /** | |
| 147 | + * 每天晚上9点25同步一次 | |
| 148 | + */ | |
| 81 | 149 | @Override |
| 82 | 150 | public void fullUpdateUsers() { |
| 83 | 151 | updateUsersByHospital(null, null, null); |
| 84 | 152 | |
| 85 | 153 | |
| 86 | 154 | |
| 87 | 155 | |
| 88 | 156 | |
| 89 | 157 | |
| 90 | 158 | |
| 91 | 159 | |
| 92 | 160 | |
| 93 | 161 | |
| 94 | 162 | |
| 95 | 163 | |
| 96 | 164 | |
| 97 | 165 | |
| 98 | 166 | |
| 99 | 167 | |
| ... | ... | @@ -271,77 +339,117 @@ |
| 271 | 339 | |
| 272 | 340 | } |
| 273 | 341 | |
| 342 | + | |
| 343 | + | |
| 344 | + /** | |
| 345 | + * 每5分钟同步一次(早六点到晚九点) | |
| 346 | + */ | |
| 274 | 347 | @Override |
| 275 | - public void updateBasicConfig() { | |
| 276 | - try { | |
| 277 | - List<PlatDataContent> list = platMapper.selectPlatDataContent(); | |
| 278 | - for (PlatDataContent data : list) { | |
| 279 | - try { | |
| 280 | - if (StringUtils.isBlank(data.getDcId())) { | |
| 281 | - continue; | |
| 282 | - } | |
| 283 | - BasicConfig config = new BasicConfig(); | |
| 284 | - config.setId(data.getDcId()); | |
| 285 | - config.setCode(data.getDcNo()); | |
| 286 | - config.setName(data.getDcName()); | |
| 287 | - config.setParentId(data.getDcParentid()); | |
| 288 | - config.setTypeId(data.getDcDatatypeid()); | |
| 289 | - config.setYn(YnEnums.YES.getId()); | |
| 290 | - BasicConfig db = basicConfigService.getOneBasicConfigById(data.getDcId()); | |
| 291 | - if (db == null) { | |
| 292 | - basicConfigService.addBasicConfig(config); | |
| 293 | - } else { | |
| 294 | - basicConfigService.updateBasicConfig(config); | |
| 295 | - } | |
| 296 | - } catch (Exception ee) { | |
| 297 | - ee.printStackTrace(); | |
| 298 | - LogUtil.taskError(ee.getMessage(), ee); | |
| 299 | - } | |
| 348 | + public void updatePatients() { | |
| 349 | + Date startTime = new DateTime().minusMinutes(10).toDate(); | |
| 350 | + OrganizationQuery query = new OrganizationQuery(); | |
| 351 | + query.setYn(YnEnums.YES.getId()); | |
| 352 | + List<Organization> list = organizationService.queryOrganization(query); | |
| 353 | + for (Organization organization : list) { | |
| 354 | + if (StringUtils.isNotBlank(organization.getForeignId())) { | |
| 355 | + updatePatientsByHospital(organization.getForeignId(), organization.getId(), null); | |
| 300 | 356 | } |
| 301 | - } catch (Exception e) { | |
| 302 | - e.printStackTrace(); | |
| 303 | - LogUtil.taskError(e.getMessage(), e); | |
| 304 | 357 | } |
| 305 | 358 | } |
| 306 | 359 | |
| 360 | + /** | |
| 361 | + * 每天晚上9点55同步一次 | |
| 362 | + */ | |
| 307 | 363 | @Override |
| 308 | - public void updateAssay() { | |
| 309 | - | |
| 364 | + public void fullUpdatePatients() { | |
| 365 | + updatePatientsByHospital(null, null, null); | |
| 310 | 366 | } |
| 311 | 367 | |
| 312 | 368 | @Override |
| 313 | - public void fullUpdateAssay() { | |
| 369 | + public void updatePatientsByHospital(String hospitalForeignId, Integer hospitalId, Date startTime) { | |
| 370 | + try { | |
| 371 | + List<String> pidList = new ArrayList<>(); | |
| 372 | + List<Map> list = platMapper.selectAllPuerperaByHospitalId(hospitalForeignId, startTime); | |
| 373 | + if (list != null && list.size() > 0) { | |
| 374 | + for (Map map : list) { | |
| 375 | + try { | |
| 376 | + if (!pidList.contains(map.get("P_ID"))) { | |
| 377 | + pidList.add(map.get("P_ID").toString()); | |
| 378 | + Patients patients = new Patients(); | |
| 379 | + patients.setModified(new Date()); | |
| 380 | + patients.setYn(YnEnums.YES.getId()); | |
| 381 | + patients.setPublishName("system"); | |
| 382 | + patients.setPublishId("worker"); | |
| 383 | + patients.setId(map.get("P_ID").toString()); | |
| 384 | + patients.setMommyPatientId(map.get("P_NO").toString()); | |
| 385 | + patients.setUsername(map.get("P_NAME").toString()); | |
| 386 | + patients.setPhone(map.get("P_MOBILEPHONE").toString()); | |
| 387 | + patients.setBirth(map.get("P_BIRTHDAY") == null ? null : (Date) map.get("P_BIRTHDAY")); | |
| 388 | + patients.setLastMenses(map.get("P_LASTMENSTRUALPERIOD") == null ? null : (Date) map.get("P_LASTMENSTRUALPERIOD")); | |
| 314 | 389 | |
| 315 | - } | |
| 390 | + patients.setAddress(map.get("P_ADDRESSSTREET") == null ? null : map.get("P_ADDRESSSTREET").toString()); | |
| 391 | + patients.setProvinceId(map.get("P_ADDRESSPROVINCE") == null ? null : map.get("P_ADDRESSPROVINCE").toString()); | |
| 392 | + patients.setCityId(map.get("P_ADDRESSCITY") == null ? null : map.get("P_ADDRESSCITY").toString()); | |
| 393 | + patients.setAreaId(map.get("P_ADDRESSCOUNTY") == null ? null : map.get("P_ADDRESSCOUNTY").toString()); | |
| 316 | 394 | |
| 317 | - @Override | |
| 318 | - public void updateAssayByHospital(String hospitalForeignId, Integer hospitalId, Date startTime) { | |
| 395 | + patients.setAddressPostRest(map.get("P_POSTPARTUMSTREET") == null ? null : map.get("P_POSTPARTUMSTREET").toString()); | |
| 396 | + patients.setProvincePostRestId(map.get("P_POSTPARTUMPROVINCE") == null ? null : map.get("P_POSTPARTUMPROVINCE").toString()); | |
| 397 | + patients.setCityPostRestId(map.get("P_POSTPARTUMCITY") == null ? null : map.get("P_POSTPARTUMCITY").toString()); | |
| 398 | + patients.setAreaPostRestId(map.get("P_POSTPARTUMCOUNTY") == null ? null : map.get("P_POSTPARTUMCOUNTY").toString()); | |
| 319 | 399 | |
| 320 | - } | |
| 400 | + patients.setAddressRegister(map.get("P_RRSTREET") == null ? null : map.get("P_RRSTREET").toString()); | |
| 401 | + patients.setProvinceRegisterId(map.get("P_RRPROVINCE") == null ? null : map.get("P_RRPROVINCE").toString()); | |
| 402 | + patients.setCityRegisterId(map.get("P_RRCITY") == null ? null : map.get("P_RRCITY").toString()); | |
| 403 | + patients.setAreaRegisterId(map.get("P_RRCOUNTY") == null ? null : map.get("P_RRCOUNTY").toString()); | |
| 321 | 404 | |
| 322 | - @Override | |
| 323 | - public void updatePatients() { | |
| 405 | + patients.setAreaRegisterId(map.get("P_HUSBANDNAME") == null ? null : map.get("P_HUSBANDNAME").toString()); | |
| 406 | + patients.setAreaRegisterId(map.get("P_HUSBANDMOBILEPHONE") == null ? null : map.get("P_HUSBANDMOBILEPHONE").toString()); | |
| 407 | + patients.setVcCardNo(map.get("VC_CARDNO") == null ? null : map.get("VC_CARDNO").toString()); | |
| 408 | + patients.setDeliverOrg(map.get("P_HOSPITALID") == null ? null : map.get("P_HOSPITALID").toString()); | |
| 324 | 409 | |
| 325 | - } | |
| 410 | + if (patientsService.queryPatientCount(patients.getId()) == 0) { | |
| 411 | + patients.setCreated(patients.getModified()); | |
| 412 | + patientsService.addPatient(patients); | |
| 413 | + } else { | |
| 414 | + patientsService.updatePatient(patients); | |
| 415 | + } | |
| 326 | 416 | |
| 327 | - @Override | |
| 328 | - public void fullUpdatePatients() { | |
| 329 | - | |
| 417 | + } | |
| 418 | + } catch (Exception ee) { | |
| 419 | + LogUtil.taskError(ee.getMessage(), ee); | |
| 420 | + } | |
| 421 | + } | |
| 422 | + } else { | |
| 423 | + LogUtil.taskInfo("hospitalId:" + hospitalForeignId + " has no data!"); | |
| 424 | + } | |
| 425 | + } catch (Exception e) { | |
| 426 | + e.printStackTrace(); | |
| 427 | + LogUtil.taskError(e.getMessage(), e); | |
| 428 | + } | |
| 330 | 429 | } |
| 331 | 430 | |
| 431 | + /** | |
| 432 | + * 每5分钟同步一次(早六点到晚九点) | |
| 433 | + */ | |
| 332 | 434 | @Override |
| 333 | - public void updatePatientsByHospital(String hospitalForeignId, Integer hospitalId, Date startTime) { | |
| 334 | - | |
| 335 | - } | |
| 336 | - | |
| 337 | - @Override | |
| 338 | 435 | public void updateNewBorns() { |
| 339 | - | |
| 436 | + Date startTime = new DateTime().minusMinutes(10).toDate(); | |
| 437 | + OrganizationQuery query = new OrganizationQuery(); | |
| 438 | + query.setYn(YnEnums.YES.getId()); | |
| 439 | + List<Organization> list = organizationService.queryOrganization(query); | |
| 440 | + for (Organization organization : list) { | |
| 441 | + if (StringUtils.isNotBlank(organization.getForeignId())) { | |
| 442 | + updateNewBornsByHospital(organization.getForeignId(), organization.getId(), null); | |
| 443 | + } | |
| 444 | + } | |
| 340 | 445 | } |
| 341 | 446 | |
| 447 | + /** | |
| 448 | + * 每天晚上11点25同步一次 | |
| 449 | + */ | |
| 342 | 450 | @Override |
| 343 | 451 | public void fullUpdateNewBorns() { |
| 344 | - | |
| 452 | + updateNewBornsByHospital(null, null, null); | |
| 345 | 453 | } |
| 346 | 454 | |
| 347 | 455 | @Override |
platform-data-api/src/main/webapp/WEB-INF/vm/task/index.vm
View file @
e7af0dc
| ... | ... | @@ -34,11 +34,11 @@ |
| 34 | 34 | </td> |
| 35 | 35 | </tr> |
| 36 | 36 | <tr> |
| 37 | - <td>初始化省市区乡镇code</td> | |
| 37 | + <td>产妇</td> | |
| 38 | 38 | <td></td> |
| 39 | 39 | <td>无</td> |
| 40 | 40 | <td> |
| 41 | - <button class="btn btn-sm btn-danger" onclick="execOne('codeinit')">执行</button> | |
| 41 | + <button class="btn btn-sm btn-danger" onclick="execOne('fullUpdatePatients')">执行</button> | |
| 42 | 42 | </td> |
| 43 | 43 | </tr> |
| 44 | 44 | </table> |
platform-mommyData/src/main/java/com/lymsh/mommybaby/earlydata/dao/PlatMapper.java
View file @
e7af0dc
| ... | ... | @@ -34,5 +34,7 @@ |
| 34 | 34 | |
| 35 | 35 | public List<Map> selectAllUserByHospitalId(@Param("hospitalId") String hospitalId, @Param("startTime") Date startTime); |
| 36 | 36 | |
| 37 | + public List<Map> selectAllPuerperaByHospitalId(@Param("hospitalId") String hospitalId, @Param("startTime") Date startTime); | |
| 38 | + | |
| 37 | 39 | } |
platform-mommyData/src/main/java/com/lymsh/mommybaby/earlydata/service/PlatService.java
View file @
e7af0dc
platform-mommyData/src/main/java/com/lymsh/mommybaby/earlydata/service/impl/PlatServiceImpl.java
View file @
e7af0dc
| ... | ... | @@ -101,5 +101,10 @@ |
| 101 | 101 | public List<Map> selectAllByHospitalId(String hospitalId, Date startTime) { |
| 102 | 102 | return platMapper.selectAllByHospitalId(hospitalId, startTime); |
| 103 | 103 | } |
| 104 | + | |
| 105 | + @Override | |
| 106 | + public List<Map> selectAllPuerperaByHospitalId(String hospitalId, Date startTime) { | |
| 107 | + return platMapper.selectAllPuerperaByHospitalId(hospitalId, startTime); | |
| 108 | + } | |
| 104 | 109 | } |
platform-mommyData/src/main/resources/earlyOrm/Plat.xml
View file @
e7af0dc
| ... | ... | @@ -221,6 +221,24 @@ |
| 221 | 221 | order by h.h_id,d.d_id,u.u_id |
| 222 | 222 | </select> |
| 223 | 223 | |
| 224 | + <select id="selectAllPuerperaByHospitalId" resultType="hashmap" parameterType="map"> | |
| 225 | + select | |
| 226 | + ppt.*,mp.*,card.* | |
| 227 | + from | |
| 228 | + mommy_patient mp,plat_patient ppt, mommy_visitcard card | |
| 229 | + where | |
| 230 | + mp.p_platpatientid = ppt.p_id and card.vc_patientno = mp.p_no | |
| 231 | + and mp.p_hospitalid is not null and ppt.p_id is not null and mp.p_no is not null and ppt.p_name is not null and mp.P_MOBILEPHONE is not null | |
| 232 | + and ( floor((sysdate - P_LASTMENSTRUALPERIOD+1)/7) > 41 or ( SELECT COUNT(0) FROM mommy_pregDeliveryrecord pp WHERE pp.PDR_PATIENTID =mp.p_platpatientid)>0 ) | |
| 233 | + <if test="hospitalId != null"> | |
| 234 | + and mp.p_hospitalid = #{hospitalId} | |
| 235 | + </if> | |
| 236 | + <if test="startTime != null"> | |
| 237 | + and (mp.p_opertime >= #{startTime} or ppt.p_opertime >= #{startTime} or card.vc_opertime >= #{startTime} ) | |
| 238 | + </if> | |
| 239 | + order by mp.p_hospitalid,ppt.p_id,mp.p_no | |
| 240 | + </select> | |
| 241 | + | |
| 224 | 242 | |
| 225 | 243 | </mapper> |