|
@ -37,7 +37,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
@ -464,7 +463,7 @@ public class DoctorSchemeService {
|
|
|
" base_patient a \n" +
|
|
|
" INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease_condition IN('1','2','0')\n" +
|
|
|
"AND a.disease IN ('1','2','1,2','2,1')\n" +
|
|
|
"AND b.doctor ='" + doctorcode + "'";
|
|
|
|
|
@ -2180,7 +2179,7 @@ public class DoctorSchemeService {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public HashMap<String, Object> getLabelCount(String doctorId) throws ExecutionException, InterruptedException {
|
|
|
public HashMap<String, Object> getLabelCount(String doctorId,String diseaseCondition) throws ExecutionException, InterruptedException {
|
|
|
// 高血压预警
|
|
|
String sql01 = "SELECT count(DISTINCT a.id)\n" +
|
|
|
"FROM base_patient a \n" +
|
|
@ -2188,7 +2187,7 @@ public class DoctorSchemeService {
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.standard_status='1'\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease_condition IN('1','2','0')\n" +
|
|
|
"and l.label_name='高血压' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
// 高血压
|
|
@ -2197,7 +2196,7 @@ public class DoctorSchemeService {
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease_condition IN('1','2','0')\n" +
|
|
|
"and l.label_name='高血压' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
|
|
@ -2208,7 +2207,7 @@ public class DoctorSchemeService {
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.standard_status='1'\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease_condition IN('1','2','0')\n" +
|
|
|
"and l.label_name='糖尿病' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
// 糖尿病
|
|
@ -2217,33 +2216,19 @@ public class DoctorSchemeService {
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease_condition IN('1','2','0')\n" +
|
|
|
"and l.label_name='糖尿病' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
|
|
|
CompletableFuture<Integer> future01 = CompletableFuture.supplyAsync(() -> {
|
|
|
Integer count = jdbcTemplate.queryForObject(sql01, Integer.class);
|
|
|
return count;
|
|
|
}, execute);
|
|
|
CompletableFuture<Integer> future02 = CompletableFuture.supplyAsync(() -> {
|
|
|
Integer count = jdbcTemplate.queryForObject(sql02, Integer.class);
|
|
|
return count;
|
|
|
}, execute);
|
|
|
CompletableFuture<Integer> future03 = CompletableFuture.supplyAsync(() -> {
|
|
|
Integer count = jdbcTemplate.queryForObject(sql03, Integer.class);
|
|
|
return count;
|
|
|
}, execute);
|
|
|
CompletableFuture<Integer> future04 = CompletableFuture.supplyAsync(() -> {
|
|
|
Integer count = jdbcTemplate.queryForObject(sql04, Integer.class);
|
|
|
return count;
|
|
|
}, execute);
|
|
|
|
|
|
|
|
|
CompletableFuture.allOf(future01, future02, future03, future04).get();
|
|
|
Integer count1 = future01.get();// 高血压预警
|
|
|
Integer count2 = future02.get();// 高血压
|
|
|
Integer count3 = future03.get();// 糖尿病预警
|
|
|
Integer count4 = future04.get();// 糖尿病
|
|
|
if(StringUtils.isNotBlank(diseaseCondition)){
|
|
|
sql01 += " and a.disease_condition = '"+diseaseCondition+"' ";
|
|
|
sql02 += " and a.disease_condition = '"+diseaseCondition+"' ";
|
|
|
sql03 += " and a.disease_condition = '"+diseaseCondition+"' ";
|
|
|
sql04 += " and a.disease_condition = '"+diseaseCondition+"' ";
|
|
|
}
|
|
|
Integer count1 = jdbcTemplate.queryForObject(sql01, Integer.class);// 高血压预警
|
|
|
Integer count2 = jdbcTemplate.queryForObject(sql02, Integer.class);// 高血压
|
|
|
Integer count3 = jdbcTemplate.queryForObject(sql03, Integer.class);// 糖尿病预警
|
|
|
Integer count4 = jdbcTemplate.queryForObject(sql04, Integer.class);// 糖尿病
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
map.put("gxy_yj", count1);// 高血压预警
|
|
@ -2256,14 +2241,14 @@ public class DoctorSchemeService {
|
|
|
/**
|
|
|
* labelType 1高血压 2糖尿病
|
|
|
*/
|
|
|
public List<Map<String, Object>> getLabelDetail(String doctorId, String labelType, String searchContent, int page, int pageSize) {
|
|
|
public List<Map<String, Object>> getLabelDetail(String doctorId, String labelType,String diseaseCondition, String searchContent, int page, int pageSize) {
|
|
|
String sql = "SELECT DISTINCT a.id,a.`name`,a.idcard,a.mobile,a.ssc, TIMESTAMPDIFF(YEAR, a.birthday, CURDATE()) AS age " +
|
|
|
",a.sex,a.disease,CAST(a.disease_condition AS CHAR) diseaseCondition,a.photo,CAST(a.standard_status AS CHAR) standardStatus " +
|
|
|
"FROM base_patient a \n" +
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3') " +
|
|
|
"AND a.disease_condition IN('1','2','0') " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
if (StringUtils.isNotBlank(labelType)) {
|
|
|
if ("1".equals(labelType)) {
|
|
@ -2273,6 +2258,9 @@ public class DoctorSchemeService {
|
|
|
sql += "AND l.label_name='糖尿病' \n";
|
|
|
}
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(diseaseCondition)){
|
|
|
sql += "AND a.disease_condition = '"+diseaseCondition+"' " ;
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(searchContent)) {
|
|
|
sql += " AND a.`name` LIKE '%" + searchContent + "%' ";
|
|
|
}
|