|
@ -214,9 +214,7 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
" FROM " +
|
|
|
" wlyy_sign_family t1 " +
|
|
|
" left join " +
|
|
|
" (select patient,label,label_type from wlyy_sign_patient_label_info where patient in " +
|
|
|
" (select patient from wlyy_sign_family where repdoctor ='" + doctor + "' and status > 0) " +
|
|
|
" and label_type = ? and status = 1) t2 " +
|
|
|
" (select patient,label,label_type,label_name from wlyy_sign_patient_label_info where patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) and label_type = ?) t2 " +
|
|
|
" on t1.patient = t2.patient " +
|
|
|
" WHERE " +
|
|
|
" t2.patient is null " +
|
|
@ -232,8 +230,7 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
" wlyy_sign_family t1, " +
|
|
|
" wlyy_sign_patient_label_info t2 " +
|
|
|
" WHERE " +
|
|
|
" t2.patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0 ) " +
|
|
|
" AND t2.label = ? " +
|
|
|
" t2.label = ? " +
|
|
|
" AND t2.label_type = ? " +
|
|
|
" AND t2.status = 1 " +
|
|
|
" AND t1.patient = t2.patient " +
|
|
@ -578,9 +575,7 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
" FROM" +
|
|
|
" wlyy_sign_family t1 " +
|
|
|
" left join " +
|
|
|
" (SELECT patient,label,label_type from wlyy_sign_patient_label_info where patient in " +
|
|
|
" (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) " +
|
|
|
" and label_type = ? and status = 1) t2 " +
|
|
|
" (select patient,label,label_type,label_name from wlyy_sign_patient_label_info where patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) and label_type = ?) t2 " +
|
|
|
" on t1.patient = t2.patient " +
|
|
|
" WHERE" +
|
|
|
" t2.patient is null " +
|
|
@ -601,7 +596,6 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
" wlyy_sign_patient_label_info t2 " +
|
|
|
" WHERE" +
|
|
|
" t1.patient = t2.patient " +
|
|
|
" AND t2.patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) " +
|
|
|
" AND t2.label = ? " +
|
|
|
" AND t2.label_type = ? " +
|
|
|
" AND t2.status = 1 " +
|
|
@ -840,35 +834,35 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
List<Map<String, Object>> signList = new ArrayList<>();
|
|
|
page = page * pagesize;
|
|
|
Object[] args = null;
|
|
|
String sql = "SELECT " +
|
|
|
|
|
|
String sql = "select " +
|
|
|
" t1.* " +
|
|
|
" FROM " +
|
|
|
" wlyy_sign_family t1 " +
|
|
|
(StringUtils.isNotEmpty(labelCode) || StringUtils.isNotEmpty(labelType) ?
|
|
|
" join " : " left join ") +
|
|
|
" (select patient,label,label_name,label_type from wlyy_sign_patient_label_info where patient in" +
|
|
|
" (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) " +
|
|
|
" and status = 1 " +
|
|
|
(StringUtils.isNotEmpty(labelCode) ? " AND label = ? " : "") +
|
|
|
(StringUtils.isNotEmpty(labelType) ? " AND label_type = ? " : "") + ") t2" +
|
|
|
" wlyy_sign_patient_label_info t2 " +
|
|
|
" ON t1.patient = t2.patient " +
|
|
|
" WHERE " +
|
|
|
" t1.repdoctor = ? " +
|
|
|
" AND t1.status > 0 " +
|
|
|
" AND (" + (StringUtils.isNotEmpty(labelCode) || StringUtils.isNotEmpty(labelType) ? "" : " t2.patient is null OR ") + " t2.status = 1) " +
|
|
|
(StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : "") +
|
|
|
(StringUtils.isNotEmpty(labelType) ? " AND t2.label_type = ? " : "") +
|
|
|
(teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "") +
|
|
|
" AND (t1.name like ? OR t2.label_name like ?) ";
|
|
|
" AND (t1.name like ? or t2.label_name like ?) ";
|
|
|
|
|
|
if (StringUtils.isNotEmpty(labelCode)) {
|
|
|
args = new Object[]{labelCode, labelType, doctor, "%" + filter + "%", "%" + filter + "%", labelCode, labelType, doctor, "%" + filter + "%", "%" + filter + "%"};
|
|
|
args = new Object[]{doctor, labelCode, labelType, "%" + filter + "%", "%" + filter + "%", doctor, labelCode, labelType, "%" + filter + "%", "%" + filter + "%"};
|
|
|
} else if (StringUtils.isEmpty(labelCode) && StringUtils.isNotEmpty(labelType)) {
|
|
|
args = new Object[]{labelType, doctor, "%" + filter + "%", "%" + filter + "%", labelType, doctor, "%" + filter + "%", "%" + filter + "%"};
|
|
|
args = new Object[]{doctor, labelType, "%" + filter + "%", "%" + filter + "%", doctor, labelType, "%" + filter + "%", "%" + filter + "%"};
|
|
|
} else {
|
|
|
args = new Object[]{doctor, "%" + filter + "%", "%" + filter + "%", doctor, "%" + filter + "%", "%" + filter + "%"};
|
|
|
}
|
|
|
|
|
|
String sqlDoc = sql.replaceAll("repdoctor", "doctor");
|
|
|
String sqlDocHealth = sql.replaceAll("repdoctor", "doctor_health").replaceAll("t1", "t3").replaceAll("t2", "t4");
|
|
|
sql = "select t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + page + "," + pagesize;
|
|
|
sql = "select DISTINCT t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + page + "," + pagesize;
|
|
|
signList = jdbcTemplate.queryForList(sql, args);
|
|
|
|
|
|
if (signList != null && signList.size() > 0) {
|
|
@ -921,13 +915,8 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
List<SignPatientLabelInfo> labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
|
|
|
|
|
|
if (StringUtils.isEmpty(exLabelCode) || StringUtils.isEmpty(exLabelType)) {
|
|
|
|
|
|
}
|
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
|
// 设置患者标识
|