Commit 79ec28d5882efc5cdab4b30158fc4b044acef478
1 parent
55017a307b
Exists in
master
and in
6 other branches
update
Showing 5 changed files with 170 additions and 79 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/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/TestController.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 @
79ec28d
| ... | ... | @@ -11,15 +11,8 @@ | 
| 11 | 11 | public interface MasterMysqlAntexcMapper { | 
| 12 | 12 | void saveMysqlAntexc(MysqlAntexc model); | 
| 13 | 13 | |
| 14 | - | |
| 15 | - | |
| 16 | 14 | void deleteMysqlAntexc(MysqlAntexc model); | 
| 17 | - | |
| 18 | - | |
| 19 | 15 | void saveMysqlAntex(MysqlAntex model); | 
| 20 | - | |
| 21 | - | |
| 22 | - | |
| 23 | 16 | void deleteMysqlAntex(MysqlAntex model); | 
| 24 | 17 | |
| 25 | 18 | void addRisk(MysqlRisk model); | 
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MysqlAntexcServiceImpl.java
View file @
79ec28d
| ... | ... | @@ -149,13 +149,11 @@ | 
| 149 | 149 | { | 
| 150 | 150 | masterMysqlAntexcMapper.deleteRiskLevelToMysql(reportRiskLevel); | 
| 151 | 151 | } | 
| 152 | - | |
| 153 | 152 | @Override | 
| 154 | 153 | public void saveRiskLevelToMysql(ReportRiskLevel reportRiskLevel) | 
| 155 | 154 | { | 
| 156 | 155 | masterMysqlAntexcMapper.saveRiskLevelToMysql(reportRiskLevel); | 
| 157 | 156 | } | 
| 158 | - | |
| 159 | 157 | @Override | 
| 160 | 158 | public List<Map<String,Object>> getBuildCount(Map param) { | 
| 161 | 159 | return masterMysqlAntexcMapper.getBuildCount(param); | 
platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml
View file @
79ec28d
| ... | ... | @@ -1292,8 +1292,9 @@ | 
| 1292 | 1292 | |
| 1293 | 1293 | |
| 1294 | 1294 | <select id="getBulidCheckPersonCount" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1295 | - SELECT count(DISTINCT(r.sourceId)) as bulidCheckPersonCount from report_patients p | |
| 1295 | + SELECT count(DISTINCT(r.sourceId)) as bulidCheckPersonCount,o.name as hospitalName from report_patients p | |
| 1296 | 1296 | INNER JOIN report_antexchu r on p.patientId = r.sourceId | 
| 1297 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1297 | 1298 | where p.type=1 and p.enable is NULL | 
| 1298 | 1299 | <if test="hospitalId != null and hospitalId != ''"> | 
| 1299 | 1300 | and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | 
| 1300 | 1301 | |
| 1301 | 1302 | |
| 1302 | 1303 | |
| ... | ... | @@ -1304,13 +1305,23 @@ | 
| 1304 | 1305 | <if test="endDate != null"> | 
| 1305 | 1306 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1306 | 1307 | </if> | 
| 1308 | + <if test="provinceId != null and provinceId != ''"> | |
| 1309 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
| 1310 | + </if> | |
| 1311 | + <if test="cityId != null and cityId != ''"> | |
| 1312 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
| 1313 | + </if> | |
| 1314 | + <if test="areaId != null and areaId != ''"> | |
| 1315 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
| 1316 | + </if> | |
| 1317 | + GROUP BY o.name | |
| 1307 | 1318 | |
| 1308 | - | |
| 1309 | 1319 | </select> | 
| 1310 | 1320 | |
| 1311 | 1321 | <select id="getBulidCheckNumCount" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1312 | - SELECT count(r.sourceId) as bulidCheckNumCount from report_patients p | |
| 1322 | + SELECT count(r.sourceId) as bulidCheckNumCount,o.name as hospitalName from report_patients p | |
| 1313 | 1323 | INNER JOIN report_antexchu r on p.patientId = r.sourceId | 
| 1324 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1314 | 1325 | where p.type=1 and p.enable is NULL | 
| 1315 | 1326 | <if test="hospitalId != null and hospitalId != ''"> | 
| 1316 | 1327 | and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | 
| 1317 | 1328 | |
| 1318 | 1329 | |
| ... | ... | @@ -1321,10 +1332,21 @@ | 
| 1321 | 1332 | <if test="endDate != null"> | 
| 1322 | 1333 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1323 | 1334 | </if> | 
| 1335 | + <if test="provinceId != null and provinceId != ''"> | |
| 1336 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
| 1337 | + </if> | |
| 1338 | + <if test="cityId != null and cityId != ''"> | |
| 1339 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
| 1340 | + </if> | |
| 1341 | + <if test="areaId != null and areaId != ''"> | |
| 1342 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
| 1343 | + </if> | |
| 1344 | + GROUP BY o.name | |
| 1324 | 1345 | </select> | 
| 1325 | 1346 | <select id="getCheckPersonCount" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1326 | - SELECT count(DISTINCT(r.sourceId)) as checkPersonCount from report_patients p | |
| 1347 | + SELECT count(DISTINCT(r.sourceId)) as checkPersonCount,o.name as hospitalName from report_patients p | |
| 1327 | 1348 | INNER JOIN report_antexchu r on p.patientId = r.sourceId | 
| 1349 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1328 | 1350 | where p.type=1 and p.enable is NULL | 
| 1329 | 1351 | |
| 1330 | 1352 | <if test="hospitalId != null and hospitalId != ''"> | 
| 1331 | 1353 | |
| 1332 | 1354 | |
| ... | ... | @@ -1336,11 +1358,22 @@ | 
| 1336 | 1358 | <if test="endDate != null"> | 
| 1337 | 1359 | and r.checkTime <![CDATA[ <= ]]> #{endDate} | 
| 1338 | 1360 | </if> | 
| 1361 | + <if test="provinceId != null and provinceId != ''"> | |
| 1362 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
| 1363 | + </if> | |
| 1364 | + <if test="cityId != null and cityId != ''"> | |
| 1365 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
| 1366 | + </if> | |
| 1367 | + <if test="areaId != null and areaId != ''"> | |
| 1368 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
| 1369 | + </if> | |
| 1370 | + GROUP BY o.name | |
| 1339 | 1371 | </select> | 
| 1340 | 1372 | |
| 1341 | 1373 | <select id="getMatDeliverCount" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1342 | - select count(m.sourceId) as matDeliverCount from report_matdeliver m | |
| 1374 | + select count(m.sourceId) as matDeliverCount,o.name as hospitalName from report_matdeliver m | |
| 1343 | 1375 | INNER JOIN report_patients p on m.sourceId=p.patientId | 
| 1376 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1344 | 1377 | where p.type =3 and p.enable is NULL | 
| 1345 | 1378 | <if test="hospitalId != null and hospitalId != ''"> | 
| 1346 | 1379 | and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | 
| 1347 | 1380 | |
| ... | ... | @@ -1351,10 +1384,21 @@ | 
| 1351 | 1384 | <if test="endDate != null"> | 
| 1352 | 1385 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1353 | 1386 | </if> | 
| 1387 | + <if test="provinceId != null and provinceId != ''"> | |
| 1388 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
| 1389 | + </if> | |
| 1390 | + <if test="cityId != null and cityId != ''"> | |
| 1391 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
| 1392 | + </if> | |
| 1393 | + <if test="areaId != null and areaId != ''"> | |
| 1394 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
| 1395 | + </if> | |
| 1396 | + GROUP BY o.name | |
| 1354 | 1397 | </select> | 
| 1355 | 1398 | |
| 1356 | 1399 | <select id="getLiveCount" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1357 | - select count(p.patientId) as liveCount from report_patients p | |
| 1400 | + select count(p.patientId) as liveCount,o.name as hospitalName from report_patients p | |
| 1401 | + INNER JOIN organization o on p.hospitalId=o.id | |
| 1358 | 1402 | where p.pliveTypeId='57624c5e0cf23d4631523ea2' and p.enable is NULL | 
| 1359 | 1403 | <if test="hospitalId != null and hospitalId != ''"> | 
| 1360 | 1404 | and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | 
| ... | ... | @@ -1365,7 +1409,16 @@ | 
| 1365 | 1409 | <if test="endDate != null"> | 
| 1366 | 1410 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1367 | 1411 | </if> | 
| 1368 | - | |
| 1412 | + <if test="provinceId != null and provinceId != ''"> | |
| 1413 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
| 1414 | + </if> | |
| 1415 | + <if test="cityId != null and cityId != ''"> | |
| 1416 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
| 1417 | + </if> | |
| 1418 | + <if test="areaId != null and areaId != ''"> | |
| 1419 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
| 1420 | + </if> | |
| 1421 | + GROUP BY o.name | |
| 1369 | 1422 | </select> | 
| 1370 | 1423 | |
| 1371 | 1424 | |
| 1372 | 1425 | |
| ... | ... | @@ -1423,10 +1476,10 @@ | 
| 1423 | 1476 | </if> | 
| 1424 | 1477 | ) tp | 
| 1425 | 1478 | INNER JOIN | 
| 1426 | - (SELECT c.sourceId as sourceId,c.hospitalId from report_risk_level r | |
| 1427 | - INNER JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and c.type=1 and riskLevel > 1 ) | |
| 1428 | - l on tp.patientId=l.sourceId | |
| 1479 | + report_antexchu l on tp.patientId=l.sourceId | |
| 1480 | + INNER JOIN report_risk_level r on r.foreignId = l.cid | |
| 1429 | 1481 | INNER JOIN organization o on l.hospitalId=o.id | 
| 1482 | + where r.type = 2 and c.type=1 and riskLevel > 1 | |
| 1430 | 1483 | GROUP BY o.name | 
| 1431 | 1484 | </select> | 
| 1432 | 1485 | |
| ... | ... | @@ -1445,10 +1498,11 @@ | 
| 1445 | 1498 | </if> | 
| 1446 | 1499 | ) tp | 
| 1447 | 1500 | INNER JOIN | 
| 1448 | - (SELECT DISTINCT(c.sourceId) as sourceId ,c.hospitalId from report_risk_level r | |
| 1449 | - INNER JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and c.type=1 and riskLevel = 2 ) | |
| 1450 | - l on tp.patientId=l.sourceId | |
| 1451 | - INNER JOIN organization o on l.hospitalId=o.id GROUP BY o.name | |
| 1501 | + report_antexchu l on tp.patientId=l.sourceId | |
| 1502 | + INNER JOIN report_risk_level r on r.foreignId = l.cid | |
| 1503 | + INNER JOIN organization o on l.hospitalId=o.id | |
| 1504 | + where r.type = 2 and c.type=1 and riskLevel = 2 | |
| 1505 | + GROUP BY o.name | |
| 1452 | 1506 | </select> | 
| 1453 | 1507 | <select id="getColorOrangeCounts" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1454 | 1508 | |
| ... | ... | @@ -1466,10 +1520,11 @@ | 
| 1466 | 1520 | </if> | 
| 1467 | 1521 | ) tp | 
| 1468 | 1522 | INNER JOIN | 
| 1469 | - (SELECT DISTINCT(c.sourceId) as sourceId ,c.hospitalId from report_risk_level r | |
| 1470 | - INNER JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and c.type=1 and riskLevel = 3 ) | |
| 1471 | - l on tp.patientId=l.sourceId | |
| 1472 | - INNER JOIN organization o on l.hospitalId=o.id GROUP BY o.name | |
| 1523 | + report_antexchu l on tp.patientId=l.sourceId | |
| 1524 | + INNER JOIN report_risk_level r on r.foreignId = l.cid | |
| 1525 | + INNER JOIN organization o on l.hospitalId=o.id | |
| 1526 | + where r.type = 2 and c.type=1 and riskLevel = 3 | |
| 1527 | + GROUP BY o.name | |
| 1473 | 1528 | |
| 1474 | 1529 | </select> | 
| 1475 | 1530 | |
| ... | ... | @@ -1489,10 +1544,11 @@ | 
| 1489 | 1544 | </if> | 
| 1490 | 1545 | ) tp | 
| 1491 | 1546 | INNER JOIN | 
| 1492 | - (SELECT DISTINCT(c.sourceId) as sourceId ,c.hospitalId from report_risk_level r | |
| 1493 | - INNER JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and c.type=1 and riskLevel = 4 ) | |
| 1494 | - l on tp.patientId=l.sourceId | |
| 1495 | - INNER JOIN organization o on l.hospitalId=o.id GROUP BY o.name | |
| 1547 | + report_antexchu l on tp.patientId=l.sourceId | |
| 1548 | + INNER JOIN report_risk_level r on r.foreignId = l.cid | |
| 1549 | + INNER JOIN organization o on l.hospitalId=o.id | |
| 1550 | + where r.type = 2 and c.type=1 and riskLevel = 4 | |
| 1551 | + GROUP BY o.name | |
| 1496 | 1552 | |
| 1497 | 1553 | |
| 1498 | 1554 | </select> | 
| ... | ... | @@ -1515,10 +1571,11 @@ | 
| 1515 | 1571 | </if> | 
| 1516 | 1572 | ) tp | 
| 1517 | 1573 | INNER JOIN | 
| 1518 | - (SELECT DISTINCT(c.sourceId) as sourceId ,c.hospitalId from report_risk_level r | |
| 1519 | - INNER JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and c.type=1 and riskLevel = 5 ) | |
| 1520 | - l on tp.patientId=l.sourceId | |
| 1521 | - INNER JOIN organization o on l.hospitalId=o.id GROUP BY o.name | |
| 1574 | + report_antexchu l on tp.patientId=l.sourceId | |
| 1575 | + INNER JOIN report_risk_level r on r.foreignId = l.cid | |
| 1576 | + INNER JOIN organization o on l.hospitalId=o.id | |
| 1577 | + where r.type = 2 and c.type=1 and riskLevel = 5 | |
| 1578 | + GROUP BY o.name | |
| 1522 | 1579 | |
| 1523 | 1580 | </select> | 
| 1524 | 1581 | |
| 1525 | 1582 | |
| 1526 | 1583 | |
| ... | ... | @@ -1539,16 +1596,17 @@ | 
| 1539 | 1596 | </if> | 
| 1540 | 1597 | ) tp | 
| 1541 | 1598 | INNER JOIN | 
| 1542 | - (SELECT DISTINCT(c.sourceId) as sourceId ,c.hospitalId from report_risk_level r | |
| 1543 | - INNER JOIN report_antexchu c on r.foreignId = c.cid where r.type = 2 and c.type=1 and riskLevel = 1 ) | |
| 1544 | - l on tp.patientId=l.sourceId | |
| 1545 | - INNER JOIN organization o on l.hospitalId=o.id GROUP BY o.name | |
| 1599 | + report_antexchu l on tp.patientId=l.sourceId | |
| 1600 | + INNER JOIN report_risk_level r on r.foreignId = l.cid | |
| 1601 | + INNER JOIN organization o on l.hospitalId=o.id | |
| 1602 | + where r.type = 2 and c.type=1 and riskLevel = 1 | |
| 1603 | + GROUP BY o.name | |
| 1546 | 1604 | </select> | 
| 1547 | 1605 | |
| 1548 | 1606 | <select id="getOneRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1549 | - 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 | |
| 1607 | + select count(a.sourceId) as oneRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1550 | 1608 | INNER JOIN organization o on p.hospitalId=o.id | 
| 1551 | - where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1609 | + where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId} | |
| 1552 | 1610 | <if test="startDate != null"> | 
| 1553 | 1611 | and p.bookbuildingDate >= #{startDate} | 
| 1554 | 1612 | </if> | 
| 1555 | 1613 | |
| 1556 | 1614 | |
| 1557 | 1615 | |
| ... | ... | @@ -1556,18 +1614,20 @@ | 
| 1556 | 1614 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1557 | 1615 | </if> | 
| 1558 | 1616 | ) tp | 
| 1617 | + INNER JOIN report_antexchu a | |
| 1618 | + on tp.patientId=a.sourceId | |
| 1559 | 1619 | INNER JOIN | 
| 1560 | 1620 | ( | 
| 1561 | - 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 | |
| 1562 | - group by r.foreignId having t=1 and r.type = 2 and r.riskLevel >1 | |
| 1563 | - ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1621 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r | |
| 1622 | + where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=1 | |
| 1623 | + ) l on l.foreignId = a.cid GROUP BY tp.name | |
| 1564 | 1624 | </select> | 
| 1565 | 1625 | |
| 1566 | 1626 | |
| 1567 | 1627 | <select id="getTwoRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1568 | - 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 | |
| 1628 | + select count(a.sourceId) as twoRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1569 | 1629 | INNER JOIN organization o on p.hospitalId=o.id | 
| 1570 | - where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1630 | + where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId} | |
| 1571 | 1631 | <if test="startDate != null"> | 
| 1572 | 1632 | and p.bookbuildingDate >= #{startDate} | 
| 1573 | 1633 | </if> | 
| 1574 | 1634 | |
| 1575 | 1635 | |
| 1576 | 1636 | |
| ... | ... | @@ -1575,19 +1635,23 @@ | 
| 1575 | 1635 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1576 | 1636 | </if> | 
| 1577 | 1637 | ) tp | 
| 1638 | + INNER JOIN report_antexchu a | |
| 1639 | + on tp.patientId=a.sourceId | |
| 1578 | 1640 | INNER JOIN | 
| 1579 | 1641 | ( | 
| 1580 | - 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 | |
| 1581 | - group by r.foreignId having t=2 and r.type = 2 and r.riskLevel >1 | |
| 1582 | - ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1642 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r | |
| 1643 | + where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=2 | |
| 1644 | + ) l on l.foreignId = a.cid GROUP BY tp.name | |
| 1583 | 1645 | </select> | 
| 1584 | 1646 | |
| 1585 | 1647 | |
| 1586 | 1648 | |
| 1587 | 1649 | <select id="getThreeRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1588 | - 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 | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + select count(a.sourceId) as threeRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1589 | 1653 | INNER JOIN organization o on p.hospitalId=o.id | 
| 1590 | - where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1654 | + where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId} | |
| 1591 | 1655 | <if test="startDate != null"> | 
| 1592 | 1656 | and p.bookbuildingDate >= #{startDate} | 
| 1593 | 1657 | </if> | 
| 1594 | 1658 | |
| 1595 | 1659 | |
| 1596 | 1660 | |
| ... | ... | @@ -1595,18 +1659,22 @@ | 
| 1595 | 1659 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1596 | 1660 | </if> | 
| 1597 | 1661 | ) tp | 
| 1662 | + INNER JOIN report_antexchu a | |
| 1663 | + on tp.patientId=a.sourceId | |
| 1598 | 1664 | INNER JOIN | 
| 1599 | 1665 | ( | 
| 1600 | - 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 | |
| 1601 | - group by r.foreignId having t=3 and r.type = 2 and r.riskLevel >1 | |
| 1602 | - ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1666 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r | |
| 1667 | + where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=3 | |
| 1668 | + ) l on l.foreignId = a.cid GROUP BY tp.name | |
| 1669 | + | |
| 1603 | 1670 | </select> | 
| 1604 | 1671 | |
| 1605 | 1672 | |
| 1606 | 1673 | <select id="getFourRiskCounts" resultType="java.util.Map" parameterType="java.util.Map"> | 
| 1607 | - 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 | |
| 1674 | + | |
| 1675 | + select count(a.sourceId) as fourRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p | |
| 1608 | 1676 | INNER JOIN organization o on p.hospitalId=o.id | 
| 1609 | - where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL | |
| 1677 | + where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId} | |
| 1610 | 1678 | <if test="startDate != null"> | 
| 1611 | 1679 | and p.bookbuildingDate >= #{startDate} | 
| 1612 | 1680 | </if> | 
| 1613 | 1681 | |
| ... | ... | @@ -1614,11 +1682,13 @@ | 
| 1614 | 1682 | and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | 
| 1615 | 1683 | </if> | 
| 1616 | 1684 | ) tp | 
| 1685 | + INNER JOIN report_antexchu a | |
| 1686 | + on tp.patientId=a.sourceId | |
| 1617 | 1687 | INNER JOIN | 
| 1618 | 1688 | ( | 
| 1619 | - 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 | |
| 1620 | - group by r.foreignId having t=4 and r.type = 2 and r.riskLevel >1 | |
| 1621 | - ) l on tp.patientId=l.sourceId GROUP BY tp.name | |
| 1689 | + SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r | |
| 1690 | + where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=3 | |
| 1691 | + ) l on l.foreignId = a.cid GROUP BY tp.name | |
| 1622 | 1692 | </select> | 
| 1623 | 1693 | |
| 1624 | 1694 | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
79ec28d
| ... | ... | @@ -4265,7 +4265,6 @@ | 
| 4265 | 4265 | |
| 4266 | 4266 | |
| 4267 | 4267 | |
| 4268 | - | |
| 4269 | 4268 | @ResponseBody | 
| 4270 | 4269 | @RequestMapping(value = "/syncAntexToMysql", method = RequestMethod.GET) | 
| 4271 | 4270 | public String syncAntexToMysql(@RequestParam(required = false) Date startDate,@RequestParam(required = false) Date endDate) { | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientSyncMysqlFacade.java
View file @
79ec28d
| ... | ... | @@ -1287,6 +1287,7 @@ | 
| 1287 | 1287 | while (true) | 
| 1288 | 1288 | { | 
| 1289 | 1289 | patientsQuery.setPage(page); | 
| 1290 | + System.out.println("syncPatientsToMysql" + page); | |
| 1290 | 1291 | List<Patients> patientses = patientsService.queryPatient(patientsQuery); | 
| 1291 | 1292 | if (CollectionUtils.isEmpty(patientses)) | 
| 1292 | 1293 | { | 
| ... | ... | @@ -1327,6 +1328,7 @@ | 
| 1327 | 1328 | while (true) | 
| 1328 | 1329 | { | 
| 1329 | 1330 | antExChuQuery.setPage(page); | 
| 1331 | + System.out.println("syncAntexchuToMysql"+page); | |
| 1330 | 1332 | List <AntExChuModel> antExChus = antenatalExaminationService.queryAntExChu(antExChuQuery); | 
| 1331 | 1333 | if (CollectionUtils.isEmpty(antExChus)) | 
| 1332 | 1334 | { | 
| 1333 | 1335 | |
| ... | ... | @@ -1551,7 +1553,13 @@ | 
| 1551 | 1553 | param.put("cityId",cityId); | 
| 1552 | 1554 | param.put("areaId", areaId); | 
| 1553 | 1555 | List<Map<String,Object>> bulidsCount = mysqlAntexcService.getBuildCount(param); | 
| 1556 | + List<Map<String,String>> bulidCheckPersonCounts = mysqlAntexcService.getBulidCheckPersonCount(param); | |
| 1557 | + List<Map<String,String>> bulidCheckNumCounts = mysqlAntexcService.getBulidCheckNumCount(param); | |
| 1558 | + List<Map<String,String>> checkPersonCounts = mysqlAntexcService.getCheckPersonCount(param); | |
| 1559 | + List<Map<String,String>> matDeliverCounts = mysqlAntexcService.getMatDeliverCount(param); | |
| 1560 | + List<Map<String,String>> liveCounts = mysqlAntexcService.getLiveCount(param); | |
| 1554 | 1561 | |
| 1562 | + | |
| 1555 | 1563 | if (CollectionUtils.isNotEmpty(bulidsCount)) | 
| 1556 | 1564 | { | 
| 1557 | 1565 | |
| ... | ... | @@ -1560,6 +1568,7 @@ | 
| 1560 | 1568 | String provId = String.valueOf(map.get("provinceId")); | 
| 1561 | 1569 | String cId = String.valueOf(map.get("cityId")); | 
| 1562 | 1570 | String aId = String.valueOf(map.get("areaId")); | 
| 1571 | + String hospitalName = String.valueOf(map.get("hospitalName")); | |
| 1563 | 1572 | String provinceName = getAddressName(provId); | 
| 1564 | 1573 | String cityName = getAddressName(cId); | 
| 1565 | 1574 | String areaName = getAddressName(aId); | 
| 1566 | 1575 | |
| 1567 | 1576 | |
| 1568 | 1577 | |
| 1569 | 1578 | |
| 1570 | 1579 | |
| 1571 | 1580 | |
| 1572 | 1581 | |
| 1573 | 1582 | |
| 1574 | 1583 | |
| 1575 | 1584 | |
| ... | ... | @@ -1568,47 +1577,69 @@ | 
| 1568 | 1577 | map.put("cityName",cityName); | 
| 1569 | 1578 | map.put("areaName",areaName); | 
| 1570 | 1579 | |
| 1571 | - Map param1 = new HashMap(); | |
| 1572 | - param1.put("startDate",startDate); | |
| 1573 | - param1.put("endDate",endDate); | |
| 1574 | - param1.put("hospitalId",map.get("hospitalId")); | |
| 1575 | - List<Map<String,String>> bulidCheckPersonCounts = mysqlAntexcService.getBulidCheckPersonCount(param1); | |
| 1576 | - | |
| 1577 | 1580 | //建档产检人数 | 
| 1578 | 1581 | long bulidCheckPersonCount = 0; | 
| 1579 | 1582 | if (CollectionUtils.isNotEmpty(bulidCheckPersonCounts)) { | 
| 1580 | - bulidCheckPersonCount = Integer.valueOf(String.valueOf(bulidCheckPersonCounts.get(0).get("bulidCheckPersonCount"))); | |
| 1583 | + for (Map<String, String> checkData : bulidCheckPersonCounts) { | |
| 1584 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
| 1585 | + { | |
| 1586 | + bulidCheckPersonCount = Long.valueOf(String.valueOf(checkData.get("bulidCheckPersonCount"))); | |
| 1587 | + break; | |
| 1588 | + } | |
| 1589 | + } | |
| 1581 | 1590 | } | 
| 1582 | 1591 | map.put("bulidCheckPersonCount",bulidCheckPersonCount); | 
| 1583 | 1592 | |
| 1584 | 1593 | |
| 1585 | - List<Map<String,String>> bulidCheckNumCounts = mysqlAntexcService.getBulidCheckNumCount(param1); | |
| 1594 | + | |
| 1586 | 1595 | //建档产检人次统计 | 
| 1587 | - int bulidCheckNumCount = 0; | |
| 1596 | + long bulidCheckNumCount = 0; | |
| 1588 | 1597 | if (CollectionUtils.isNotEmpty(bulidCheckNumCounts)) { | 
| 1589 | - bulidCheckNumCount = Integer.valueOf(String.valueOf(bulidCheckNumCounts.get(0).get("bulidCheckNumCount"))); | |
| 1598 | + for (Map<String, String> checkData : bulidCheckNumCounts) { | |
| 1599 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
| 1600 | + { | |
| 1601 | + bulidCheckNumCount = Long.valueOf(String.valueOf(checkData.get("bulidCheckNumCount"))); | |
| 1602 | + break; | |
| 1603 | + } | |
| 1604 | + } | |
| 1590 | 1605 | } | 
| 1591 | 1606 | map.put("bulidCheckNumCount",bulidCheckNumCount); | 
| 1592 | 1607 | |
| 1593 | 1608 | //产检时间的产检人数统计 | 
| 1594 | - List<Map<String,String>> checkPersonCounts = mysqlAntexcService.getCheckPersonCount(param1); | |
| 1595 | - int checkPersonCount = 0; | |
| 1609 | + | |
| 1610 | + long checkPersonCount = 0; | |
| 1596 | 1611 | if (CollectionUtils.isNotEmpty(checkPersonCounts)) { | 
| 1597 | - checkPersonCount = Integer.valueOf(String.valueOf(checkPersonCounts.get(0).get("checkPersonCount"))); | |
| 1612 | + for (Map<String, String> checkData : checkPersonCounts) { | |
| 1613 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
| 1614 | + { | |
| 1615 | + checkPersonCount = Long.valueOf(String.valueOf(checkData.get("checkPersonCount"))); | |
| 1616 | + break; | |
| 1617 | + } | |
| 1618 | + } | |
| 1598 | 1619 | } | 
| 1599 | 1620 | map.put("checkPersonCount",checkPersonCount); | 
| 1600 | 1621 | |
| 1601 | - int matDeliverCount = 0; | |
| 1602 | - List<Map<String,String>> matDeliverCounts = mysqlAntexcService.getMatDeliverCount(param1); | |
| 1622 | + long matDeliverCount = 0; | |
| 1603 | 1623 | if (CollectionUtils.isNotEmpty(matDeliverCounts)) { | 
| 1604 | - matDeliverCount = Integer.valueOf(String.valueOf(matDeliverCounts.get(0).get("matDeliverCount"))); | |
| 1624 | + for (Map<String, String> checkData : matDeliverCounts) { | |
| 1625 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
| 1626 | + { | |
| 1627 | + matDeliverCount = Long.valueOf(String.valueOf(checkData.get("matDeliverCount"))); | |
| 1628 | + break; | |
| 1629 | + } | |
| 1630 | + } | |
| 1605 | 1631 | } | 
| 1606 | 1632 | map.put("matDeliverCount",matDeliverCount); | 
| 1607 | 1633 | |
| 1608 | - List<Map<String,String>> liveCounts = mysqlAntexcService.getLiveCount(param1); | |
| 1609 | - int liveCount = 0; | |
| 1634 | + long liveCount = 0; | |
| 1610 | 1635 | if (CollectionUtils.isNotEmpty(liveCounts)) { | 
| 1611 | - liveCount = Integer.valueOf(String.valueOf(liveCounts.get(0).get("liveCount"))); | |
| 1636 | + for (Map<String, String> checkData : liveCounts) { | |
| 1637 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
| 1638 | + { | |
| 1639 | + liveCount = Long.valueOf(String.valueOf(checkData.get("liveCount"))); | |
| 1640 | + break; | |
| 1641 | + } | |
| 1642 | + } | |
| 1612 | 1643 | } | 
| 1613 | 1644 | map.put("liveCount",liveCount); | 
| 1614 | 1645 | } |