Commit b3521e74cbd6bd6c7a5f764b33e2c5ef874ef651
1 parent
b3b66719f7
Exists in
master
and in
1 other branch
update
Showing 6 changed files with 877 additions and 9 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterMysqlAntexcMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/MysqlAntexcService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MysqlAntexcServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientSyncMysqlFacade.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterMysqlAntexcMapper.java
View file @
b3521e7
| ... | ... | @@ -82,5 +82,34 @@ |
| 82 | 82 | List<Map<String,String>> getCheckPersonCount(Map param); |
| 83 | 83 | List<Map<String,String>> getMatDeliverCount(Map param); |
| 84 | 84 | List<Map<String,String>> getLiveCount(Map param); |
| 85 | + | |
| 86 | + List<Map<String,String>> getOrgCheckPersonCounts(Map param); | |
| 87 | + List<Map<String,String>> getOrgCheckNumCounts(Map param); | |
| 88 | + List<Map<String,String>> getRiskPersonCounts(Map param); | |
| 89 | + List<Map<String,String>> getColorYellowCounts(Map param); | |
| 90 | + List<Map<String,String>> getColorOrangeCounts(Map param); | |
| 91 | + List<Map<String,String>> getColorRedCounts(Map param); | |
| 92 | + List<Map<String,String>> getColorVioletCounts(Map param); | |
| 93 | + List<Map<String,String>> getColorGreenCounts(Map param); | |
| 94 | + | |
| 95 | + List<Map<String,String>> getOneRiskCounts(Map param); | |
| 96 | + List<Map<String,String>> getTwoRiskCounts(Map param); | |
| 97 | + List<Map<String,String>> getThreeRiskCounts(Map param); | |
| 98 | + List<Map<String,String>> getFourRiskCounts(Map param); | |
| 99 | + | |
| 100 | + | |
| 101 | + List<Map<String,String>> getCheckOrgCheckPersonCounts(Map param); | |
| 102 | + List<Map<String,String>> getBeforeBuildCheckPersonCounts(Map param); | |
| 103 | + List<Map<String,String>> getCheckRiskPersonCounts(Map param); | |
| 104 | + List<Map<String,String>> getCheckColorYellowCounts(Map param); | |
| 105 | + List<Map<String,String>> getCheckColorOrangeCounts(Map param); | |
| 106 | + List<Map<String,String>> getCheckColorRedCounts(Map param); | |
| 107 | + List<Map<String,String>> getCheckColorVioletCounts(Map param); | |
| 108 | + List<Map<String,String>> getCheckColorGreenCounts(Map param); | |
| 109 | + | |
| 110 | + List<Map<String,String>> getCheckOneRiskCounts(Map param); | |
| 111 | + List<Map<String,String>> getCheckTwoRiskCounts(Map param); | |
| 112 | + List<Map<String,String>> getCheckThreeRiskCounts(Map param); | |
| 113 | + List<Map<String,String>> getCheckFourRiskCounts(Map param); | |
| 85 | 114 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/MysqlAntexcService.java
View file @
b3521e7
| ... | ... | @@ -79,5 +79,35 @@ |
| 79 | 79 | List<Map<String,String>> getCheckPersonCount(Map param); |
| 80 | 80 | List<Map<String,String>> getMatDeliverCount(Map param); |
| 81 | 81 | List<Map<String,String>> getLiveCount(Map param); |
| 82 | + | |
| 83 | + List<Map<String,String>> getOrgCheckPersonCounts(Map param); | |
| 84 | + List<Map<String,String>> getOrgCheckNumCounts(Map param); | |
| 85 | + List<Map<String,String>> getRiskPersonCounts(Map param); | |
| 86 | + List<Map<String,String>> getColorYellowCounts(Map param); | |
| 87 | + List<Map<String,String>> getColorOrangeCounts(Map param); | |
| 88 | + List<Map<String,String>> getColorRedCounts(Map param); | |
| 89 | + List<Map<String,String>> getColorVioletCounts(Map param); | |
| 90 | + List<Map<String,String>> getColorGreenCounts(Map param); | |
| 91 | + | |
| 92 | + List<Map<String,String>> getOneRiskCounts(Map param); | |
| 93 | + List<Map<String,String>> getTwoRiskCounts(Map param); | |
| 94 | + List<Map<String,String>> getThreeRiskCounts(Map param); | |
| 95 | + List<Map<String,String>> getFourRiskCounts(Map param); | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + List<Map<String,String>> getCheckOrgCheckPersonCounts(Map param); | |
| 100 | + List<Map<String,String>> getBeforeBuildCheckPersonCounts(Map param); | |
| 101 | + List<Map<String,String>> getCheckRiskPersonCounts(Map param); | |
| 102 | + List<Map<String,String>> getCheckColorYellowCounts(Map param); | |
| 103 | + List<Map<String,String>> getCheckColorOrangeCounts(Map param); | |
| 104 | + List<Map<String,String>> getCheckColorRedCounts(Map param); | |
| 105 | + List<Map<String,String>> getCheckColorVioletCounts(Map param); | |
| 106 | + List<Map<String,String>> getCheckColorGreenCounts(Map param); | |
| 107 | + | |
| 108 | + List<Map<String,String>> getCheckOneRiskCounts(Map param); | |
| 109 | + List<Map<String,String>> getCheckTwoRiskCounts(Map param); | |
| 110 | + List<Map<String,String>> getCheckThreeRiskCounts(Map param); | |
| 111 | + List<Map<String,String>> getCheckFourRiskCounts(Map param); | |
| 82 | 112 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MysqlAntexcServiceImpl.java
View file @
b3521e7
| ... | ... | @@ -190,6 +190,107 @@ |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | @Override |
| 193 | + public List<Map<String,String>> getOrgCheckPersonCounts(Map param) | |
| 194 | + { | |
| 195 | + return masterMysqlAntexcMapper.getOrgCheckPersonCounts(param); | |
| 196 | + } | |
| 197 | + @Override | |
| 198 | + public List<Map<String,String>> getOrgCheckNumCounts(Map param){ | |
| 199 | + return masterMysqlAntexcMapper.getOrgCheckNumCounts(param); | |
| 200 | + } | |
| 201 | + @Override | |
| 202 | + public List<Map<String,String>> getRiskPersonCounts(Map param){ | |
| 203 | + return masterMysqlAntexcMapper.getRiskPersonCounts(param); | |
| 204 | + } | |
| 205 | + @Override | |
| 206 | + public List<Map<String,String>> getColorYellowCounts(Map param){ | |
| 207 | + return masterMysqlAntexcMapper.getColorYellowCounts(param); | |
| 208 | + } | |
| 209 | + @Override | |
| 210 | + public List<Map<String,String>> getColorOrangeCounts(Map param){ | |
| 211 | + return masterMysqlAntexcMapper.getColorOrangeCounts(param); | |
| 212 | + } | |
| 213 | + @Override | |
| 214 | + public List<Map<String,String>> getColorRedCounts(Map param){ | |
| 215 | + return masterMysqlAntexcMapper.getColorRedCounts(param); | |
| 216 | + } | |
| 217 | + @Override | |
| 218 | + public List<Map<String,String>> getColorVioletCounts(Map param){ | |
| 219 | + return masterMysqlAntexcMapper.getColorVioletCounts(param); | |
| 220 | + } | |
| 221 | + @Override | |
| 222 | + public List<Map<String,String>> getColorGreenCounts(Map param){ | |
| 223 | + return masterMysqlAntexcMapper.getColorGreenCounts(param); | |
| 224 | + } | |
| 225 | + | |
| 226 | + @Override | |
| 227 | + public List<Map<String,String>> getOneRiskCounts(Map param){ | |
| 228 | + return masterMysqlAntexcMapper.getOneRiskCounts(param); | |
| 229 | + } | |
| 230 | + @Override | |
| 231 | + public List<Map<String,String>> getTwoRiskCounts(Map param){ | |
| 232 | + return masterMysqlAntexcMapper.getTwoRiskCounts(param); | |
| 233 | + } | |
| 234 | + @Override | |
| 235 | + public List<Map<String,String>> getThreeRiskCounts(Map param){ | |
| 236 | + return masterMysqlAntexcMapper.getThreeRiskCounts(param); | |
| 237 | + } | |
| 238 | + @Override | |
| 239 | + public List<Map<String,String>> getFourRiskCounts(Map param){ | |
| 240 | + return masterMysqlAntexcMapper.getFourRiskCounts(param); | |
| 241 | + } | |
| 242 | + | |
| 243 | + | |
| 244 | + @Override | |
| 245 | + public List<Map<String,String>> getCheckOrgCheckPersonCounts(Map param){ | |
| 246 | + return masterMysqlAntexcMapper.getCheckOrgCheckPersonCounts(param); | |
| 247 | + } | |
| 248 | + @Override | |
| 249 | + public List<Map<String,String>> getBeforeBuildCheckPersonCounts(Map param){ | |
| 250 | + return masterMysqlAntexcMapper.getBeforeBuildCheckPersonCounts(param); | |
| 251 | + } | |
| 252 | + @Override | |
| 253 | + public List<Map<String,String>> getCheckRiskPersonCounts(Map param){ | |
| 254 | + return masterMysqlAntexcMapper.getCheckRiskPersonCounts(param); | |
| 255 | + } | |
| 256 | + @Override | |
| 257 | + public List<Map<String,String>> getCheckColorYellowCounts(Map param){ | |
| 258 | + return masterMysqlAntexcMapper.getCheckColorYellowCounts(param); | |
| 259 | + } | |
| 260 | + @Override | |
| 261 | + public List<Map<String,String>> getCheckColorOrangeCounts(Map param){ | |
| 262 | + return masterMysqlAntexcMapper.getCheckColorOrangeCounts(param); | |
| 263 | + } | |
| 264 | + @Override | |
| 265 | + public List<Map<String,String>> getCheckColorRedCounts(Map param){ | |
| 266 | + return masterMysqlAntexcMapper.getCheckColorRedCounts(param); | |
| 267 | + } | |
| 268 | + @Override | |
| 269 | + public List<Map<String,String>> getCheckColorVioletCounts(Map param){ | |
| 270 | + return masterMysqlAntexcMapper.getCheckColorVioletCounts(param); | |
| 271 | + } | |
| 272 | + @Override | |
| 273 | + public List<Map<String,String>> getCheckColorGreenCounts(Map param){ | |
| 274 | + return masterMysqlAntexcMapper.getCheckColorGreenCounts(param); | |
| 275 | + } | |
| 276 | + @Override | |
| 277 | + public List<Map<String,String>> getCheckOneRiskCounts(Map param){ | |
| 278 | + return masterMysqlAntexcMapper.getCheckOneRiskCounts(param); | |
| 279 | + } | |
| 280 | + @Override | |
| 281 | + public List<Map<String,String>> getCheckTwoRiskCounts(Map param){ | |
| 282 | + return masterMysqlAntexcMapper.getCheckTwoRiskCounts(param); | |
| 283 | + } | |
| 284 | + @Override | |
| 285 | + public List<Map<String,String>> getCheckThreeRiskCounts(Map param){ | |
| 286 | + return masterMysqlAntexcMapper.getCheckThreeRiskCounts(param); | |
| 287 | + } | |
| 288 | + @Override | |
| 289 | + public List<Map<String,String>> getCheckFourRiskCounts(Map param){ | |
| 290 | + return masterMysqlAntexcMapper.getCheckFourRiskCounts(param); | |
| 291 | + } | |
| 292 | + | |
| 293 | + @Override | |
| 193 | 294 | public void addRisk(MysqlRisk model) { |
| 194 | 295 | masterMysqlAntexcMapper.addRisk(model); |
| 195 | 296 | } |
platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml
View file @
b3521e7
| ... | ... | @@ -1342,10 +1342,10 @@ |
| 1342 | 1342 | </select> |
| 1343 | 1343 | |
| 1344 | 1344 | <select id="getBulidCheckNumCount" resultType="java.util.Map" parameterType="java.util.Map"> |
| 1345 | - select count(cj.cid) as bulidCheckNumCount,tp.name as hospitalName,tp.hospitalId from ( | |
| 1346 | - select p.hospitalId, p.patientId,o.id,o.name,o.province_id,o.area_id,o.city_id from report_patients p | |
| 1345 | + select count(cj.cid) as bulidCheckNumCount,o.name as hospitalName,cj.hospitalId from ( | |
| 1346 | + select p.hospitalId, p.patientId from report_patients p | |
| 1347 | 1347 | INNER JOIN organization o on p.hospitalId=o.id |
| 1348 | - where p.type=1 and p.enable is NULL | |
| 1348 | + where p.type=1 and p.enable is NULL | |
| 1349 | 1349 | <if test="startDate != null"> |
| 1350 | 1350 | and p.bookbuildingDate >= #{startDate} |
| 1351 | 1351 | </if> |
| ... | ... | @@ -1366,10 +1366,16 @@ |
| 1366 | 1366 | and o.area_id = #{areaId,jdbcType=VARCHAR} |
| 1367 | 1367 | </if> |
| 1368 | 1368 | ) tp |
| 1369 | - INNER JOIN | |
| 1370 | - (SELECT r.fid as cid,r.parentId, r.checkDate,r.sourceId from report_antex r | |
| 1371 | - union ALL | |
| 1372 | - SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId from report_antexchu c) cj on tp.patientId= cj.sourceId GROUP BY tp.name | |
| 1369 | + INNER JOIN | |
| 1370 | + ( | |
| 1371 | + SELECT r.fid as cid,r.parentId, r.checkDate,r.sourceId,r.hospitalId from report_antex r | |
| 1372 | + union | |
| 1373 | + SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId,c.hospitalId from report_antexchu c | |
| 1374 | + ) cj | |
| 1375 | + on tp.patientId= cj.sourceId | |
| 1376 | + INNER JOIN organization o on cj.hospitalId=o.id | |
| 1377 | + GROUP BY o.name | |
| 1378 | + | |
| 1373 | 1379 | </select> |
| 1374 | 1380 | <select id="getCheckPersonCount" resultType="java.util.Map" parameterType="java.util.Map"> |
| 1375 | 1381 | select count(cj.sourceId) as checkPersonCount,tp.name as hospitalName,tp.id as hospitalId |
| 1376 | 1382 | |
| ... | ... | @@ -1440,14 +1446,14 @@ |
| 1440 | 1446 | <if test="endDate != null"> |
| 1441 | 1447 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} |
| 1442 | 1448 | </if> |
| 1443 | - ) fm GROUP BY fm.name; | |
| 1449 | + ) fm GROUP BY fm.name | |
| 1444 | 1450 | |
| 1445 | 1451 | </select> |
| 1446 | 1452 | |
| 1447 | 1453 | <select id="getLiveCount" resultType="java.util.Map" parameterType="java.util.Map"> |
| 1448 | 1454 | select count(p.patientId) as liveCount,o.name as hospitalName,o.id as hospitalId from report_patients p |
| 1449 | 1455 | INNER JOIN organization o on p.hospitalId=o.id |
| 1450 | - where p.pliveTypeId='57624c5e0cf23d4631523ea2' | |
| 1456 | + where p.pliveTypeId='57624c5e0cf23d4631523ea2' and p.enable is NULL | |
| 1451 | 1457 | <if test="hospitalId != null and hospitalId != ''"> |
| 1452 | 1458 | and o.id = #{hospitalId,jdbcType=VARCHAR} |
| 1453 | 1459 | </if> |
| ... | ... | @@ -1470,5 +1476,318 @@ |
| 1470 | 1476 | GROUP BY o.name |
| 1471 | 1477 | |
| 1472 | 1478 | </select> |
| 1479 | + | |
| 1480 | + | |
| 1481 | + <select id="getOrgCheckPersonCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1482 | + select temp.hospitalId,count(temp.sourceId) as orgCheckPersonCount,temp.name as hospitalName from (select p.hospitalId,p.sourceId,o.id,o.name,o.province_id,o.area_id,o.city_id from ( | |
| 1483 | + SELECT r.fid as cid,r.parentId, r.checkDate,r.sourceId,r.hospitalId from report_antex r where r.hospitalId=#{hospitalId} | |
| 1484 | + union ALL | |
| 1485 | + SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId,c.hospitalId from report_antexchu c where c.hospitalId=#{hospitalId}) p | |
| 1486 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1487 | + INNER JOIN report_patients rp on rp.patientId=p.parentId | |
| 1488 | + where rp.type=1 and rp.enable is NULL | |
| 1489 | + <if test="startDate != null"> | |
| 1490 | + and rp.bookbuildingDate >= #{startDate} | |
| 1491 | + </if> | |
| 1492 | + <if test="endDate != null"> | |
| 1493 | + and rp.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1494 | + </if> | |
| 1495 | + GROUP BY p.sourceId, p.hospitalId) temp GROUP BY temp.name | |
| 1496 | + | |
| 1497 | + </select> | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + <select id="getOrgCheckNumCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1502 | + select temp.hospitalId,count(temp.cid) as orgCheckNumCount,temp.name as hospitalName from (select p.cid,p.hospitalId,p.sourceId,o.id,o.name,o.province_id,o.area_id,o.city_id from ( | |
| 1503 | + SELECT r.fid as cid,r.parentId, r.checkDate,r.sourceId,r.hospitalId from report_antex r where r.hospitalId=#{hospitalId} | |
| 1504 | + union ALL | |
| 1505 | + SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId,c.hospitalId from report_antexchu c where c.hospitalId=#{hospitalId}) p | |
| 1506 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1507 | + INNER JOIN report_patients rp on rp.patientId=p.parentId | |
| 1508 | + where rp.type=1 and rp.enable is NULL | |
| 1509 | + <if test="startDate != null"> | |
| 1510 | + and rp.bookbuildingDate >= #{startDate} | |
| 1511 | + </if> | |
| 1512 | + <if test="endDate != null"> | |
| 1513 | + and rp.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1514 | + </if> | |
| 1515 | + ) temp GROUP BY temp.name | |
| 1516 | + | |
| 1517 | + </select> | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + <select id="getRiskPersonCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1521 | + select count(l.sourceId) as riskPersonCount,tp.id as hospitalId,tp.name as hospitalName | |
| 1522 | + from (select p.patientId,o.id,o.name,o.province_id,o.area_id,o.city_id from report_patients p | |
| 1523 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1524 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1525 | + <if test="startDate != null"> | |
| 1526 | + and p.bookbuildingDate >= #{startDate} | |
| 1527 | + </if> | |
| 1528 | + <if test="endDate != null"> | |
| 1529 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1530 | + </if> | |
| 1531 | + ) tp | |
| 1532 | + INNER JOIN | |
| 1533 | + (SELECT DISTINCT(c.sourceId) as sourceId from report_risk_level r | |
| 1534 | + LEFT JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and riskLevel > 1 ) | |
| 1535 | + l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1536 | + | |
| 1537 | + </select> | |
| 1538 | + | |
| 1539 | + <select id="getColorYellowCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1540 | + select count(l.sourceId) as colorYellowCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1541 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1542 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1543 | + <if test="startDate != null"> | |
| 1544 | + and p.bookbuildingDate >= #{startDate} | |
| 1545 | + </if> | |
| 1546 | + <if test="endDate != null"> | |
| 1547 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1548 | + </if> | |
| 1549 | + ) tp | |
| 1550 | + INNER JOIN | |
| 1551 | + (SELECT DISTINCT(c.sourceId) as sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and riskLevel = 2 ) | |
| 1552 | + l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1553 | + | |
| 1554 | + </select> | |
| 1555 | + <select id="getColorOrangeCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1556 | + select count(l.sourceId) as colorOrangeCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1557 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1558 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1559 | + <if test="startDate != null"> | |
| 1560 | + and p.bookbuildingDate >= #{startDate} | |
| 1561 | + </if> | |
| 1562 | + <if test="endDate != null"> | |
| 1563 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1564 | + </if> | |
| 1565 | + ) tp | |
| 1566 | + INNER JOIN | |
| 1567 | + (SELECT DISTINCT(c.sourceId) as sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and riskLevel =3 ) | |
| 1568 | + l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1569 | + | |
| 1570 | + </select> | |
| 1571 | + | |
| 1572 | + <select id="getColorRedCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1573 | + select count(l.sourceId) as colorRedCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1574 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1575 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1576 | + <if test="startDate != null"> | |
| 1577 | + and p.bookbuildingDate >= #{startDate} | |
| 1578 | + </if> | |
| 1579 | + <if test="endDate != null"> | |
| 1580 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1581 | + </if> | |
| 1582 | + ) tp | |
| 1583 | + INNER JOIN | |
| 1584 | + (SELECT DISTINCT(c.sourceId) as sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and riskLevel =4 ) | |
| 1585 | + l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1586 | + | |
| 1587 | + </select> | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + <select id="getColorVioletCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1592 | + select count(l.sourceId) as colorVioletCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1593 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1594 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1595 | + <if test="startDate != null"> | |
| 1596 | + and p.bookbuildingDate >= #{startDate} | |
| 1597 | + </if> | |
| 1598 | + <if test="endDate != null"> | |
| 1599 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1600 | + </if> | |
| 1601 | + ) tp | |
| 1602 | + INNER JOIN | |
| 1603 | + (SELECT DISTINCT(c.sourceId) as sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and riskLevel = 5 ) | |
| 1604 | + l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1605 | + | |
| 1606 | + </select> | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + <select id="getColorGreenCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1610 | + select count(l.sourceId) as colorGreenCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1611 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1612 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1613 | + <if test="startDate != null"> | |
| 1614 | + and p.bookbuildingDate >= #{startDate} | |
| 1615 | + </if> | |
| 1616 | + <if test="endDate != null"> | |
| 1617 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1618 | + </if> | |
| 1619 | + ) tp | |
| 1620 | + INNER JOIN | |
| 1621 | + (SELECT DISTINCT(c.sourceId) as sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and riskLevel = 1 ) | |
| 1622 | + l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1623 | + | |
| 1624 | + </select> | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + <select id="getOneRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1628 | + select count(l.sourceId) as oneRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1629 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1630 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1631 | + <if test="startDate != null"> | |
| 1632 | + and p.bookbuildingDate >= #{startDate} | |
| 1633 | + </if> | |
| 1634 | + <if test="endDate != null"> | |
| 1635 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1636 | + </if> | |
| 1637 | + ) tp | |
| 1638 | + INNER JOIN | |
| 1639 | + ( | |
| 1640 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel,c.sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid | |
| 1641 | + group by r.foreignId having t=1 and r.type = 2 and r.riskLevel >1 | |
| 1642 | + ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1643 | + </select> | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + <select id="getTwoRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1647 | + select count(l.sourceId) as twoRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1648 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1649 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1650 | + <if test="startDate != null"> | |
| 1651 | + and p.bookbuildingDate >= #{startDate} | |
| 1652 | + </if> | |
| 1653 | + <if test="endDate != null"> | |
| 1654 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1655 | + </if> | |
| 1656 | + ) tp | |
| 1657 | + INNER JOIN | |
| 1658 | + ( | |
| 1659 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel,c.sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid | |
| 1660 | + group by r.foreignId having t=2 and r.type = 2 and r.riskLevel >1 | |
| 1661 | + ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1662 | + </select> | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + <select id="getThreeRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1667 | + select count(l.sourceId) as threeRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1668 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1669 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1670 | + <if test="startDate != null"> | |
| 1671 | + and p.bookbuildingDate >= #{startDate} | |
| 1672 | + </if> | |
| 1673 | + <if test="endDate != null"> | |
| 1674 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1675 | + </if> | |
| 1676 | + ) tp | |
| 1677 | + INNER JOIN | |
| 1678 | + ( | |
| 1679 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel,c.sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid | |
| 1680 | + group by r.foreignId having t=3 and r.type = 2 and r.riskLevel >1 | |
| 1681 | + ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1682 | + </select> | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + <select id="getFourRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1686 | + select count(l.sourceId) as fourRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1687 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1688 | + where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1689 | + <if test="startDate != null"> | |
| 1690 | + and p.bookbuildingDate >= #{startDate} | |
| 1691 | + </if> | |
| 1692 | + <if test="endDate != null"> | |
| 1693 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
| 1694 | + </if> | |
| 1695 | + ) tp | |
| 1696 | + INNER JOIN | |
| 1697 | + ( | |
| 1698 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel,c.sourceId from report_risk_level r LEFT JOIN report_antexchu c on r.foreignId = c.cid | |
| 1699 | + group by r.foreignId having t=4 and r.type = 2 and r.riskLevel >1 | |
| 1700 | + ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1701 | + </select> | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + <!-- --> | |
| 1705 | + | |
| 1706 | + <select id="getCheckOrgCheckPersonCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1707 | + select count(c.sourceId) as checkOrgCheckPersonCount ,o.name from ( | |
| 1708 | + SELECT r.fid as cid,r.pid, r.checkDate,r.sourceId,r.hospitalId from report_antex r where 1=1 | |
| 1709 | + <if test="startDate != null"> | |
| 1710 | + and r.checkDate >= #{startDate} | |
| 1711 | + </if> | |
| 1712 | + <if test="endDate != null"> | |
| 1713 | + and r.checkDate <![CDATA[ <= ]]> #{endDate} | |
| 1714 | + </if> | |
| 1715 | + union | |
| 1716 | + SELECT c.cid as cid,c.pid, c.checkTime as checkDate,c.sourceId,c.hospitalId from report_antexchu c where 1=1 | |
| 1717 | + <if test="startDate != null"> | |
| 1718 | + and c.checkTime >= #{startDate} | |
| 1719 | + </if> | |
| 1720 | + <if test="endDate != null"> | |
| 1721 | + and c.checkTime <![CDATA[ <= ]]> #{endDate} | |
| 1722 | + </if> | |
| 1723 | + | |
| 1724 | + ) c left JOIN report_patients p on c.sourceId = p.patientId | |
| 1725 | + INNER JOIN organization o on c.hospitalId=o.id | |
| 1726 | + where p.type = 1 and p.enable is null and p.hospitalId=#{hospitalId} | |
| 1727 | + GROUP BY o.name | |
| 1728 | + | |
| 1729 | + </select> | |
| 1730 | + <select id="getBeforeBuildCheckPersonCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1731 | + select count(cj.sourceId) as beforeBuildCheckPersonCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1732 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1733 | + where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId} | |
| 1734 | + <if test="startDate != null"> | |
| 1735 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{startDate} | |
| 1736 | + </if> | |
| 1737 | + ) tp | |
| 1738 | + INNER JOIN | |
| 1739 | + (select t.sourceId | |
| 1740 | + from | |
| 1741 | + (SELECT r.fid as cid,r.pid, r.checkDate,r.sourceId from report_antex r where 1 = 1 | |
| 1742 | + <if test="startDate != null"> | |
| 1743 | + and r.checkDate >= #{startDate} | |
| 1744 | + </if> | |
| 1745 | + <if test="endDate != null"> | |
| 1746 | + and r.checkDate <![CDATA[ <= ]]> #{endDate} | |
| 1747 | + </if> | |
| 1748 | + union ALL | |
| 1749 | + SELECT c.cid as cid,c.pid, c.checkTime as checkDate,c.sourceId from report_antexchu c where 1 = 1 | |
| 1750 | + <if test="startDate != null"> | |
| 1751 | + and c.checkTime >= #{startDate} | |
| 1752 | + </if> | |
| 1753 | + <if test="endDate != null"> | |
| 1754 | + and c.checkTime <![CDATA[ <= ]]> #{endDate} | |
| 1755 | + </if> | |
| 1756 | + ) | |
| 1757 | + t GROUP BY t.pid) cj on tp.patientId= cj.sourceId | |
| 1758 | + GROUP BY tp.name | |
| 1759 | + </select> | |
| 1760 | + <select id="getCheckRiskPersonCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1761 | + | |
| 1762 | + </select> | |
| 1763 | + <select id="getCheckColorYellowCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1764 | + | |
| 1765 | + </select> | |
| 1766 | + <select id="getCheckColorOrangeCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1767 | + | |
| 1768 | + </select> | |
| 1769 | + <select id="getCheckColorRedCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1770 | + | |
| 1771 | + </select> | |
| 1772 | + <select id="getCheckColorVioletCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1773 | + | |
| 1774 | + </select> | |
| 1775 | + <select id="getCheckColorGreenCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1776 | + | |
| 1777 | + </select> | |
| 1778 | + <select id="getCheckOneRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1779 | + | |
| 1780 | + </select> | |
| 1781 | + <select id="getCheckTwoRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1782 | + | |
| 1783 | + </select> | |
| 1784 | + <select id="getCheckThreeRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1785 | + | |
| 1786 | + </select> | |
| 1787 | + <select id="getCheckFourRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | |
| 1788 | + | |
| 1789 | + </select> | |
| 1790 | + | |
| 1791 | + | |
| 1473 | 1792 | </mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java
View file @
b3521e7
| ... | ... | @@ -413,5 +413,40 @@ |
| 413 | 413 | return patientSyncMysqlFacade.getAreaCheckCount(time, hospitalId, provinceId, cityId, areaId, loginState.getId()); |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | + | |
| 417 | + /** | |
| 418 | + * 建档高危等级数据统计 | |
| 419 | + * @param request | |
| 420 | + * @param time | |
| 421 | + * @param hospitalId | |
| 422 | + * @return | |
| 423 | + */ | |
| 424 | + @RequestMapping(method = RequestMethod.GET, value = "/getBulidAreaCheckCount") | |
| 425 | + @ResponseBody | |
| 426 | + @TokenRequired | |
| 427 | + public BaseResponse getBulidAreaCheckCount(HttpServletRequest request, | |
| 428 | + @RequestParam(required = false) String time, | |
| 429 | + @RequestParam(required = false) String hospitalId) { | |
| 430 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 431 | + return patientSyncMysqlFacade.getBulidAreaCheckCount(time, hospitalId, loginState.getId()); | |
| 432 | + } | |
| 433 | + | |
| 434 | + | |
| 435 | + /** | |
| 436 | + * 产检高危等级数据统计 | |
| 437 | + * @param request | |
| 438 | + * @param time | |
| 439 | + * @param hospitalId | |
| 440 | + * @return | |
| 441 | + */ | |
| 442 | + @RequestMapping(method = RequestMethod.GET, value = "/getCheckAreaCheckCount") | |
| 443 | + @ResponseBody | |
| 444 | + @TokenRequired | |
| 445 | + public BaseResponse getCheckAreaCheckCount(HttpServletRequest request, | |
| 446 | + @RequestParam(required = false) String time, | |
| 447 | + @RequestParam(required = false) String hospitalId) { | |
| 448 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 449 | + return patientSyncMysqlFacade.getCheckAreaCheckCount(time, hospitalId, loginState.getId()); | |
| 450 | + } | |
| 416 | 451 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientSyncMysqlFacade.java
View file @
b3521e7
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | 5 | import com.lyms.platform.common.enums.*; |
| 6 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 7 | +import com.lyms.platform.common.result.BaseResponse; | |
| 7 | 8 | import com.lyms.platform.common.utils.DateUtil; |
| 8 | 9 | import com.lyms.platform.common.utils.ExceptionUtils; |
| 9 | 10 | import com.lyms.platform.common.utils.JsonUtil; |
| ... | ... | @@ -1766,5 +1767,358 @@ |
| 1766 | 1767 | return 0; |
| 1767 | 1768 | } |
| 1768 | 1769 | |
| 1770 | + public BaseResponse getBulidAreaCheckCount(String time, String hid, Integer id) { | |
| 1771 | + | |
| 1772 | + Date startDate = null; | |
| 1773 | + Date endDate = null; | |
| 1774 | + if (StringUtils.isNotEmpty(time)) | |
| 1775 | + { | |
| 1776 | + String[] arrs = time.split(" - "); | |
| 1777 | + startDate = DateUtil.parseYMD(arrs[0]); | |
| 1778 | + endDate = DateUtil.parseYMD(arrs[1]); | |
| 1779 | + } | |
| 1780 | + | |
| 1781 | + Map param = new HashMap(); | |
| 1782 | + param.put("startDate",startDate); | |
| 1783 | + param.put("endDate",endDate); | |
| 1784 | + param.put("hospitalId",hid); | |
| 1785 | + | |
| 1786 | + List<Map<String,String>> orgCheckPersonCounts = mysqlAntexcService.getOrgCheckPersonCounts(param); | |
| 1787 | + List<Map<String,String>> orgCheckNumCounts = mysqlAntexcService.getOrgCheckNumCounts(param); | |
| 1788 | + List<Map<String,String>> riskPersonCounts = mysqlAntexcService.getRiskPersonCounts(param); | |
| 1789 | + List<Map<String,String>> colorYellowCounts = mysqlAntexcService.getColorYellowCounts(param); | |
| 1790 | + List<Map<String,String>> colorOrangeCounts = mysqlAntexcService.getColorOrangeCounts(param); | |
| 1791 | + List<Map<String,String>> colorRedCounts = mysqlAntexcService.getColorRedCounts(param); | |
| 1792 | + List<Map<String,String>> colorVioletCounts = mysqlAntexcService.getColorVioletCounts(param); | |
| 1793 | + List<Map<String,String>> colorGreenCounts = mysqlAntexcService.getColorGreenCounts(param); | |
| 1794 | + | |
| 1795 | + List<Map<String,String>> oneRiskCounts = mysqlAntexcService.getOneRiskCounts(param); | |
| 1796 | + List<Map<String,String>> twoRiskCounts = mysqlAntexcService.getTwoRiskCounts(param); | |
| 1797 | + List<Map<String,String>> threeRiskCounts = mysqlAntexcService.getThreeRiskCounts(param); | |
| 1798 | + List<Map<String,String>> fourRiskCounts = mysqlAntexcService.getFourRiskCounts(param); | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + if (CollectionUtils.isNotEmpty(orgCheckPersonCounts)) { | |
| 1802 | + | |
| 1803 | + for (Map<String, String> map : orgCheckPersonCounts) { | |
| 1804 | + String hospitalName = map.get("hospitalName"); | |
| 1805 | + String hospitalId = map.get("hospitalId"); | |
| 1806 | + | |
| 1807 | + map.put("hospitalName", hospitalName); | |
| 1808 | + map.put("hospitalId", hospitalId); | |
| 1809 | + | |
| 1810 | + //机构产检人次 | |
| 1811 | + String orgCheckNumCount = "0"; | |
| 1812 | + if (CollectionUtils.isNotEmpty(orgCheckNumCounts)) { | |
| 1813 | + for (Map<String, String> checkData : orgCheckNumCounts) { | |
| 1814 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1815 | + orgCheckNumCount = String.valueOf(checkData.get("orgCheckNumCount")); | |
| 1816 | + break; | |
| 1817 | + } | |
| 1818 | + } | |
| 1819 | + } | |
| 1820 | + map.put("orgCheckNumCount", orgCheckNumCount); | |
| 1821 | + | |
| 1822 | + //高危人数 | |
| 1823 | + String riskPersonCount = "0"; | |
| 1824 | + if (CollectionUtils.isNotEmpty(riskPersonCounts)) { | |
| 1825 | + for (Map<String, String> checkData : riskPersonCounts) { | |
| 1826 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1827 | + riskPersonCount = String.valueOf(checkData.get("riskPersonCount")); | |
| 1828 | + break; | |
| 1829 | + } | |
| 1830 | + } | |
| 1831 | + } | |
| 1832 | + map.put("riskPersonCount", riskPersonCount); | |
| 1833 | + | |
| 1834 | + //黄色人数 | |
| 1835 | + String colorYellowCount = "0"; | |
| 1836 | + if (CollectionUtils.isNotEmpty(colorYellowCounts)) { | |
| 1837 | + for (Map<String, String> checkData : colorYellowCounts) { | |
| 1838 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1839 | + colorYellowCount = String.valueOf(checkData.get("colorYellowCount")); | |
| 1840 | + break; | |
| 1841 | + } | |
| 1842 | + } | |
| 1843 | + } | |
| 1844 | + map.put("colorYellowCount", colorYellowCount); | |
| 1845 | + | |
| 1846 | + //橙色 | |
| 1847 | + String colorOrangeCount = "0"; | |
| 1848 | + if (CollectionUtils.isNotEmpty(colorOrangeCounts)) { | |
| 1849 | + for (Map<String, String> checkData : colorOrangeCounts) { | |
| 1850 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1851 | + colorOrangeCount = String.valueOf(checkData.get("colorOrangeCount")); | |
| 1852 | + break; | |
| 1853 | + } | |
| 1854 | + } | |
| 1855 | + } | |
| 1856 | + map.put("colorOrangeCount", colorOrangeCount); | |
| 1857 | + | |
| 1858 | + //红色 | |
| 1859 | + String colorRedCount = "0"; | |
| 1860 | + if (CollectionUtils.isNotEmpty(colorRedCounts)) { | |
| 1861 | + for (Map<String, String> checkData : colorRedCounts) { | |
| 1862 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1863 | + colorRedCount = String.valueOf(checkData.get("colorRedCount")); | |
| 1864 | + break; | |
| 1865 | + } | |
| 1866 | + } | |
| 1867 | + } | |
| 1868 | + map.put("colorRedCount", colorRedCount); | |
| 1869 | + | |
| 1870 | + String colorVioletCount = "0"; | |
| 1871 | + if (CollectionUtils.isNotEmpty(colorVioletCounts)) { | |
| 1872 | + for (Map<String, String> checkData : colorVioletCounts) { | |
| 1873 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1874 | + colorVioletCount = String.valueOf(checkData.get("colorVioletCount")); | |
| 1875 | + break; | |
| 1876 | + } | |
| 1877 | + } | |
| 1878 | + } | |
| 1879 | + map.put("colorVioletCount", colorVioletCount); | |
| 1880 | + | |
| 1881 | + String colorGreenCount = "0"; | |
| 1882 | + if (CollectionUtils.isNotEmpty(colorGreenCounts)) { | |
| 1883 | + for (Map<String, String> checkData : colorGreenCounts) { | |
| 1884 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1885 | + colorGreenCount = String.valueOf(checkData.get("colorGreenCount")); | |
| 1886 | + break; | |
| 1887 | + } | |
| 1888 | + } | |
| 1889 | + } | |
| 1890 | + map.put("colorGreenCount", colorGreenCount); | |
| 1891 | + | |
| 1892 | + String oneRiskCount = "0"; | |
| 1893 | + if (CollectionUtils.isNotEmpty(oneRiskCounts)) { | |
| 1894 | + for (Map<String, String> checkData : oneRiskCounts) { | |
| 1895 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1896 | + oneRiskCount = String.valueOf(checkData.get("oneRiskCount")); | |
| 1897 | + break; | |
| 1898 | + } | |
| 1899 | + } | |
| 1900 | + } | |
| 1901 | + map.put("oneRiskCount", oneRiskCount); | |
| 1902 | + | |
| 1903 | + String twoRiskCount = "0"; | |
| 1904 | + if (CollectionUtils.isNotEmpty(twoRiskCounts)) { | |
| 1905 | + for (Map<String, String> checkData : twoRiskCounts) { | |
| 1906 | + if (hospitalName.equals(checkData.get("hospitalId"))) { | |
| 1907 | + twoRiskCount = String.valueOf(checkData.get("twoRiskCount")); | |
| 1908 | + break; | |
| 1909 | + } | |
| 1910 | + } | |
| 1911 | + } | |
| 1912 | + map.put("twoRiskCount", twoRiskCount); | |
| 1913 | + | |
| 1914 | + String threeRiskCount = "0"; | |
| 1915 | + if (CollectionUtils.isNotEmpty(threeRiskCounts)) { | |
| 1916 | + for (Map<String, String> checkData : threeRiskCounts) { | |
| 1917 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1918 | + threeRiskCount = String.valueOf(checkData.get("threeRiskCount")); | |
| 1919 | + break; | |
| 1920 | + } | |
| 1921 | + } | |
| 1922 | + } | |
| 1923 | + map.put("threeRiskCount", threeRiskCount); | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + String fourRiskCount = "0"; | |
| 1927 | + if (CollectionUtils.isNotEmpty(fourRiskCounts)) { | |
| 1928 | + for (Map<String, String> checkData : fourRiskCounts) { | |
| 1929 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1930 | + fourRiskCount = String.valueOf(checkData.get("fourRiskCount")); | |
| 1931 | + break; | |
| 1932 | + } | |
| 1933 | + } | |
| 1934 | + } | |
| 1935 | + map.put("fourRiskCount", fourRiskCount); | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + } | |
| 1939 | + } | |
| 1940 | + | |
| 1941 | + Map<String, Object> data = new HashMap<>(); | |
| 1942 | + data.put("list", orgCheckPersonCounts); | |
| 1943 | + | |
| 1944 | + return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data); | |
| 1945 | + } | |
| 1946 | + | |
| 1947 | + public BaseResponse getCheckAreaCheckCount(String time, String hid, Integer id) { | |
| 1948 | + | |
| 1949 | + Date startDate = null; | |
| 1950 | + Date endDate = null; | |
| 1951 | + if (StringUtils.isNotEmpty(time)) | |
| 1952 | + { | |
| 1953 | + String[] arrs = time.split(" - "); | |
| 1954 | + startDate = DateUtil.parseYMD(arrs[0]); | |
| 1955 | + endDate = DateUtil.parseYMD(arrs[1]); | |
| 1956 | + } | |
| 1957 | + | |
| 1958 | + Map param = new HashMap(); | |
| 1959 | + param.put("startDate",startDate); | |
| 1960 | + param.put("endDate",endDate); | |
| 1961 | + param.put("hospitalId",hid); | |
| 1962 | + | |
| 1963 | + List<Map<String,String>> checkOrgCheckPersonCounts = mysqlAntexcService.getCheckOrgCheckPersonCounts(param); | |
| 1964 | + List<Map<String,String>> beforeBuildCheckPersonCounts = mysqlAntexcService.getBeforeBuildCheckPersonCounts(param); | |
| 1965 | + List<Map<String,String>> checkRiskPersonCounts = mysqlAntexcService.getCheckRiskPersonCounts(param); | |
| 1966 | + List<Map<String,String>> checkColorYellowCounts = mysqlAntexcService.getCheckColorYellowCounts(param); | |
| 1967 | + List<Map<String,String>> checkColorOrangeCounts = mysqlAntexcService.getCheckColorOrangeCounts(param); | |
| 1968 | + List<Map<String,String>> checkColorRedCounts = mysqlAntexcService.getCheckColorRedCounts(param); | |
| 1969 | + List<Map<String,String>> checkColorVioletCounts = mysqlAntexcService.getCheckColorVioletCounts(param); | |
| 1970 | + List<Map<String,String>> checkColorGreenCounts = mysqlAntexcService.getCheckColorGreenCounts(param); | |
| 1971 | + | |
| 1972 | + List<Map<String,String>> checkOneRiskCounts = mysqlAntexcService.getCheckOneRiskCounts(param); | |
| 1973 | + List<Map<String,String>> checkTwoRiskCounts = mysqlAntexcService.getCheckTwoRiskCounts(param); | |
| 1974 | + List<Map<String,String>> checkThreeRiskCounts = mysqlAntexcService.getCheckThreeRiskCounts(param); | |
| 1975 | + List<Map<String,String>> checkFourRiskCounts = mysqlAntexcService.getCheckFourRiskCounts(param); | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + if (CollectionUtils.isNotEmpty(checkOrgCheckPersonCounts)) { | |
| 1979 | + | |
| 1980 | + for (Map<String, String> map : checkOrgCheckPersonCounts) { | |
| 1981 | + String hospitalName = map.get("hospitalName"); | |
| 1982 | + String hospitalId = map.get("hospitalId"); | |
| 1983 | + | |
| 1984 | + map.put("hospitalName", hospitalName); | |
| 1985 | + map.put("hospitalId", hospitalId); | |
| 1986 | + | |
| 1987 | + //之前建档的产检人数 | |
| 1988 | + String beforeBuildCheckPersonCount = "0"; | |
| 1989 | + if (CollectionUtils.isNotEmpty(beforeBuildCheckPersonCounts)) { | |
| 1990 | + for (Map<String, String> checkData : beforeBuildCheckPersonCounts) { | |
| 1991 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 1992 | + beforeBuildCheckPersonCount = String.valueOf(checkData.get("beforeBuildCheckPersonCount")); | |
| 1993 | + break; | |
| 1994 | + } | |
| 1995 | + } | |
| 1996 | + } | |
| 1997 | + map.put("beforeBuildCheckPersonCount", beforeBuildCheckPersonCount); | |
| 1998 | + | |
| 1999 | + //高危人数 | |
| 2000 | + String checkRiskPersonCount = "0"; | |
| 2001 | + if (CollectionUtils.isNotEmpty(checkRiskPersonCounts)) { | |
| 2002 | + for (Map<String, String> checkData : checkRiskPersonCounts) { | |
| 2003 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2004 | + checkRiskPersonCount = String.valueOf(checkData.get("checkRiskPersonCount")); | |
| 2005 | + break; | |
| 2006 | + } | |
| 2007 | + } | |
| 2008 | + } | |
| 2009 | + map.put("checkRiskPersonCount", checkRiskPersonCount); | |
| 2010 | + | |
| 2011 | + //黄色人数 | |
| 2012 | + String checkColorYellowCount = "0"; | |
| 2013 | + if (CollectionUtils.isNotEmpty(checkColorYellowCounts)) { | |
| 2014 | + for (Map<String, String> checkData : checkColorYellowCounts) { | |
| 2015 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2016 | + checkColorYellowCount = String.valueOf(checkData.get("checkColorYellowCount")); | |
| 2017 | + break; | |
| 2018 | + } | |
| 2019 | + } | |
| 2020 | + } | |
| 2021 | + map.put("checkColorYellowCount", checkColorYellowCount); | |
| 2022 | + | |
| 2023 | + //橙色 | |
| 2024 | + String checkColorOrangeCount = "0"; | |
| 2025 | + if (CollectionUtils.isNotEmpty(checkColorOrangeCounts)) { | |
| 2026 | + for (Map<String, String> checkData : checkColorOrangeCounts) { | |
| 2027 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2028 | + checkColorOrangeCount = String.valueOf(checkData.get("checkColorOrangeCount")); | |
| 2029 | + break; | |
| 2030 | + } | |
| 2031 | + } | |
| 2032 | + } | |
| 2033 | + map.put("checkColorOrangeCount", checkColorOrangeCount); | |
| 2034 | + | |
| 2035 | + //红色 | |
| 2036 | + String checkColorRedCount = "0"; | |
| 2037 | + if (CollectionUtils.isNotEmpty( checkColorRedCounts)) { | |
| 2038 | + for (Map<String, String> checkData : checkColorRedCounts) { | |
| 2039 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2040 | + checkColorRedCount = String.valueOf(checkData.get("checkColorRedCount")); | |
| 2041 | + break; | |
| 2042 | + } | |
| 2043 | + } | |
| 2044 | + } | |
| 2045 | + map.put("checkColorRedCount", checkColorRedCount); | |
| 2046 | + | |
| 2047 | + String checkColorVioletCount = "0"; | |
| 2048 | + if (CollectionUtils.isNotEmpty(checkColorVioletCounts)) { | |
| 2049 | + for (Map<String, String> checkData : checkColorVioletCounts) { | |
| 2050 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2051 | + checkColorVioletCount = String.valueOf(checkData.get("checkColorVioletCount")); | |
| 2052 | + break; | |
| 2053 | + } | |
| 2054 | + } | |
| 2055 | + } | |
| 2056 | + map.put("checkColorVioletCount", checkColorVioletCount); | |
| 2057 | + | |
| 2058 | + String checkColorGreenCount = "0"; | |
| 2059 | + if (CollectionUtils.isNotEmpty(checkColorGreenCounts)) { | |
| 2060 | + for (Map<String, String> checkData : checkColorGreenCounts) { | |
| 2061 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2062 | + checkColorGreenCount = String.valueOf(checkData.get("checkColorGreenCount")); | |
| 2063 | + break; | |
| 2064 | + } | |
| 2065 | + } | |
| 2066 | + } | |
| 2067 | + map.put("checkColorGreenCount", checkColorGreenCount); | |
| 2068 | + | |
| 2069 | + String checkOneRiskCount = "0"; | |
| 2070 | + if (CollectionUtils.isNotEmpty(checkOneRiskCounts)) { | |
| 2071 | + for (Map<String, String> checkData : checkOneRiskCounts) { | |
| 2072 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2073 | + checkOneRiskCount = String.valueOf(checkData.get("checkOneRiskCount")); | |
| 2074 | + break; | |
| 2075 | + } | |
| 2076 | + } | |
| 2077 | + } | |
| 2078 | + map.put("checkOneRiskCount", checkOneRiskCount); | |
| 2079 | + | |
| 2080 | + String checkTwoRiskCount = "0"; | |
| 2081 | + if (CollectionUtils.isNotEmpty(checkTwoRiskCounts)) { | |
| 2082 | + for (Map<String, String> checkData : checkTwoRiskCounts) { | |
| 2083 | + if (hospitalName.equals(checkData.get("hospitalId"))) { | |
| 2084 | + checkTwoRiskCount = String.valueOf(checkData.get("checkTwoRiskCount")); | |
| 2085 | + break; | |
| 2086 | + } | |
| 2087 | + } | |
| 2088 | + } | |
| 2089 | + map.put("checkTwoRiskCount", checkTwoRiskCount); | |
| 2090 | + | |
| 2091 | + String checkThreeRiskCount = "0"; | |
| 2092 | + if (CollectionUtils.isNotEmpty(checkThreeRiskCounts)) { | |
| 2093 | + for (Map<String, String> checkData : checkThreeRiskCounts) { | |
| 2094 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2095 | + checkThreeRiskCount = String.valueOf(checkData.get("checkThreeRiskCount")); | |
| 2096 | + break; | |
| 2097 | + } | |
| 2098 | + } | |
| 2099 | + } | |
| 2100 | + map.put("checkThreeRiskCount", checkThreeRiskCount); | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + String checkFourRiskCount = "0"; | |
| 2104 | + if (CollectionUtils.isNotEmpty(checkFourRiskCounts)) { | |
| 2105 | + for (Map<String, String> checkData : checkFourRiskCounts) { | |
| 2106 | + if (hospitalId.equals(checkData.get("hospitalId"))) { | |
| 2107 | + checkFourRiskCount = String.valueOf(checkData.get("checkFourRiskCount")); | |
| 2108 | + break; | |
| 2109 | + } | |
| 2110 | + } | |
| 2111 | + } | |
| 2112 | + map.put("checkFourRiskCount", checkFourRiskCount); | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + } | |
| 2116 | + } | |
| 2117 | + | |
| 2118 | + Map<String, Object> data = new HashMap<>(); | |
| 2119 | + data.put("list", checkOrgCheckPersonCounts); | |
| 2120 | + | |
| 2121 | + return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data); | |
| 2122 | + } | |
| 1769 | 2123 | } |