|
@ -122,7 +122,7 @@ public class SpecialistService{
|
|
" rd.create_time AS createTime ," +
|
|
" rd.create_time AS createTime ," +
|
|
" p.sex " +
|
|
" p.sex " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r JOIN wlyy_patient p ON p.code = r.patient " +
|
|
|
|
|
|
" wlyy_specialist_patient_relation r JOIN base_patient p ON p.code = r.patient " +
|
|
" LEFT JOIN wlyy_patient_hospital_record rd ON r.discharge_record = rd.id " +
|
|
" LEFT JOIN wlyy_patient_hospital_record rd ON r.discharge_record = rd.id " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.doctor = '"+doctor+"' AND r.status >=0 AND r.sign_status >0" +
|
|
" r.doctor = '"+doctor+"' AND r.status >=0 AND r.sign_status >0" +
|
|
@ -163,7 +163,7 @@ public class SpecialistService{
|
|
" h.label_name as health, " +
|
|
" h.label_name as health, " +
|
|
" h.label AS healthcode " +
|
|
" h.label AS healthcode " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r JOIN wlyy_patient p ON p.`code` = r.patient " +
|
|
|
|
|
|
" wlyy_specialist_patient_relation r JOIN base_patient p ON p.id = r.patient " +
|
|
" LEFT JOIN ( " +
|
|
" LEFT JOIN ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
" t.label, " +
|
|
" t.label, " +
|
|
@ -219,10 +219,10 @@ public class SpecialistService{
|
|
" AND i.label_type = '"+labelType+"' " +
|
|
" AND i.label_type = '"+labelType+"' " +
|
|
" AND i.`status` = '1' " +
|
|
" AND i.`status` = '1' " +
|
|
" ) lb " +
|
|
" ) lb " +
|
|
" JOIN wlyy_patient p ON p. CODE = lb.patient " +
|
|
|
|
|
|
" JOIN base_patient p ON p. CODE = lb.patient " +
|
|
" JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient ";
|
|
" JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient ";
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
sql = sql + " JOIN wlyy_doctor_special_share sp ON s.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
|
|
|
|
|
|
sql = sql + " JOIN base_doctor_special_share sp ON s.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
|
|
}
|
|
}
|
|
sql = sql +" WHERE s.team_code ='" +teamCode+"' "+
|
|
sql = sql +" WHERE s.team_code ='" +teamCode+"' "+
|
|
" AND s.status >=0 AND s.sign_status >0"+
|
|
" AND s.status >=0 AND s.sign_status >0"+
|
|
@ -242,11 +242,11 @@ public class SpecialistService{
|
|
// "a.health_assistant_name AS healthAssistantName, " +
|
|
// "a.health_assistant_name AS healthAssistantName, " +
|
|
" a.is_manage AS isManage, " +
|
|
" a.is_manage AS isManage, " +
|
|
"a.id AS specialCode " +
|
|
"a.id AS specialCode " +
|
|
"FROM wlyy_specialist.wlyy_specialist_patient_relation a " +
|
|
|
|
|
|
"FROM wlyy_specialist_patient_relation a " +
|
|
"JOIN wlyy_patient_disease_server b ON a.id=b.specialist_relation_code AND b.disease=" +labelCode+" and b.del=1 "+
|
|
"JOIN wlyy_patient_disease_server b ON a.id=b.specialist_relation_code AND b.disease=" +labelCode+" and b.del=1 "+
|
|
"JOIN wlyy_patient c ON a.patient=c.CODE ";
|
|
|
|
|
|
"JOIN base_patient c ON a.patient=c.CODE ";
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
sql = sql + " JOIN wlyy_doctor_special_share sp ON a.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
|
|
|
|
|
|
sql = sql + " JOIN base_doctor_special_share sp ON a.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
|
|
}
|
|
}
|
|
sql = sql +"LEFT JOIN wlyy_sign_patient_label_info d ON a.patient=d.patient AND d.label_type=8 AND d.`status`=1" +
|
|
sql = sql +"LEFT JOIN wlyy_sign_patient_label_info d ON a.patient=d.patient AND d.label_type=8 AND d.`status`=1" +
|
|
" WHERE a.sign_status> 0 AND a.`status`>=0 " +
|
|
" WHERE a.sign_status> 0 AND a.`status`>=0 " +
|
|
@ -264,8 +264,8 @@ public class SpecialistService{
|
|
"a.health_assistant AS healthAssistant,a.health_assistant_name as healthAssistantName" +
|
|
"a.health_assistant AS healthAssistant,a.health_assistant_name as healthAssistantName" +
|
|
// "a.health_assistant_name AS healthAssistantName, " +
|
|
// "a.health_assistant_name AS healthAssistantName, " +
|
|
",a.is_manage AS isManage " +
|
|
",a.is_manage AS isManage " +
|
|
"FROM wlyy_specialist.wlyy_specialist_patient_relation a " +
|
|
|
|
"JOIN wlyy_patient c ON a.patient=c.CODE " +
|
|
|
|
|
|
"FROM wlyy_specialist_patient_relation a " +
|
|
|
|
"JOIN base_patient c ON a.patient=c.CODE " +
|
|
" WHERE a.sign_status> 0 AND a.`status`>=0 AND (a.is_manage = 0 or a.is_manage is null)" +
|
|
" WHERE a.sign_status> 0 AND a.`status`>=0 AND (a.is_manage = 0 or a.is_manage is null)" +
|
|
" AND a.team_code ='" +teamCode+"' "+
|
|
" AND a.team_code ='" +teamCode+"' "+
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
@ -289,7 +289,7 @@ public class SpecialistService{
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation a ";
|
|
" wlyy_specialist_patient_relation a ";
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
sql = sql + " JOIN wlyy.wlyy_doctor_special_share b ON b.special_code = a.id AND b.doctor = '"+shareDoctor+"' ";
|
|
|
|
|
|
sql = sql + " JOIN base_doctor_special_share b ON b.special_code = a.id AND b.doctor = '"+shareDoctor+"' ";
|
|
}
|
|
}
|
|
sql = sql+" WHERE " +
|
|
sql = sql+" WHERE " +
|
|
" a.team_code = '"+teamCode+"' " +
|
|
" a.team_code = '"+teamCode+"' " +
|
|
@ -327,7 +327,7 @@ public class SpecialistService{
|
|
" h.label AS healthcode " +
|
|
" h.label AS healthcode " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_patient p ON r.patient = p.`code` " +
|
|
|
|
|
|
" JOIN base_patient p ON r.patient = p.id " +
|
|
" LEFT JOIN ( " +
|
|
" LEFT JOIN ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
" t.label, " +
|
|
" t.label, " +
|
|
@ -340,7 +340,7 @@ public class SpecialistService{
|
|
" AND t.`status` = '1' " +
|
|
" AND t.`status` = '1' " +
|
|
" ) h ON h.patient = r.patient " +
|
|
" ) h ON h.patient = r.patient " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.doctor IN ( SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+
|
|
|
|
|
|
" r.doctor IN ( SELECT m.doctor_code FROM wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+
|
|
"' ) " +
|
|
"' ) " +
|
|
" AND r.status >=0 AND r.sign_status >0 " +
|
|
" AND r.status >=0 AND r.sign_status >0 " +
|
|
" AND " + "r.patient_name" + " LIKE '%"+nameKey+"%' "+
|
|
" AND " + "r.patient_name" + " LIKE '%"+nameKey+"%' "+
|
|
@ -364,7 +364,7 @@ public class SpecialistService{
|
|
" h.label AS healthcode " +
|
|
" h.label AS healthcode " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_patient p ON r.patient = p.`code` " +
|
|
|
|
|
|
" JOIN base_patient p ON r.patient = p.id " +
|
|
" LEFT JOIN ( " +
|
|
" LEFT JOIN ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
" t.label, " +
|
|
" t.label, " +
|
|
@ -377,7 +377,7 @@ public class SpecialistService{
|
|
" AND t.`status` = '1' " +
|
|
" AND t.`status` = '1' " +
|
|
" ) h ON h.patient = r.patient " +
|
|
" ) h ON h.patient = r.patient " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.doctor IN ( SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+
|
|
|
|
|
|
" r.doctor IN ( SELECT m.doctor_code FROM wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+
|
|
"' ) " +
|
|
"' ) " +
|
|
" AND r.status >=0 AND r.sign_status >0 " +
|
|
" AND r.status >=0 AND r.sign_status >0 " +
|
|
" AND (" + "r.patient_name" + " LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+
|
|
" AND (" + "r.patient_name" + " LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+
|
|
@ -396,7 +396,7 @@ public class SpecialistService{
|
|
" COUNT(1) AS total" +
|
|
" COUNT(1) AS total" +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_patient p ON r.patient = p.`code` " +
|
|
|
|
|
|
" JOIN base_patient p ON r.patient = p.id " +
|
|
" JOIN ( " +
|
|
" JOIN ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
" t.label, " +
|
|
" t.label, " +
|
|
@ -420,8 +420,6 @@ public class SpecialistService{
|
|
|
|
|
|
String sql ="SELECT " +
|
|
String sql ="SELECT " +
|
|
" p.code AS patient ,r.patient_name as patientName" +
|
|
" p.code AS patient ,r.patient_name as patientName" +
|
|
//AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
// " p.`name` AS patientName, " +
|
|
|
|
" ,p.photo, " +
|
|
" ,p.photo, " +
|
|
" IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
" IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
" p.sex, " +
|
|
" p.sex, " +
|
|
@ -429,7 +427,7 @@ public class SpecialistService{
|
|
" h.label AS healthcode " +
|
|
" h.label AS healthcode " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_patient p ON r.patient = p.`code` " +
|
|
|
|
|
|
" JOIN base_patient p ON r.patient = p.id " +
|
|
" JOIN ( " +
|
|
" JOIN ( " +
|
|
" SELECT " +
|
|
" SELECT " +
|
|
" t.label, " +
|
|
" t.label, " +
|
|
@ -458,18 +456,14 @@ public class SpecialistService{
|
|
String checkDoctorSql = "SELECT " +
|
|
String checkDoctorSql = "SELECT " +
|
|
" r.id AS relationCode," +
|
|
" r.id AS relationCode," +
|
|
" r.patient ,r.patient_name as patientName " +
|
|
" r.patient ,r.patient_name as patientName " +
|
|
//AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
// " r.patient_name AS patientName, " +
|
|
|
|
" ,r.team_code AS teamCode, " +
|
|
" ,r.team_code AS teamCode, " +
|
|
" t.`name`, " +
|
|
" t.`name`, " +
|
|
" d.photo ," +
|
|
" d.photo ," +
|
|
" d.code AS doctor, r.doctor_name as doctorName" +
|
|
" d.code AS doctor, r.doctor_name as doctorName" +
|
|
// AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
|
|
|
|
// " d.name AS doctorName" +
|
|
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN wlyy_doctor d ON d. CODE = r.doctor " +
|
|
|
|
|
|
" JOIN base_doctor d ON d.id = r.doctor " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.patient = '"+patient+"' " +
|
|
" r.patient = '"+patient+"' " +
|
|
" AND r.doctor = '"+doctor+"' " +
|
|
" AND r.doctor = '"+doctor+"' " +
|
|
@ -498,7 +492,7 @@ public class SpecialistService{
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN wlyy_doctor d ON d. CODE = r.doctor " +
|
|
|
|
|
|
" JOIN base_doctor d ON d.id = r.doctor " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.patient = '"+patient+"' " +
|
|
" r.patient = '"+patient+"' " +
|
|
" AND r.team_code = " +teamCode+
|
|
" AND r.team_code = " +teamCode+
|
|
@ -538,7 +532,7 @@ public class SpecialistService{
|
|
" d.`name` AS doctorName " +
|
|
" d.`name` AS doctorName " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_admin_team_member m " +
|
|
" wlyy_admin_team_member m " +
|
|
" JOIN wlyy_doctor d ON m.doctor_code = d.`code` " +
|
|
|
|
|
|
" JOIN base_doctor d ON m.doctor_code = d.id " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" m.available='1' " +
|
|
" m.available='1' " +
|
|
" AND m.team_id="+teamId;
|
|
" AND m.team_id="+teamId;
|
|
@ -570,11 +564,7 @@ public class SpecialistService{
|
|
public MixEnvelop<PatientSignInfoVO, PatientSignInfoVO> findPatientSigninfo(String code){
|
|
public MixEnvelop<PatientSignInfoVO, PatientSignInfoVO> findPatientSigninfo(String code){
|
|
String sql = "SELECT " +
|
|
String sql = "SELECT " +
|
|
" r.patient ,r.patient_name as patientName" +
|
|
" r.patient ,r.patient_name as patientName" +
|
|
// AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
// " r.patient_name AS patientName, " +
|
|
|
|
" ,r.doctor ,r.doctor_name as doctorName" +
|
|
" ,r.doctor ,r.doctor_name as doctorName" +
|
|
//AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
|
|
|
|
// " r.doctor_name AS doctorName, " +
|
|
|
|
" ,d.hospital, " +
|
|
" ,d.hospital, " +
|
|
" d.hospital_name AS hospitalName, " +
|
|
" d.hospital_name AS hospitalName, " +
|
|
" d.photo, " +
|
|
" d.photo, " +
|
|
@ -588,7 +578,7 @@ public class SpecialistService{
|
|
" r.team_code AS teamCode " +
|
|
" r.team_code AS teamCode " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_doctor d ON r.doctor = d.code " +
|
|
|
|
|
|
" JOIN base_doctor d ON r.doctor = d.code " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.id = '"+code+"'";
|
|
" r.id = '"+code+"'";
|
|
@ -601,20 +591,16 @@ public class SpecialistService{
|
|
String sql = "SELECT " +
|
|
String sql = "SELECT " +
|
|
" r.id AS relationCode, " +
|
|
" r.id AS relationCode, " +
|
|
" r.patient, r.patient_name as patientName" +
|
|
" r.patient, r.patient_name as patientName" +
|
|
// AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
// " r.patient_name AS patientName, " +
|
|
|
|
" ,r.team_code,r.sign_date , " +
|
|
" ,r.team_code,r.sign_date , " +
|
|
" t.`name` AS name," +
|
|
" t.`name` AS name," +
|
|
" d.photo," +
|
|
" d.photo," +
|
|
" md.code AS doctor,md.name as doctorName" +
|
|
" md.code AS doctor,md.name as doctorName" +
|
|
// AesEncryptUtils.decryptMysql("md.name","doctorName") +
|
|
|
|
// " md.name AS doctorName," +
|
|
|
|
",d.hospital,d.hospital_name " +
|
|
",d.hospital,d.hospital_name " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN wlyy_doctor d ON t.leader_code = d.`code` " +
|
|
|
|
" JOIN wlyy_doctor md ON md.code = r.doctor " +
|
|
|
|
|
|
" JOIN base_doctor d ON t.leader_code = d.id " +
|
|
|
|
" JOIN base_doctor md ON md.code = r.doctor " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.patient = '"+patient+"' " +
|
|
" r.patient = '"+patient+"' " +
|
|
" AND r.`status` >=0 " +
|
|
" AND r.`status` >=0 " +
|
|
@ -635,11 +621,7 @@ public class SpecialistService{
|
|
" r.id AS relationCode, " +
|
|
" r.id AS relationCode, " +
|
|
" r.patient, " +
|
|
" r.patient, " +
|
|
" r.team_code AS teamCode,r.patient_name as patientName" +
|
|
" r.team_code AS teamCode,r.patient_name as patientName" +
|
|
// AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
// " r.patient_name AS patientName, " +
|
|
|
|
// " d.name AS doctorName, " +
|
|
|
|
",d.name as doctorName"+
|
|
",d.name as doctorName"+
|
|
// AesEncryptUtils.decryptMysql("d.name","doctorName") +
|
|
|
|
" ,d.code AS doctor, " +
|
|
" ,d.code AS doctor, " +
|
|
" d.photo, " +
|
|
" d.photo, " +
|
|
" d.dept, " +
|
|
" d.dept, " +
|
|
@ -651,7 +633,7 @@ public class SpecialistService{
|
|
" d.`level` " +
|
|
" d.`level` " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" JOIN wlyy_doctor d ON r.doctor = d.`code` " +
|
|
|
|
|
|
" JOIN base_doctor d ON r.doctor = d.id " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.patient ='"+patient+"' " +
|
|
" r.patient ='"+patient+"' " +
|
|
" AND r.`status`>=0 " +
|
|
" AND r.`status`>=0 " +
|
|
@ -668,11 +650,8 @@ public class SpecialistService{
|
|
" r.id AS relationCode," +
|
|
" r.id AS relationCode," +
|
|
" r.patient, " +
|
|
" r.patient, " +
|
|
" r.team_code AS teamCode,r.patient_name as patientName" +
|
|
" r.team_code AS teamCode,r.patient_name as patientName" +
|
|
// AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
" ,r.health_assistant AS healthAssistant,r.health_assistant_name as healthAssistantName" +
|
|
" ,r.health_assistant AS healthAssistant,r.health_assistant_name as healthAssistantName" +
|
|
//AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") +
|
|
|
|
" ,r.create_time AS createTime," +
|
|
" ,r.create_time AS createTime," +
|
|
// AesEncryptUtils.decryptMysql("d.name","doctorName") +
|
|
|
|
" d.name AS doctorName, " +
|
|
" d.name AS doctorName, " +
|
|
" ,d.code AS doctor, " +
|
|
" ,d.code AS doctor, " +
|
|
" d.photo, " +
|
|
" d.photo, " +
|
|
@ -683,16 +662,16 @@ public class SpecialistService{
|
|
" r.id AS specialCode, " +
|
|
" r.id AS specialCode, " +
|
|
" d.`level` " +
|
|
" d.`level` " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist.wlyy_specialist_patient_relation r " +
|
|
|
|
" JOIN wlyy_doctor d ON r.doctor = d.`code` " +
|
|
|
|
|
|
" wlyy_specialist_patient_relation r " +
|
|
|
|
" JOIN base_doctor d ON r.doctor = d.id " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.patient ='"+patient+"' " +
|
|
" r.patient ='"+patient+"' " +
|
|
" AND r.doctor in" +
|
|
" AND r.doctor in" +
|
|
" (SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m where m.team_id in " +
|
|
|
|
" (SELECT dt.id FROM wlyy.wlyy_admin_team dt LEFT JOIN wlyy.wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
|
|
|
|
" (SELECT m.doctor_code FROM wlyy_admin_team_member m where m.team_id in " +
|
|
|
|
" (SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctor+"') AND m.available='1')" +
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctor+"') AND m.available='1')" +
|
|
// " AND r.`status`>=0 " +
|
|
// " AND r.`status`>=0 " +
|
|
" AND r.sign_status >0 ) r join wlyy_patient p on r.patient = p.code order by p.czrq DESC ";
|
|
|
|
|
|
" AND r.sign_status >0 ) r join base_patient p on r.patient = p.code order by p.czrq DESC ";
|
|
List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
|
|
List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
|
|
PatientSignInfoVO patientSignInfoVO = (null != patientSignInfoVOs && patientSignInfoVOs.size() > 0 )? patientSignInfoVOs.get(0):null;
|
|
PatientSignInfoVO patientSignInfoVO = (null != patientSignInfoVOs && patientSignInfoVOs.size() > 0 )? patientSignInfoVOs.get(0):null;
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientSignInfoVO);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientSignInfoVO);
|
|
@ -705,7 +684,6 @@ public class SpecialistService{
|
|
if(StringUtils.isNotBlank(name)){
|
|
if(StringUtils.isNotBlank(name)){
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
"doctor.CODE AS CODE" +
|
|
"doctor.CODE AS CODE" +
|
|
// AesEncryptUtils.decryptMysql("doctor.name","name") +
|
|
|
|
",doctor.NAME AS NAME" +
|
|
",doctor.NAME AS NAME" +
|
|
",doctor.sex AS sex," +
|
|
",doctor.sex AS sex," +
|
|
"doctor.birthday AS birthday," +
|
|
"doctor.birthday AS birthday," +
|
|
@ -722,19 +700,13 @@ public class SpecialistService{
|
|
"doctor.czrq AS czrq," +
|
|
"doctor.czrq AS czrq," +
|
|
"doctor.del AS del," +
|
|
"doctor.del AS del," +
|
|
"doctor.idcard AS idcard " +
|
|
"doctor.idcard AS idcard " +
|
|
"FROM wlyy.wlyy_doctor doctor JOIN ( " +
|
|
|
|
"SELECT a.doctor AS doctorcode FROM wlyy.wlyy_sign_family a RIGHT JOIN ( " +
|
|
|
|
"SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " +
|
|
|
|
"UNION " +
|
|
|
|
"SELECT a.doctor_health AS doctorcode FROM wlyy.wlyy_sign_family a RIGHT JOIN ( " +
|
|
|
|
|
|
"FROM base_doctor doctor JOIN ( " +
|
|
|
|
"SELECT a.doctor AS doctorcode FROM wlyy_sign_family a RIGHT JOIN ( " +
|
|
"SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " +
|
|
"SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " +
|
|
") " +
|
|
|
|
|
|
|
|
"t ON doctor.CODE=t.doctorcode and doctor.NAME like '%"+name+"%'";
|
|
|
|
|
|
") t ON doctor.CODE=t.doctorcode and doctor.NAME like '%"+name+"%'";
|
|
}else{
|
|
}else{
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
"doctor.CODE AS CODE" +
|
|
"doctor.CODE AS CODE" +
|
|
// AesEncryptUtils.decryptMysql("doctor.name","name") +
|
|
|
|
",doctor.NAME AS NAME" +
|
|
",doctor.NAME AS NAME" +
|
|
",doctor.sex AS sex," +
|
|
",doctor.sex AS sex," +
|
|
"doctor.birthday AS birthday," +
|
|
"doctor.birthday AS birthday," +
|
|
@ -751,14 +723,10 @@ public class SpecialistService{
|
|
"doctor.czrq AS czrq," +
|
|
"doctor.czrq AS czrq," +
|
|
"doctor.del AS del," +
|
|
"doctor.del AS del," +
|
|
"doctor.idcard AS idcard " +
|
|
"doctor.idcard AS idcard " +
|
|
"FROM wlyy.wlyy_doctor doctor JOIN ( " +
|
|
|
|
"SELECT a.doctor AS doctorcode FROM wlyy.wlyy_sign_family a RIGHT JOIN ( " +
|
|
|
|
"SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " +
|
|
|
|
"UNION " +
|
|
|
|
"SELECT a.doctor_health AS doctorcode FROM wlyy.wlyy_sign_family a RIGHT JOIN ( " +
|
|
|
|
|
|
"FROM base_doctor doctor JOIN ( " +
|
|
|
|
"SELECT a.doctor AS doctorcode FROM wlyy_sign_family a RIGHT JOIN ( " +
|
|
"SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " +
|
|
"SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " +
|
|
") " +
|
|
|
|
"t ON doctor.CODE=t.doctorcode";
|
|
|
|
|
|
") t ON doctor.CODE=t.doctorcode";
|
|
}
|
|
}
|
|
|
|
|
|
List<SignFamilyDoctorVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamilyDoctorVO.class));
|
|
List<SignFamilyDoctorVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamilyDoctorVO.class));
|
|
@ -768,11 +736,11 @@ public class SpecialistService{
|
|
public MixEnvelop<Long,Long> findSpecialistSignFamilyPatientCout(String specialdoctor, String familydoctor) {
|
|
public MixEnvelop<Long,Long> findSpecialistSignFamilyPatientCout(String specialdoctor, String familydoctor) {
|
|
|
|
|
|
String sql = "SELECT count(1) AS total " +
|
|
String sql = "SELECT count(1) AS total " +
|
|
"FROM wlyy.wlyy_sign_family a WHERE a.`status`=1 AND a.expenses_status=1 " +
|
|
|
|
|
|
"FROM wlyy_sign_family a WHERE a.`status`=1 AND a.expenses_status=1 " +
|
|
"AND patient IN (" +
|
|
"AND patient IN (" +
|
|
"SELECT patient FROM wlyy_specialist.wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 " +
|
|
|
|
|
|
"SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 " +
|
|
"AND doctor='"+specialdoctor+"') " +
|
|
"AND doctor='"+specialdoctor+"') " +
|
|
"AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') ";
|
|
|
|
|
|
"AND a.doctor='"+familydoctor+"' ";
|
|
|
|
|
|
List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
Long count = 0L;
|
|
Long count = 0L;
|
|
@ -785,20 +753,18 @@ public class SpecialistService{
|
|
public MixEnvelop<PatientRelationVO,PatientRelationVO> getSpecialistSignFamilyPatientByName(String specialdoctor, String familydoctor, String nameKey, Integer page, Integer size) {
|
|
public MixEnvelop<PatientRelationVO,PatientRelationVO> getSpecialistSignFamilyPatientByName(String specialdoctor, String familydoctor, String nameKey, Integer page, Integer size) {
|
|
String sql ="SELECT " +
|
|
String sql ="SELECT " +
|
|
"p.CODE AS patient" +
|
|
"p.CODE AS patient" +
|
|
// AesEncryptUtils.decryptMysql("p.name","patientName") +
|
|
|
|
",p.`name` AS patientName" +
|
|
",p.`name` AS patientName" +
|
|
",p.photo," +
|
|
",p.photo," +
|
|
"IFNULL(YEAR (from_days(datediff(now(),p.birthday))),'未知') age," +
|
|
"IFNULL(YEAR (from_days(datediff(now(),p.birthday))),'未知') age," +
|
|
"p.sex " +
|
|
"p.sex " +
|
|
"FROM wlyy.wlyy_patient p " +
|
|
|
|
|
|
"FROM base_patient p " +
|
|
"JOIN ( " +
|
|
"JOIN ( " +
|
|
" SELECT a.patient FROM wlyy.wlyy_sign_family a WHERE patient IN (" +
|
|
|
|
|
|
" SELECT a.patient FROM wlyy_sign_family a WHERE patient IN (" +
|
|
" SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 " +
|
|
" SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 " +
|
|
" AND doctor='"+specialdoctor+"') " +
|
|
" AND doctor='"+specialdoctor+"') " +
|
|
" AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') ";
|
|
|
|
|
|
" AND a.doctor='"+familydoctor+"' ";
|
|
if(StringUtils.isNotBlank(nameKey)){
|
|
if(StringUtils.isNotBlank(nameKey)){
|
|
sql= sql + " AND a.name LIKE '%"+nameKey+"%' ";
|
|
sql= sql + " AND a.name LIKE '%"+nameKey+"%' ";
|
|
// sql= sql + " AND " + AesEncryptUtils.decryptMysqlNo("a.name") + " LIKE '%"+nameKey+"%' ";
|
|
|
|
}
|
|
}
|
|
sql= sql +" AND a.`status`=1 AND a.expenses_status=1) s ON p.CODE=s.patient" +
|
|
sql= sql +" AND a.`status`=1 AND a.expenses_status=1) s ON p.CODE=s.patient" +
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
@ -815,11 +781,10 @@ public class SpecialistService{
|
|
"IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
"IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
"p.birthday, " +
|
|
"p.birthday, " +
|
|
"p.photo " +
|
|
"p.photo " +
|
|
// "FROM (SELECT s.disease,s.disease_name,s.patient" + AesEncryptUtils.decryptMysql("s.patient_name","patient_name") + ",r.team_code from " +
|
|
|
|
"FROM (SELECT s.disease,s.disease_name,s.patient s.patient_name,r.team_code from " +
|
|
"FROM (SELECT s.disease,s.disease_name,s.patient s.patient_name,r.team_code from " +
|
|
"(SELECT id, team_code FROM wlyy_specialist_patient_relation WHERE doctor='" + doctor + "' and sign_status > 0 and `status` >= 0) r " +
|
|
"(SELECT id, team_code FROM wlyy_specialist_patient_relation WHERE doctor='" + doctor + "' and sign_status > 0 and `status` >= 0) r " +
|
|
"JOIN wlyy_patient_disease_server s on r.id = s.specialist_relation_code WHERE s.del = 1) s " +
|
|
"JOIN wlyy_patient_disease_server s on r.id = s.specialist_relation_code WHERE s.del = 1) s " +
|
|
"JOIN wlyy_patient p on s.patient = p.`code` where p.`status` >0 ";
|
|
|
|
|
|
"JOIN base_patient p on s.patient = p.id where p.`status` >0 ";
|
|
if(StringUtils.isNotBlank(patientInfo)){
|
|
if(StringUtils.isNotBlank(patientInfo)){
|
|
sql += " and p.idcard like '%"+ patientInfo +"%' or patient_name like '%" + patientInfo + "%'";
|
|
sql += " and p.idcard like '%"+ patientInfo +"%' or patient_name like '%" + patientInfo + "%'";
|
|
}
|
|
}
|
|
@ -842,19 +807,18 @@ public class SpecialistService{
|
|
String sql2 = " select p.name as name,p.idcard,p.code,p.photo ";
|
|
String sql2 = " select p.name as name,p.idcard,p.code,p.photo ";
|
|
String whereSql ="";
|
|
String whereSql ="";
|
|
if(!StringUtils.isEmpty(keywords)){
|
|
if(!StringUtils.isEmpty(keywords)){
|
|
// whereSql+=" and (p.name like '%"+keywords+"%' or p.idcard like '%"+keywords+"%' or p.mobile like '%"+keywords+"%') ";
|
|
|
|
whereSql+=" and p.mobile ='"+keywords+"'";
|
|
whereSql+=" and p.mobile ='"+keywords+"'";
|
|
}
|
|
}
|
|
String centerSql =" from wlyy_patient p " +
|
|
|
|
" WHERE p.code not in (SELECT r.patient FROM wlyy_specialist.wlyy_specialist_patient_relation r WHERE r.sign_status = '1' " +
|
|
|
|
|
|
String centerSql =" from base_patient p " +
|
|
|
|
" WHERE p.code not in (SELECT r.patient FROM wlyy_specialist_patient_relation r WHERE r.sign_status = '1' " +
|
|
" AND doctor in (SELECT m.doctor_code FROM wlyy_admin_team_member m where m.team_id in " +
|
|
" AND doctor in (SELECT m.doctor_code FROM wlyy_admin_team_member m where m.team_id in " +
|
|
" (SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
" (SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctorCode+"') AND m.available='1'))"
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctorCode+"') AND m.available='1'))"
|
|
+" AND p.openid IS NOT NULL "+
|
|
+" AND p.openid IS NOT NULL "+
|
|
whereSql;
|
|
whereSql;
|
|
|
|
|
|
String countCenterSql =" from wlyy_patient p " +
|
|
|
|
" WHERE p.code not in (SELECT r.patient FROM wlyy_specialist.wlyy_specialist_patient_relation r WHERE r.sign_status = '1'" +
|
|
|
|
|
|
String countCenterSql =" from base_patient p " +
|
|
|
|
" WHERE p.code not in (SELECT r.patient FROM wlyy_specialist_patient_relation r WHERE r.sign_status = '1'" +
|
|
" AND doctor in (SELECT m.doctor_code FROM wlyy_admin_team_member m where m.team_id in " +
|
|
" AND doctor in (SELECT m.doctor_code FROM wlyy_admin_team_member m where m.team_id in " +
|
|
" (SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
" (SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctorCode+"') AND m.available='1'))"
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctorCode+"') AND m.available='1'))"
|
|
@ -871,7 +835,7 @@ public class SpecialistService{
|
|
String sexName="";
|
|
String sexName="";
|
|
for(Map<String,Object> one:map){
|
|
for(Map<String,Object> one:map){
|
|
StringBuffer statusSql =new StringBuffer( " select CASE WHEN wsf.status ='-4' THEN '已到期' WHEN wsf.status ='0' THEN '待签约' WHEN wsf.status ='1' THEN '已签约' WHEN wsf.status ='2' THEN '已签约' WHEN wsf.status ='3' THEN '已签约' ELSE '待签约' END status ");
|
|
StringBuffer statusSql =new StringBuffer( " select CASE WHEN wsf.status ='-4' THEN '已到期' WHEN wsf.status ='0' THEN '待签约' WHEN wsf.status ='1' THEN '已签约' WHEN wsf.status ='2' THEN '已签约' WHEN wsf.status ='3' THEN '已签约' ELSE '待签约' END status ");
|
|
statusSql.append("FROM wlyy.wlyy_sign_family wsf, (SELECT patient,Max(apply_date) applyDate FROM wlyy.wlyy_sign_family WHERE type = '2' AND patient='"+one.get("code")+"' GROUP BY patient) temp WHERE wsf.patient=temp.patient AND wsf.apply_date=temp.applyDate");
|
|
|
|
|
|
statusSql.append("FROM wlyy_sign_family wsf, (SELECT patient,Max(apply_date) applyDate FROM wlyy_sign_family WHERE type = '2' AND patient='"+one.get("code")+"' GROUP BY patient) temp WHERE wsf.patient=temp.patient AND wsf.apply_date=temp.applyDate");
|
|
List<Map<String,Object>> strMap= jdbcTemplate.queryForList(statusSql.toString());
|
|
List<Map<String,Object>> strMap= jdbcTemplate.queryForList(statusSql.toString());
|
|
m = new HashMap();
|
|
m = new HashMap();
|
|
age = IdCardUtil.getAgeForIdcard(one.get("idcard")+"");
|
|
age = IdCardUtil.getAgeForIdcard(one.get("idcard")+"");
|
|
@ -894,7 +858,6 @@ public class SpecialistService{
|
|
}
|
|
}
|
|
Long co=Long.parseLong("100");
|
|
Long co=Long.parseLong("100");
|
|
return MixEnvelop.getSuccessListWithPage(SpecialistMapping.api_success,resultList,page,pageSize,countMap.size()>0?Long.valueOf(countMap.get(0).get("num")+""):0);
|
|
return MixEnvelop.getSuccessListWithPage(SpecialistMapping.api_success,resultList,page,pageSize,countMap.size()>0?Long.valueOf(countMap.get(0).get("num")+""):0);
|
|
// return MixEnvelop.getSuccessListWithPage(SpecialistMapping.api_success,resultList,page,pageSize,co);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -913,9 +876,9 @@ public class SpecialistService{
|
|
//1、获取居民基础信息
|
|
//1、获取居民基础信息
|
|
String preSql = "SELECT p.name as name, p.photo as photo,p.idcard as idcard,p.mobile as mobile,p.medicare_number as medicareNumber,p.ssc as ssc," +
|
|
String preSql = "SELECT p.name as name, p.photo as photo,p.idcard as idcard,p.mobile as mobile,p.medicare_number as medicareNumber,p.ssc as ssc," +
|
|
" CASE WHEN wd.name is null THEN '无' ELSE wd.name END as doctorName,CASE WHEN wd.hospital_name is NULL THEN '无' ELSE wd.hospital_name END as hospitalName,CASE WHEN wd.mobile is NULL THEN '无' ELSE wd.mobile END as doctorMobole ";
|
|
" CASE WHEN wd.name is null THEN '无' ELSE wd.name END as doctorName,CASE WHEN wd.hospital_name is NULL THEN '无' ELSE wd.hospital_name END as hospitalName,CASE WHEN wd.mobile is NULL THEN '无' ELSE wd.mobile END as doctorMobole ";
|
|
String patientSql = " from wlyy_patient p LEFT JOIN wlyy_sign_family wsf " +
|
|
|
|
|
|
String patientSql = " from base_patient p LEFT JOIN wlyy_sign_family wsf " +
|
|
" ON p.code=wsf.patient AND wsf.type='2' AND wsf.status='1' " +
|
|
" ON p.code=wsf.patient AND wsf.type='2' AND wsf.status='1' " +
|
|
" LEFT JOIN wlyy_doctor wd ON wsf.doctor =wd.code WHERE p.code='" + patientCode + "'";
|
|
|
|
|
|
" LEFT JOIN base_doctor wd ON wsf.doctor =wd.code WHERE p.id='" + patientCode + "'";
|
|
//一个居民 生效的家签信息只会有一条
|
|
//一个居民 生效的家签信息只会有一条
|
|
Map<String, Object> map = jdbcTemplate.queryForMap(preSql + patientSql);
|
|
Map<String, Object> map = jdbcTemplate.queryForMap(preSql + patientSql);
|
|
map.put("age",IdCardUtil.getAgeForIdcard(map.get("idcard")+""));
|
|
map.put("age",IdCardUtil.getAgeForIdcard(map.get("idcard")+""));
|
|
@ -932,11 +895,11 @@ public class SpecialistService{
|
|
jsonObject.put("patientInfo", map);
|
|
jsonObject.put("patientInfo", map);
|
|
|
|
|
|
//2、获取医生信息(所属医院、科室、姓名)
|
|
//2、获取医生信息(所属医院、科室、姓名)
|
|
String doctorSql = "SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM wlyy_doctor wd WHERE wd.code='" + doctorCode + "'";
|
|
|
|
|
|
String doctorSql = "SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM base_doctor wd WHERE wd.code='" + doctorCode + "'";
|
|
jsonObject.put("doctorInfo", jdbcTemplate.queryForMap(doctorSql));
|
|
jsonObject.put("doctorInfo", jdbcTemplate.queryForMap(doctorSql));
|
|
|
|
|
|
//3、获取该医生所属团队及团队成员信息
|
|
//3、获取该医生所属团队及团队成员信息
|
|
String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code, wd.NAME as doctorName FROM wlyy_doctor wd LEFT JOIN wlyy_admin_team_member tm ON wd. CODE = tm.doctor_code, wlyy_admin_team at " +
|
|
|
|
|
|
String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code, wd.NAME as doctorName FROM base_doctor wd LEFT JOIN wlyy_admin_team_member tm ON wd.id = tm.doctor_code, wlyy_admin_team at " +
|
|
"WHERE tm.team_id IN ( SELECT watm.team_id teamId FROM wlyy_admin_team_member watm WHERE watm.doctor_code ='" + doctorCode + "'" + " AND watm.available = '1' ) AND tm.available='1' AND `at`.id=tm.team_id";
|
|
"WHERE tm.team_id IN ( SELECT watm.team_id teamId FROM wlyy_admin_team_member watm WHERE watm.doctor_code ='" + doctorCode + "'" + " AND watm.available = '1' ) AND tm.available='1' AND `at`.id=tm.team_id";
|
|
List<Map<String, Object>> teamList = jdbcTemplate.queryForList(teamSql);
|
|
List<Map<String, Object>> teamList = jdbcTemplate.queryForList(teamSql);
|
|
Map<Integer, List<Map<String, Object>>> m = teamList.stream().collect(Collectors.groupingBy(tem -> ((Integer) tem.get("team_id")).intValue(), Collectors.toList()));
|
|
Map<Integer, List<Map<String, Object>>> m = teamList.stream().collect(Collectors.groupingBy(tem -> ((Integer) tem.get("team_id")).intValue(), Collectors.toList()));
|
|
@ -947,13 +910,11 @@ public class SpecialistService{
|
|
objectMap.put("teamName", m.get(i).get(0).get("teamName"));
|
|
objectMap.put("teamName", m.get(i).get(0).get("teamName"));
|
|
objectMap.put("teamDoctors", m.get(i));
|
|
objectMap.put("teamDoctors", m.get(i));
|
|
//获取专科团队疾病标签
|
|
//获取专科团队疾病标签
|
|
String disSql = "SELECT wtdr.disease_code, wtdr.disease_name from wlyy.wlyy_team_disease_relation wtdr WHERE wtdr.team_code ='" + i + "'" +" AND wtdr.del='1'";
|
|
|
|
//new BeanPropertyRowMapper(
|
|
|
|
|
|
String disSql = "SELECT wtdr.disease_code, wtdr.disease_name from wlyy_team_disease_relation wtdr WHERE wtdr.team_code ='" + i + "'" +" AND wtdr.del='1'";
|
|
List<Map<String, Object>> stringList = jdbcTemplate.queryForList(disSql);
|
|
List<Map<String, Object>> stringList = jdbcTemplate.queryForList(disSql);
|
|
String areaSql = "SELECT wpds.disease FROM wlyy.wlyy_patient_disease_server wpds WHERE wpds.patient='" + patientCode + "'" + " AND wpds.del='1'";
|
|
|
|
|
|
String areaSql = "SELECT wpds.disease FROM wlyy_patient_disease_server wpds WHERE wpds.patient='" + patientCode + "'" + " AND wpds.del='1'";
|
|
List<String> signDiseaseList = jdbcTemplate.queryForList(areaSql,String.class);
|
|
List<String> signDiseaseList = jdbcTemplate.queryForList(areaSql,String.class);
|
|
Set<String> stringSet =new HashSet<>(signDiseaseList);
|
|
Set<String> stringSet =new HashSet<>(signDiseaseList);
|
|
// stringSet.addAll(new HashSet<>(signDiseaseList));
|
|
|
|
//已签约的疾病状态改成1
|
|
//已签约的疾病状态改成1
|
|
stringList.stream().forEach(item->{
|
|
stringList.stream().forEach(item->{
|
|
item.put("status",stringSet.contains( item.get("disease_code"))?1:0) ;
|
|
item.put("status",stringSet.contains( item.get("disease_code"))?1:0) ;
|
|
@ -964,7 +925,7 @@ public class SpecialistService{
|
|
jsonObject.put("teamAndDoctors", mapList);
|
|
jsonObject.put("teamAndDoctors", mapList);
|
|
|
|
|
|
//康复情况标签
|
|
//康复情况标签
|
|
String labelSql = "SELECT wspl.label_code,wspl.label_name from wlyy.wlyy_sign_patient_label wspl WHERE wspl.label_type='8' AND status='1'";
|
|
|
|
|
|
String labelSql = "SELECT wspl.label_code,wspl.label_name from wlyy_sign_patient_label wspl WHERE wspl.label_type='8' AND status='1'";
|
|
List<Map<String, Object>> signPatientLabelList = jdbcTemplate.queryForList(labelSql);
|
|
List<Map<String, Object>> signPatientLabelList = jdbcTemplate.queryForList(labelSql);
|
|
jsonObject.put("signPatientLabels", signPatientLabelList);
|
|
jsonObject.put("signPatientLabels", signPatientLabelList);
|
|
return jsonObject;
|
|
return jsonObject;
|
|
@ -989,9 +950,9 @@ public class SpecialistService{
|
|
//1、获取居民基础信息
|
|
//1、获取居民基础信息
|
|
String preSql = "SELECT p.name as name, p.photo as photo,p.idcard as idcard,p.mobile as mobile,p.medicare_number as medicareNumber,p.ssc as ssc," +
|
|
String preSql = "SELECT p.name as name, p.photo as photo,p.idcard as idcard,p.mobile as mobile,p.medicare_number as medicareNumber,p.ssc as ssc," +
|
|
" CASE WHEN wd.name is null THEN '无' ELSE wd.name END as doctorName,CASE WHEN wd.hospital_name is NULL THEN '无' ELSE wd.hospital_name END as hospitalName,CASE WHEN wd.mobile is NULL THEN '无' ELSE wd.mobile END as doctorMobole ";
|
|
" CASE WHEN wd.name is null THEN '无' ELSE wd.name END as doctorName,CASE WHEN wd.hospital_name is NULL THEN '无' ELSE wd.hospital_name END as hospitalName,CASE WHEN wd.mobile is NULL THEN '无' ELSE wd.mobile END as doctorMobole ";
|
|
String patientSql = " from wlyy_patient p LEFT JOIN wlyy_sign_family wsf " +
|
|
|
|
|
|
String patientSql = " from base_patient p LEFT JOIN wlyy_sign_family wsf " +
|
|
" ON p.code=wsf.patient AND wsf.type='2' AND wsf.status='1' " +
|
|
" ON p.code=wsf.patient AND wsf.type='2' AND wsf.status='1' " +
|
|
" LEFT JOIN wlyy_doctor wd ON wsf.doctor =wd.code WHERE p.code='" + patientCode + "'";
|
|
|
|
|
|
" LEFT JOIN base_doctor wd ON wsf.doctor =wd.code WHERE p.code='" + patientCode + "'";
|
|
//一个居民 生效的家签信息只会有一条
|
|
//一个居民 生效的家签信息只会有一条
|
|
Map<String, Object> map = jdbcTemplate.queryForMap(preSql + patientSql);
|
|
Map<String, Object> map = jdbcTemplate.queryForMap(preSql + patientSql);
|
|
map.put("age",IdCardUtil.getAgeForIdcard(map.get("idcard")+""));
|
|
map.put("age",IdCardUtil.getAgeForIdcard(map.get("idcard")+""));
|
|
@ -1008,9 +969,9 @@ public class SpecialistService{
|
|
jsonObject.put("patientInfo", map);
|
|
jsonObject.put("patientInfo", map);
|
|
|
|
|
|
//2、获取医生信息(所属医院、科室、姓名)
|
|
//2、获取医生信息(所属医院、科室、姓名)
|
|
String doctorSql = "SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM wlyy_doctor wd WHERE wd.code='" + doctorCode + "'";;
|
|
|
|
|
|
String doctorSql = "SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM base_doctor wd WHERE wd.code='" + doctorCode + "'";;
|
|
if("0".equals(signStatus)){
|
|
if("0".equals(signStatus)){
|
|
doctorSql="SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM wlyy_doctor wd WHERE wd.code='" + specialistPatientRelationDO.getDoctor() + "'";
|
|
|
|
|
|
doctorSql="SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM base_doctor wd WHERE wd.code='" + specialistPatientRelationDO.getDoctor() + "'";
|
|
}
|
|
}
|
|
Map<String,Object> result =jdbcTemplate.queryForMap(doctorSql);
|
|
Map<String,Object> result =jdbcTemplate.queryForMap(doctorSql);
|
|
if ("0".equals(signStatus) && !(doctorCode.equals(specialistPatientRelationDO.getDoctor()))) {
|
|
if ("0".equals(signStatus) && !(doctorCode.equals(specialistPatientRelationDO.getDoctor()))) {
|
|
@ -1021,7 +982,7 @@ public class SpecialistService{
|
|
jsonObject.put("doctorInfo", result);
|
|
jsonObject.put("doctorInfo", result);
|
|
|
|
|
|
//3、获取该医生所属团队及团队成员信息
|
|
//3、获取该医生所属团队及团队成员信息
|
|
String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code, wd.NAME as doctorName FROM wlyy_doctor wd LEFT JOIN wlyy_admin_team_member tm ON wd. CODE = tm.doctor_code, wlyy_admin_team at " +
|
|
|
|
|
|
String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code, wd.NAME as doctorName FROM base_doctor wd LEFT JOIN wlyy_admin_team_member tm ON wd.id = tm.doctor_code, wlyy_admin_team at " +
|
|
"WHERE tm.team_id IN ( SELECT watm.team_id teamId FROM wlyy_admin_team_member watm WHERE watm.doctor_code ='" + doctorCode + "'" + " AND watm.available = '1' ) AND tm.available='1' AND `at`.id=tm.team_id";
|
|
"WHERE tm.team_id IN ( SELECT watm.team_id teamId FROM wlyy_admin_team_member watm WHERE watm.doctor_code ='" + doctorCode + "'" + " AND watm.available = '1' ) AND tm.available='1' AND `at`.id=tm.team_id";
|
|
List<Map<String, Object>> teamList = jdbcTemplate.queryForList(teamSql);
|
|
List<Map<String, Object>> teamList = jdbcTemplate.queryForList(teamSql);
|
|
Map<Integer, List<Map<String, Object>>> m = teamList.stream().collect(Collectors.groupingBy(tem -> ((Integer) tem.get("team_id")).intValue(), Collectors.toList()));
|
|
Map<Integer, List<Map<String, Object>>> m = teamList.stream().collect(Collectors.groupingBy(tem -> ((Integer) tem.get("team_id")).intValue(), Collectors.toList()));
|
|
@ -1037,15 +998,15 @@ public class SpecialistService{
|
|
objectMap.put("teamName", m.get(i).get(0).get("teamName"));
|
|
objectMap.put("teamName", m.get(i).get(0).get("teamName"));
|
|
objectMap.put("teamDoctors", m.get(i));
|
|
objectMap.put("teamDoctors", m.get(i));
|
|
//获取专科团队疾病标签
|
|
//获取专科团队疾病标签
|
|
String disSql = "SELECT wtdr.disease_code, wtdr.disease_name from wlyy.wlyy_team_disease_relation wtdr WHERE wtdr.team_code ='" + i + "'" +" AND wtdr.del='1'";
|
|
|
|
|
|
String disSql = "SELECT wtdr.disease_code, wtdr.disease_name from wlyy_team_disease_relation wtdr WHERE wtdr.team_code ='" + i + "'" +" AND wtdr.del='1'";
|
|
//new BeanPropertyRowMapper(
|
|
//new BeanPropertyRowMapper(
|
|
List<Map<String, Object>> stringList = jdbcTemplate.queryForList(disSql);
|
|
List<Map<String, Object>> stringList = jdbcTemplate.queryForList(disSql);
|
|
String areaSql = "SELECT wpds.disease FROM wlyy.wlyy_patient_disease_server wpds WHERE wpds.patient='" + patientCode + "'" + " AND wpds.del='1'";
|
|
|
|
|
|
String areaSql = "SELECT wpds.disease FROM wlyy_patient_disease_server wpds WHERE wpds.patient='" + patientCode + "'" + " AND wpds.del='1'";
|
|
List<String> signDiseaseList = jdbcTemplate.queryForList(areaSql,String.class);
|
|
List<String> signDiseaseList = jdbcTemplate.queryForList(areaSql,String.class);
|
|
Set<String> stringSet =new HashSet<>(signDiseaseList);
|
|
Set<String> stringSet =new HashSet<>(signDiseaseList);
|
|
List<String> speciaSignDiseaseList = new ArrayList<>();
|
|
List<String> speciaSignDiseaseList = new ArrayList<>();
|
|
if("0".equals(signStatus) ){
|
|
if("0".equals(signStatus) ){
|
|
String speciaSignSql = "SELECT wpds.disease FROM wlyy.wlyy_patient_disease_server wpds WHERE wpds.patient='" + patientCode + "'" + " AND wpds.del='1' and wpds.specialist_relation_code='" + specialistPatientRelationDO.getId() + "'";
|
|
|
|
|
|
String speciaSignSql = "SELECT wpds.disease FROM wlyy_patient_disease_server wpds WHERE wpds.patient='" + patientCode + "'" + " AND wpds.del='1' and wpds.specialist_relation_code='" + specialistPatientRelationDO.getId() + "'";
|
|
speciaSignDiseaseList = jdbcTemplate.queryForList(speciaSignSql,String.class);
|
|
speciaSignDiseaseList = jdbcTemplate.queryForList(speciaSignSql,String.class);
|
|
}
|
|
}
|
|
|
|
|
|
@ -1069,12 +1030,12 @@ public class SpecialistService{
|
|
jsonObject.put("teamAndDoctors", mapList);
|
|
jsonObject.put("teamAndDoctors", mapList);
|
|
|
|
|
|
//康复情况标签
|
|
//康复情况标签
|
|
String labelSql = "SELECT wspl.label_code,wspl.label_name from wlyy.wlyy_sign_patient_label wspl WHERE wspl.label_type='8' AND status='1'";
|
|
|
|
|
|
String labelSql = "SELECT wspl.label_code,wspl.label_name from wlyy_sign_patient_label wspl WHERE wspl.label_type='8' AND status='1'";
|
|
List<Map<String, Object>> signPatientLabelList = jdbcTemplate.queryForList(labelSql);
|
|
List<Map<String, Object>> signPatientLabelList = jdbcTemplate.queryForList(labelSql);
|
|
List<String> patientLabelList = new ArrayList<>();
|
|
List<String> patientLabelList = new ArrayList<>();
|
|
if("0".equals(signStatus) ){
|
|
if("0".equals(signStatus) ){
|
|
//居民的康复情况
|
|
//居民的康复情况
|
|
String patientLabelSql = "SELECT wspl.label from wlyy.wlyy_sign_patient_label_info wspl WHERE wspl.patient='"+patientCode+"' and wspl.label_type='8' AND status='1'";
|
|
|
|
|
|
String patientLabelSql = "SELECT wspl.label from wlyy_sign_patient_label_info wspl WHERE wspl.patient='"+patientCode+"' and wspl.label_type='8' AND status='1'";
|
|
patientLabelList = jdbcTemplate.queryForList(patientLabelSql,String.class);
|
|
patientLabelList = jdbcTemplate.queryForList(patientLabelSql,String.class);
|
|
}
|
|
}
|
|
Set<String> patientLabelSet =new HashSet<>(patientLabelList);
|
|
Set<String> patientLabelSet =new HashSet<>(patientLabelList);
|
|
@ -1140,7 +1101,6 @@ public class SpecialistService{
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public List<SpecialistPatientRelationDO> selectByAssistant(String patient,String doctor){
|
|
public List<SpecialistPatientRelationDO> selectByAssistant(String patient,String doctor){
|
|
|
|
|
|
String sql = "select *" +
|
|
String sql = "select *" +
|
|
" from wlyy_specialist_patient_relation r where r.health_assistant = '"+doctor+"' and r.patient = '"+patient+"' ";
|
|
" from wlyy_specialist_patient_relation r where r.health_assistant = '"+doctor+"' and r.patient = '"+patient+"' ";
|
|
List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
|
|
List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
|
|
@ -1160,9 +1120,9 @@ public class SpecialistService{
|
|
whereSql+=" and p.mobile ='"+keywords+"'";
|
|
whereSql+=" and p.mobile ='"+keywords+"'";
|
|
}
|
|
}
|
|
//根据手机号码精确查找居民
|
|
//根据手机号码精确查找居民
|
|
String centerSql =" from wlyy_patient p /*LEFT JOIN wlyy_specialist.wlyy_specialist_patient_relation r ON p.code=r.patient */where p.openid IS NOT NULL "+whereSql;
|
|
|
|
|
|
String centerSql =" from base_patient p where p.openid IS NOT NULL "+whereSql;
|
|
|
|
|
|
String signSql ="SELECT r.patient,r.sign_status FROM wlyy_specialist.wlyy_specialist_patient_relation r WHERE (r.sign_status = '1' or r.sign_status = '0') " +
|
|
|
|
|
|
String signSql ="SELECT r.patient,r.sign_status FROM wlyy_specialist_patient_relation r WHERE (r.sign_status = '1' or r.sign_status = '0') " +
|
|
" AND doctor in (SELECT m.doctor_code FROM wlyy_admin_team_member m where m.team_id in " +
|
|
" AND doctor in (SELECT m.doctor_code FROM wlyy_admin_team_member m where m.team_id in " +
|
|
" (SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
" (SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id=watm.team_id " +
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctorCode+"') AND m.available='1')";
|
|
" WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctorCode+"') AND m.available='1')";
|
|
@ -1224,9 +1184,9 @@ public class SpecialistService{
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public SpecialistPatientRelationDO selectByDoctorAndPatient(String doctor,String patient){
|
|
public SpecialistPatientRelationDO selectByDoctorAndPatient(String doctor,String patient){
|
|
String sql = "select * from wlyy_specialist.wlyy_specialist_patient_relation r where r.doctor in ( " +
|
|
|
|
" SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m " +
|
|
|
|
" WHERE m.team_id IN ( SELECT dt.id FROM wlyy.wlyy_admin_team dt LEFT JOIN wlyy.wlyy_admin_team_member watm ON dt.id = watm.team_id WHERE " +
|
|
|
|
|
|
String sql = "select * from wlyy_specialist_patient_relation r where r.doctor in ( " +
|
|
|
|
" SELECT m.doctor_code FROM wlyy_admin_team_member m " +
|
|
|
|
" WHERE m.team_id IN ( SELECT dt.id FROM wlyy_admin_team dt LEFT JOIN wlyy_admin_team_member watm ON dt.id = watm.team_id WHERE " +
|
|
" dt.available = '1' AND watm.available = '1' AND watm.doctor_code = '"+doctor+"') AND m.available = '1' ) and r.patient = '"+patient+"' and r.sign_status=0";
|
|
" dt.available = '1' AND watm.available = '1' AND watm.doctor_code = '"+doctor+"') AND m.available = '1' ) and r.patient = '"+patient+"' and r.sign_status=0";
|
|
List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
|
|
List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
|
|
SpecialistPatientRelationDO specialistPatientRelationDO=null!=relationDOS&&relationDOS.size()>0?relationDOS.get(0):new SpecialistPatientRelationDO();
|
|
SpecialistPatientRelationDO specialistPatientRelationDO=null!=relationDOS&&relationDOS.size()>0?relationDOS.get(0):new SpecialistPatientRelationDO();
|
|
@ -1239,7 +1199,7 @@ public class SpecialistService{
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Map<String,Object> getMessageByRelationId(String relationId){
|
|
public Map<String,Object> getMessageByRelationId(String relationId){
|
|
String sql = "select w.* from wlyy.wlyy_message w where w.type='16' and w.relation_code='" + relationId + "' ";
|
|
|
|
|
|
String sql = "select w.* from wlyy_message w where w.type='16' and w.relation_code='" + relationId + "' ";
|
|
List<Map<String,Object>> res= jdbcTemplate.queryForList(sql);
|
|
List<Map<String,Object>> res= jdbcTemplate.queryForList(sql);
|
|
if(null!=res&&res.size()>0){
|
|
if(null!=res&&res.size()>0){
|
|
return res.get(0);
|
|
return res.get(0);
|
|
@ -1253,7 +1213,7 @@ public class SpecialistService{
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public void updateMessageByRelationId(String relationId){
|
|
public void updateMessageByRelationId(String relationId){
|
|
String sql = "update wlyy.wlyy_message set has_read=0 ,over=0 where relation_code='" + relationId + "' ";
|
|
|
|
|
|
String sql = "update wlyy_message set has_read=0 ,over=0 where relation_code='" + relationId + "' ";
|
|
jdbcTemplate.execute(sql);
|
|
jdbcTemplate.execute(sql);
|
|
}
|
|
}
|
|
|
|
|
|
@ -1269,32 +1229,19 @@ public class SpecialistService{
|
|
if (!teamCode.equals(toTeamCode)){//跨团队
|
|
if (!teamCode.equals(toTeamCode)){//跨团队
|
|
flag=true;
|
|
flag=true;
|
|
}
|
|
}
|
|
String sql =" select name from wlyy.wlyy_doctor where code='"+toDoctorCode+"'";
|
|
|
|
|
|
String sql =" select name from base_doctor where code='"+toDoctorCode+"'";
|
|
String toDoctorName = jdbcTemplate.queryForObject(sql,String.class);
|
|
String toDoctorName = jdbcTemplate.queryForObject(sql,String.class);
|
|
// toDoctorName = AesEncryptUtils.decrypt(toDoctorName);
|
|
|
|
sql =" select name from wlyy.wlyy_doctor where code='"+doctorCode+"'";
|
|
|
|
|
|
sql =" select name from base_doctor where code='"+doctorCode+"'";
|
|
String doctorName = jdbcTemplate.queryForObject(sql,String.class);
|
|
String doctorName = jdbcTemplate.queryForObject(sql,String.class);
|
|
// doctorName = AesEncryptUtils.decrypt(doctorName);
|
|
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
JSONArray planObject = new JSONArray();
|
|
JSONArray planObject = new JSONArray();
|
|
JSONArray planDetailObject = new JSONArray();
|
|
JSONArray planDetailObject = new JSONArray();
|
|
JSONArray specialistPatientRelation = new JSONArray();
|
|
JSONArray specialistPatientRelation = new JSONArray();
|
|
JSONArray rehabilitationOperateRecords = new JSONArray();
|
|
JSONArray rehabilitationOperateRecords = new JSONArray();
|
|
for (String patientCode:patient){
|
|
for (String patientCode:patient){
|
|
sql ="select name from wlyy.wlyy_patient where code='"+patientCode+"' ";
|
|
|
|
|
|
sql ="select name from base_patient where code='"+patientCode+"' ";
|
|
String patientName = jdbcTemplate.queryForObject(sql,String.class);
|
|
String patientName = jdbcTemplate.queryForObject(sql,String.class);
|
|
Long admin_team_code = 0L;
|
|
Long admin_team_code = 0L;
|
|
//判断是否签约,如果签约 新增家签团队id
|
|
|
|
try{
|
|
|
|
String sqltmp = "SELECT a.admin_team_code from wlyy.wlyy_sign_family a WHERE patient = '"+patientCode+"' and `status`>0 and expenses_status =1 order by id desc limit 1 ";
|
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sqltmp);
|
|
|
|
if(list!=null&&list.size()>0){
|
|
|
|
admin_team_code = Long.valueOf(list.get(0).get("admin_team_code")+"");
|
|
|
|
}
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
// patientName = AesEncryptUtils.decrypt(patientName);
|
|
|
|
List<PatientRehabilitationPlanDO> planList = patientRehabilitationPlanDao.findByPatientAndCreateUserAndTeamCode(patientCode,doctorCode,Integer.parseInt(teamCode));{
|
|
List<PatientRehabilitationPlanDO> planList = patientRehabilitationPlanDao.findByPatientAndCreateUserAndTeamCode(patientCode,doctorCode,Integer.parseInt(teamCode));{
|
|
for (PatientRehabilitationPlanDO plan:planList){
|
|
for (PatientRehabilitationPlanDO plan:planList){
|
|
plan.setCreateUser(toDoctorCode);
|
|
plan.setCreateUser(toDoctorCode);
|
|
@ -1377,7 +1324,7 @@ public class SpecialistService{
|
|
}
|
|
}
|
|
specialistPatientRelationDao.save(relationDO);
|
|
specialistPatientRelationDao.save(relationDO);
|
|
specialistPatientRelation.add(relationDO.getId());
|
|
specialistPatientRelation.add(relationDO.getId());
|
|
sql = "UPDATE wlyy.wlyy_patient_disease_server set specialist_relation_code='"+relationDO.getId()+"' \n" +
|
|
|
|
|
|
sql = "UPDATE wlyy_patient_disease_server set specialist_relation_code='"+relationDO.getId()+"' \n" +
|
|
"where specialist_relation_code='"+relationDoBefore.getId()+"'";
|
|
"where specialist_relation_code='"+relationDoBefore.getId()+"'";
|
|
jdbcTemplate.execute(sql);
|
|
jdbcTemplate.execute(sql);
|
|
}
|
|
}
|
|
@ -1391,7 +1338,7 @@ public class SpecialistService{
|
|
relations.setUpdateUserName(doctorName);
|
|
relations.setUpdateUserName(doctorName);
|
|
specialistPatientRelationDao.save(relations);
|
|
specialistPatientRelationDao.save(relations);
|
|
specialistPatientRelation.add(relations.getId());
|
|
specialistPatientRelation.add(relations.getId());
|
|
sql = "UPDATE wlyy.wlyy_patient_disease_server set specialist_relation_code='"+relations.getId()+"' \n" +
|
|
|
|
|
|
sql = "UPDATE wlyy_patient_disease_server set specialist_relation_code='"+relations.getId()+"' \n" +
|
|
"where specialist_relation_code='"+relationDoBefore.getId()+"'";
|
|
"where specialist_relation_code='"+relationDoBefore.getId()+"'";
|
|
jdbcTemplate.execute(sql);
|
|
jdbcTemplate.execute(sql);
|
|
}
|
|
}
|