Commit 65e71de54f3179f93048fcf3d3fbac528784eb71
1 parent
cc8e7222a0
Exists in
master
and in
1 other branch
code update
Showing 1 changed file with 7 additions and 9 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/JdbcUtil.java
View file @
65e71de
| ... | ... | @@ -363,14 +363,15 @@ |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | |
| 366 | - public static void syncPatientData(String hospitalId,MongoTemplate mongoTemplate,int start,int total) | |
| 366 | + public static void syncPatientData(String hospitalId,MongoTemplate mongoTemplate,int start,int end) | |
| 367 | 367 | { |
| 368 | 368 | |
| 369 | - int num = start; | |
| 370 | - List<Map<String, Object>> list = getListDataBySql(" SELECT * FROM ( SELECT A.*, ROWNUM RN FROM " + | |
| 371 | - "(select replace(mp.P_NO,'-','') as PID,mp.*,p_birthday,p_name,floor((trunc(sysdate) - trunc(mp.P_LASTMENSTRUALPERIOD)+1) /7) as weeks from MOMMY_PATIENT mp left join Plat_Patient pp" + | |
| 372 | - " on mp.p_platpatientid=pp.p_id where mp.p_hospitalid = '" + hospitalId + "' order by mp.p_lastmenstrualperiod desc ) A WHERE ROWNUM <= "+total+" ) WHERE RN >= "+num); | |
| 369 | + String sql = " SELECT * FROM ( SELECT A.*, ROWNUM RN FROM " + | |
| 370 | + "(select replace(mp.P_NO,'-','') as PID,mp.*,p_birthday,p_name,floor((trunc(sysdate) - trunc(mp.P_LASTMENSTRUALPERIOD)+1) /7) as weeks from MOMMY_PATIENT mp left join Plat_Patient pp" + | |
| 371 | + " on mp.p_platpatientid=pp.p_id where mp.p_hospitalid = '" + hospitalId + "' order by mp.p_lastmenstrualperiod desc ) A WHERE ROWNUM <= "+end+" ) WHERE RN >= "+start; | |
| 372 | + List<Map<String, Object>> list = getListDataBySql(sql); | |
| 373 | 373 | System.out.println(list.size()+"---------------------------------"); |
| 374 | + System.out.println(sql); | |
| 374 | 375 | for (Map<String, Object> map : list) { |
| 375 | 376 | try { |
| 376 | 377 | |
| ... | ... | @@ -1637,8 +1638,7 @@ |
| 1637 | 1638 | public static void syncDataPat1(String hid,MongoTemplate mongoTemplate) |
| 1638 | 1639 | { |
| 1639 | 1640 | try { |
| 1640 | - System.out.println("eeeeeeeee" + employees.size()); | |
| 1641 | - syncPatientData(hid, mongoTemplate, 1, 3000); | |
| 1641 | + syncPatientData(hid, mongoTemplate, 1, 30000); | |
| 1642 | 1642 | } |
| 1643 | 1643 | catch (Exception e) |
| 1644 | 1644 | { |
| ... | ... | @@ -1649,7 +1649,6 @@ |
| 1649 | 1649 | public static void syncDataPat2(String hid,MongoTemplate mongoTemplate) |
| 1650 | 1650 | { |
| 1651 | 1651 | try { |
| 1652 | - System.out.println("eeeeeeeee2"+employees.size()); | |
| 1653 | 1652 | syncPatientData(hid,mongoTemplate,30001,8000); |
| 1654 | 1653 | } |
| 1655 | 1654 | catch (Exception e) |
| ... | ... | @@ -1661,7 +1660,6 @@ |
| 1661 | 1660 | public static void syncDataPat3(String hid,MongoTemplate mongoTemplate) |
| 1662 | 1661 | { |
| 1663 | 1662 | try { |
| 1664 | - System.out.println("eeeeeeeee3"+employees.size()); | |
| 1665 | 1663 | syncPatientData(hid,mongoTemplate,8001,100000); |
| 1666 | 1664 | } |
| 1667 | 1665 | catch (Exception e) |