|
@ -136,7 +136,7 @@ public class DoctorSchemeService extends BaseService{
|
|
|
|
|
|
//1.4.2加入跟踪居民过滤
|
|
//1.4.2加入跟踪居民过滤
|
|
if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
|
|
if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
|
|
sql = sql + " AND pt.doctor_code = '"+doctorcode+"' AND pt.teamCode = "+teamCode;
|
|
|
|
|
|
sql = sql + "pt.del='1' AND pt.doctor_code = '"+doctorcode+"' AND pt.teamCode = "+teamCode;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -792,7 +792,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 > 6.1 " +
|
|
" AND i.value1 > 6.1 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
" ) bf, " +
|
|
" ) bf, " +
|
|
" ( " +
|
|
" ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
@ -806,7 +806,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 > 7.8 " +
|
|
" AND i.value1 > 7.8 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
" ) aft";
|
|
" ) aft";
|
|
String stdSql ="SELECT " +
|
|
String stdSql ="SELECT " +
|
|
" (bf.befHighCount + aft.aftHighCount) AS stdCount " +
|
|
" (bf.befHighCount + aft.aftHighCount) AS stdCount " +
|
|
@ -824,7 +824,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 >= 3.9 " +
|
|
" AND i.value1 >= 3.9 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
" ) bf, " +
|
|
" ) bf, " +
|
|
" ( " +
|
|
" ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
@ -839,7 +839,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 >= 4.4 " +
|
|
" AND i.value1 >= 4.4 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
" ) aft";
|
|
" ) aft";
|
|
String lowSql ="SELECT " +
|
|
String lowSql ="SELECT " +
|
|
" (bf.befHighCount + aft.aftHighCount) AS lowCount " +
|
|
" (bf.befHighCount + aft.aftHighCount) AS lowCount " +
|
|
@ -856,7 +856,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 <= 3.9 " +
|
|
" AND i.value1 <= 3.9 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
" ) bf, " +
|
|
" ) bf, " +
|
|
" ( " +
|
|
" ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
@ -870,7 +870,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 <= 4.4 " +
|
|
" AND i.value1 <= 4.4 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
|
|
" ) aft";
|
|
" ) aft";
|
|
|
|
|
|
String pHighSql ="SELECT " +
|
|
String pHighSql ="SELECT " +
|
|
@ -883,7 +883,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 >= 139 " +
|
|
" AND i.value1 >= 139 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";
|
|
String pStdSql ="SELECT " +
|
|
String pStdSql ="SELECT " +
|
|
" count(1) AS stdCount " +
|
|
" count(1) AS stdCount " +
|
|
" FROM " +
|
|
" FROM " +
|
|
@ -895,7 +895,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 >= 90 " +
|
|
" AND i.value1 >= 90 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";
|
|
String pLowSql ="SELECT " +
|
|
String pLowSql ="SELECT " +
|
|
" count(1) AS lowCount " +
|
|
" count(1) AS lowCount " +
|
|
" FROM " +
|
|
" FROM " +
|
|
@ -906,7 +906,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND i.value1 <= 90 " +
|
|
" AND i.value1 <= 90 " +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date >='"+startDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.record_date <='"+endDate+"'" +
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";
|
|
|
|
|
|
" AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";
|
|
|
|
|
|
Map<String,Object> rs = new HashedMap();
|
|
Map<String,Object> rs = new HashedMap();
|
|
//0血檀
|
|
//0血檀
|
|
@ -1074,7 +1074,8 @@ public class DoctorSchemeService extends BaseService{
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_track_patient t " +
|
|
" wlyy_track_patient t " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" t.doctor_code = '"+doctor+"' " +
|
|
|
|
|
|
" t.del='1' " +
|
|
|
|
" AND t.doctor_code = '"+doctor+"' " +
|
|
" AND t.team_code = '"+teamCode+"' " +
|
|
" AND t.team_code = '"+teamCode+"' " +
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
@ -1140,7 +1141,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
" AND t.create_time <= '" + endDate + "'" +
|
|
" AND t.create_time <= '" + endDate + "'" +
|
|
" AND c.patient IN(" +
|
|
" AND c.patient IN(" +
|
|
" SELECT t.patient_code FROM wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +id+
|
|
|
|
|
|
" SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +id+
|
|
" )" +
|
|
" )" +
|
|
" )c ON c.id = m.doctor_code " +
|
|
" )c ON c.id = m.doctor_code " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
@ -1157,7 +1158,7 @@ public class DoctorSchemeService extends BaseService{
|
|
public Long getReservationByteam(Long id,String doctor, String startDate, String endDate) {
|
|
public Long getReservationByteam(Long id,String doctor, String startDate, String endDate) {
|
|
//获取待预约
|
|
//获取待预约
|
|
String reservation_sql = "SELECT COUNT(1) AS reservationCount FROM wlyy_patient_reservation w WHERE w.admin_team_code =" + id + " AND w.czrq <='" + endDate + "' AND w.czrq >='" + startDate + "' " +
|
|
String reservation_sql = "SELECT COUNT(1) AS reservationCount FROM wlyy_patient_reservation w WHERE w.admin_team_code =" + id + " AND w.czrq <='" + endDate + "' AND w.czrq >='" + startDate + "' " +
|
|
" AND w.doctor ='"+doctor+"' AND w.patient IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
|
|
|
|
" AND w.doctor ='"+doctor+"' AND w.patient IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
//获取待预约
|
|
//获取待预约
|
|
Map<String, Object> reservationCout = jdbcTemplate.queryForMap(reservation_sql);
|
|
Map<String, Object> reservationCout = jdbcTemplate.queryForMap(reservation_sql);
|
|
if (reservationCout.get("reservationCount") == null) {
|
|
if (reservationCout.get("reservationCount") == null) {
|
|
@ -1169,7 +1170,7 @@ public class DoctorSchemeService extends BaseService{
|
|
public Long getEduArticleByTeam(Long id,String doctor, String startDate, String endDate) {
|
|
public Long getEduArticleByTeam(Long id,String doctor, String startDate, String endDate) {
|
|
//获取健康教育
|
|
//获取健康教育
|
|
String article_sql = "SELECT COUNT(1) AS articleCount FROM wlyy_health_edu_article_patient w WHERE w.admin_team_code =" + id + " AND w.czrq <='" + endDate + "' AND w.czrq >='" + startDate + "'" +
|
|
String article_sql = "SELECT COUNT(1) AS articleCount FROM wlyy_health_edu_article_patient w WHERE w.admin_team_code =" + id + " AND w.czrq <='" + endDate + "' AND w.czrq >='" + startDate + "'" +
|
|
" AND w.doctor ='"+doctor+"' AND w.patient IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
|
|
|
|
" AND w.doctor ='"+doctor+"' AND w.patient IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
//获取健康教育
|
|
//获取健康教育
|
|
Map<String, Object> articleCout = jdbcTemplate.queryForMap(article_sql);
|
|
Map<String, Object> articleCout = jdbcTemplate.queryForMap(article_sql);
|
|
if (articleCout.get("articleCount") == null) {
|
|
if (articleCout.get("articleCount") == null) {
|
|
@ -1181,7 +1182,7 @@ public class DoctorSchemeService extends BaseService{
|
|
public Long getGuidanceByTeam(Long id,String doctor, String startDate, String endDate) {
|
|
public Long getGuidanceByTeam(Long id,String doctor, String startDate, String endDate) {
|
|
//获取健康指导
|
|
//获取健康指导
|
|
String guidance_sql = "SELECT COUNT(1) AS guidanceCount FROM wlyy_patient_health_guidance w WHERE w.admin_team_code =" + id + " AND w.czrq <='" + endDate + "' AND w.czrq >='" + startDate + "' " +
|
|
String guidance_sql = "SELECT COUNT(1) AS guidanceCount FROM wlyy_patient_health_guidance w WHERE w.admin_team_code =" + id + " AND w.czrq <='" + endDate + "' AND w.czrq >='" + startDate + "' " +
|
|
" AND w.doctor ='"+doctor+"' AND w.patient IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
|
|
|
|
" AND w.doctor ='"+doctor+"' AND w.patient IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
//获取健康指导
|
|
//获取健康指导
|
|
Map<String, Object> guidanceCout = jdbcTemplate.queryForMap(guidance_sql);
|
|
Map<String, Object> guidanceCout = jdbcTemplate.queryForMap(guidance_sql);
|
|
if (guidanceCout.get("guidanceCount") == null) {
|
|
if (guidanceCout.get("guidanceCount") == null) {
|
|
@ -1194,7 +1195,7 @@ public class DoctorSchemeService extends BaseService{
|
|
public Long getFollowByTeam(Long id,String doctor, String startDate, String endDate) {
|
|
public Long getFollowByTeam(Long id,String doctor, String startDate, String endDate) {
|
|
//随访数目
|
|
//随访数目
|
|
String followup_sql = "SELECT COUNT(1) AS followupCount from wlyy_followup w WHERE w.admin_team_code=" + id + " AND w.create_time >='" + startDate + "' AND w.create_time<='" + endDate + "' " +
|
|
String followup_sql = "SELECT COUNT(1) AS followupCount from wlyy_followup w WHERE w.admin_team_code=" + id + " AND w.create_time >='" + startDate + "' AND w.create_time<='" + endDate + "' " +
|
|
" AND w.doctor_code ='"+doctor+"' AND w.patient_code IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
|
|
|
|
" AND w.doctor_code ='"+doctor+"' AND w.patient_code IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +id+") ";
|
|
//随访数目
|
|
//随访数目
|
|
Map<String, Object> followupCout = jdbcTemplate.queryForMap(followup_sql);
|
|
Map<String, Object> followupCout = jdbcTemplate.queryForMap(followup_sql);
|
|
if (followupCout.get("followupCount") == null) {
|
|
if (followupCout.get("followupCount") == null) {
|
|
@ -1217,7 +1218,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" AND p.patient IN ( " +
|
|
" AND p.patient IN ( " +
|
|
" SELECT t.patient_code " +
|
|
" SELECT t.patient_code " +
|
|
" FROM wlyy_track_patient t " +
|
|
" FROM wlyy_track_patient t " +
|
|
" WHERE t.doctor_code ='"+doctor+"' " +
|
|
|
|
|
|
" WHERE t.del='1' AND t.doctor_code ='"+doctor+"' " +
|
|
" AND t.team_code = " +id+")";
|
|
" AND t.team_code = " +id+")";
|
|
//审核数目
|
|
//审核数目
|
|
Map<String, Object> reviewedCount = jdbcTemplate.queryForMap(sql);
|
|
Map<String, Object> reviewedCount = jdbcTemplate.queryForMap(sql);
|
|
@ -1243,7 +1244,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" i.`user` in " +
|
|
" i.`user` in " +
|
|
" ( " +
|
|
" ( " +
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
|
|
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.del='1' AND p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
" ) " +
|
|
" ) " +
|
|
" AND i.del ='1' " +
|
|
" AND i.del ='1' " +
|
|
" AND i.type = 2 " +
|
|
" AND i.type = 2 " +
|
|
@ -1263,7 +1264,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" i.`user` in " +
|
|
" i.`user` in " +
|
|
" ( " +
|
|
" ( " +
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
|
|
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.del='1' AND p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
" ) " +
|
|
" ) " +
|
|
" AND " +
|
|
" AND " +
|
|
" i.value1 <= p.sbp " +
|
|
" i.value1 <= p.sbp " +
|
|
@ -1335,7 +1336,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" i.`user` in " +
|
|
" i.`user` in " +
|
|
" ( " +
|
|
" ( " +
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
|
|
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.del='1' AND p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
" ) " +
|
|
" ) " +
|
|
" AND i.del ='1' " +
|
|
" AND i.del ='1' " +
|
|
" AND i.type = 1 " +
|
|
" AND i.type = 1 " +
|
|
@ -1355,7 +1356,7 @@ public class DoctorSchemeService extends BaseService{
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" i.`user` in " +
|
|
" i.`user` in " +
|
|
" ( " +
|
|
" ( " +
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
|
|
|
|
" SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.del='1' AND p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
|
|
" ) " +
|
|
" ) " +
|
|
" AND " +
|
|
" AND " +
|
|
" i.value1 <= p.fbg " +
|
|
" i.value1 <= p.fbg " +
|
|
@ -1380,7 +1381,8 @@ public class DoctorSchemeService extends BaseService{
|
|
" wlyy_patient_device d JOIN " +
|
|
" wlyy_patient_device d JOIN " +
|
|
" wlyy_track_patient t ON t.patient_code = d.`user` " +
|
|
" wlyy_track_patient t ON t.patient_code = d.`user` " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.category_code = ? " +
|
|
|
|
|
|
" t.del='1' " +
|
|
|
|
" AND d.category_code = ? " +
|
|
" AND t.doctor_code = '"+doctor+"' " +
|
|
" AND t.doctor_code = '"+doctor+"' " +
|
|
" AND t.team_code = "+teamCode;
|
|
" AND t.team_code = "+teamCode;
|
|
Map<String,Object> rs = new HashedMap();
|
|
Map<String,Object> rs = new HashedMap();
|