|
@ -88,12 +88,7 @@ public class SpecialistService{
|
|
"WHERE " +
|
|
"WHERE " +
|
|
" r.doctor = '"+doctor+"' AND r.status >=0 AND r.sign_status >0 ORDER BY r.create_time DESC LIMIT "+(page-1)*size+","+size;
|
|
" r.doctor = '"+doctor+"' AND r.status >=0 AND r.sign_status >0 ORDER BY r.create_time DESC LIMIT "+(page-1)*size+","+size;
|
|
|
|
|
|
List<String> tmpDeList = new ArrayList<>();
|
|
|
|
tmpDeList.add("r.doctor_name");
|
|
|
|
tmpDeList.add("r.patient_name");
|
|
|
|
tmpDeList.add("r.health_doctor_name");
|
|
|
|
tmpDeList.add("r.sign_doctor_name");
|
|
|
|
sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
|
|
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.doctor_name","r.patient_name","r.health_doctor_name","r.sign_doctor_name");
|
|
List<SpecialistPatientRelationVO> specialistPatientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationVO.class));
|
|
List<SpecialistPatientRelationVO> specialistPatientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationVO.class));
|
|
|
|
|
|
String sqlcount = "SELECT count(1) AS total " +
|
|
String sqlcount = "SELECT count(1) AS total " +
|
|
@ -158,9 +153,8 @@ public class SpecialistService{
|
|
" i.label_type = '7' AND " +
|
|
" i.label_type = '7' AND " +
|
|
" i.status = 1 " +
|
|
" i.status = 1 " +
|
|
" )";
|
|
" )";
|
|
List<String> tmpDeList = new ArrayList<>();
|
|
|
|
tmpDeList.add("r.patient_name");
|
|
|
|
sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
|
|
|
|
|
|
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
|
|
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
@ -203,9 +197,7 @@ public class SpecialistService{
|
|
" r.doctor = '"+doctor+"' AND r.status >=0 AND r.sign_status >0 "+
|
|
" r.doctor = '"+doctor+"' AND r.status >=0 AND r.sign_status >0 "+
|
|
" AND r.health_assistant = '"+assistant+"' LIMIT "+(page-1)*size+","+size;
|
|
" AND r.health_assistant = '"+assistant+"' LIMIT "+(page-1)*size+","+size;
|
|
|
|
|
|
List<String> tmpDeList = new ArrayList<>();
|
|
|
|
tmpDeList.add("r.patient_name");
|
|
|
|
sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
|
|
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
|
|
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
@ -248,10 +240,7 @@ public class SpecialistService{
|
|
" ) lb " +
|
|
" ) lb " +
|
|
" JOIN "+basedb+".wlyy_patient p ON p. CODE = lb.patient " +
|
|
" JOIN "+basedb+".wlyy_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 ";
|
|
List<String> tmpDeList = new ArrayList<>();
|
|
|
|
tmpDeList.add("s.patient_name");
|
|
|
|
tmpDeList.add("s.health_assistant_name");
|
|
|
|
sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
|
|
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"s.patient_name","s.health_assistant_name");
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
if(StringUtils.isNotBlank(shareDoctor)){
|
|
sql = sql + " JOIN "+basedb+".wlyy_doctor_special_share sp ON s.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
|
|
sql = sql + " JOIN "+basedb+".wlyy_doctor_special_share sp ON s.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
|
|
}
|
|
}
|
|
@ -284,10 +273,7 @@ public class SpecialistService{
|
|
// "AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
|
|
// "AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
|
|
" AND a.team_code ='" +teamCode+"' "+
|
|
" AND a.team_code ='" +teamCode+"' "+
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
tmpDeList = new ArrayList<>();
|
|
|
|
tmpDeList.add("a.patient_name");
|
|
|
|
tmpDeList.add("a.health_assistant_name");
|
|
|
|
sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
|
|
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"a.patient_name","a.health_assistant_name");
|
|
}
|
|
}
|
|
|
|
|
|
if("pending".equals(labelType)){
|
|
if("pending".equals(labelType)){
|
|
@ -305,10 +291,7 @@ public class SpecialistService{
|
|
" 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;
|
|
tmpDeList = new ArrayList<>();
|
|
|
|
tmpDeList.add("a.patient_name");
|
|
|
|
tmpDeList.add("a.health_assistant_name");
|
|
|
|
sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
|
|
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"a.patient_name","a.health_assistant_name");
|
|
}
|
|
}
|
|
List<PatientLabelVO> PatientLabelVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientLabelVO.class));
|
|
List<PatientLabelVO> PatientLabelVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientLabelVO.class));
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,PatientLabelVOs);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,PatientLabelVOs);
|
|
@ -358,7 +341,7 @@ public class SpecialistService{
|
|
|
|
|
|
public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByName(String doctor, String nameKey,String teamCode, Integer page, Integer size){
|
|
public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByName(String doctor, String nameKey,String teamCode, Integer page, Integer size){
|
|
String sql ="SELECT " +
|
|
String sql ="SELECT " +
|
|
" p.code AS patient,r.patient_name as patientName, " +
|
|
|
|
|
|
" p.code AS patient,r.patient_name as 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, " +
|
|
@ -374,8 +357,9 @@ public class SpecialistService{
|
|
" t.label_name, " +
|
|
" t.label_name, " +
|
|
" t.patient " +
|
|
" t.patient " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+basedb+".wlyy_sign_patient_label_info t " +
|
|
|
|
" WHERE " +
|
|
|
|
|
|
" "+basedb+".wlyy_sign_patient_label_info t ";
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
|
|
|
|
String tmpSql = " WHERE " +
|
|
" t.label_type = '8' " +
|
|
" t.label_type = '8' " +
|
|
" AND t.`status` = '1' " +
|
|
" AND t.`status` = '1' " +
|
|
" ) h ON h.patient = r.patient " +
|
|
" ) h ON h.patient = r.patient " +
|
|
@ -383,9 +367,10 @@ public class SpecialistService{
|
|
" 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.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 " + AesEncryptUtils.decryptMysqlNo("r.patient_name") + " LIKE '%"+nameKey+"%' "+
|
|
|
|
|
|
" AND " + "r.patient_name" + " LIKE '%"+nameKey+"%' "+
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
|
|
|
|
|
|
tmpSql = TransforSqlUtl.wlyySpecialistPatientRelationLike(tmpSql,"r.patient_name");
|
|
|
|
sql = sql+tmpSql;
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
|
|
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
@ -394,8 +379,7 @@ public class SpecialistService{
|
|
|
|
|
|
public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByNameOrIdCard(String doctor, String filter,String teamCode, Integer page, Integer size){
|
|
public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByNameOrIdCard(String doctor, String filter,String teamCode, Integer page, Integer size){
|
|
String sql ="SELECT " +
|
|
String sql ="SELECT " +
|
|
" p.code AS code " +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
|
|
" p.code AS code,r.patient_name as patientName " +
|
|
// " p.`name` AS name, " +
|
|
// " p.`name` AS name, " +
|
|
" ,p.photo, " +
|
|
" ,p.photo, " +
|
|
" IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
" IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
@ -412,8 +396,9 @@ public class SpecialistService{
|
|
" t.label_name, " +
|
|
" t.label_name, " +
|
|
" t.patient " +
|
|
" t.patient " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+basedb+".wlyy_sign_patient_label_info t " +
|
|
|
|
" WHERE " +
|
|
|
|
|
|
" "+basedb+".wlyy_sign_patient_label_info t " ;
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
|
|
|
|
String sqlTmp= " WHERE " +
|
|
" t.label_type = '8' " +
|
|
" t.label_type = '8' " +
|
|
" AND t.`status` = '1' " +
|
|
" AND t.`status` = '1' " +
|
|
" ) h ON h.patient = r.patient " +
|
|
" ) h ON h.patient = r.patient " +
|
|
@ -421,9 +406,10 @@ public class SpecialistService{
|
|
" 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.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 (" + AesEncryptUtils.decryptMysqlNo("r.patient_name") + " LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+
|
|
|
|
|
|
" AND (" + "r.patient_name" + " LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
|
|
|
|
|
|
sqlTmp = TransforSqlUtl.wlyySpecialistPatientRelationLike(sqlTmp,"r.patient_name");
|
|
|
|
sql = sql+sqlTmp;
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
|
|
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
|
|
@ -460,8 +446,8 @@ public class SpecialistService{
|
|
}
|
|
}
|
|
|
|
|
|
String sql ="SELECT " +
|
|
String sql ="SELECT " +
|
|
" p.code AS patient " +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
|
|
" p.code AS patient ,r.patient_name as patientName" +
|
|
|
|
//AesEncryptUtils.decryptMysql("r.patient_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, " +
|
|
@ -487,6 +473,7 @@ public class SpecialistService{
|
|
" AND r.status >=0 AND r.sign_status >0 " +
|
|
" AND r.status >=0 AND r.sign_status >0 " +
|
|
" AND r.health_assistant IS NULL "+
|
|
" AND r.health_assistant IS NULL "+
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
|
|
|
|
|
|
return MixEnvelop.getSuccessList(SpecialistMapping.api_success,patientRelationVOs,total.intValue());
|
|
return MixEnvelop.getSuccessList(SpecialistMapping.api_success,patientRelationVOs,total.intValue());
|
|
@ -498,14 +485,14 @@ public class SpecialistService{
|
|
//1.查询该居民是否已经与该专科医生签约
|
|
//1.查询该居民是否已经与该专科医生签约
|
|
String checkDoctorSql = "SELECT " +
|
|
String checkDoctorSql = "SELECT " +
|
|
" r.id AS relationCode," +
|
|
" r.id AS relationCode," +
|
|
" r.patient " +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
|
|
" r.patient ,r.patient_name as patientName " +
|
|
|
|
//AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
// " r.patient_name AS 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" +
|
|
|
|
AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
|
|
|
|
|
|
" d.code AS doctor, r.doctor_name as doctorName" +
|
|
|
|
// AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
|
|
// " d.name AS doctorName" +
|
|
// " d.name AS doctorName" +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
" wlyy_specialist_patient_relation r " +
|
|
@ -517,6 +504,7 @@ public class SpecialistService{
|
|
" AND r.`status` >= 0 " +
|
|
" AND r.`status` >= 0 " +
|
|
" AND r.sign_status >=0 " +
|
|
" AND r.sign_status >=0 " +
|
|
" AND t.available = '1' ";
|
|
" AND t.available = '1' ";
|
|
|
|
checkDoctorSql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(checkDoctorSql,"r.patient_name","r.doctor_name");
|
|
List<SpecialistTeamVO> specialistTeamVOs = jdbcTemplate.query(checkDoctorSql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
|
|
List<SpecialistTeamVO> specialistTeamVOs = jdbcTemplate.query(checkDoctorSql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
|
|
|
|
|
|
if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){
|
|
if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){
|
|
@ -531,8 +519,8 @@ public class SpecialistService{
|
|
//验证团队是否已经签约
|
|
//验证团队是否已经签约
|
|
String checkTeamSql = "SELECT " +
|
|
String checkTeamSql = "SELECT " +
|
|
" r.id AS relationCode," +
|
|
" r.id AS relationCode," +
|
|
" r.patient " +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
|
|
" r.patient ,r.patient_name as patientName" +
|
|
|
|
//AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
// " r.patient_name AS patientName, " +
|
|
// " r.patient_name AS patientName, " +
|
|
" ,r.team_code AS teamCode, " +
|
|
" ,r.team_code AS teamCode, " +
|
|
" t.`name`, " +
|
|
" t.`name`, " +
|
|
@ -547,6 +535,7 @@ public class SpecialistService{
|
|
" AND r.`status` >=0 " +
|
|
" AND r.`status` >=0 " +
|
|
" AND r.sign_status >=0 " +
|
|
" AND r.sign_status >=0 " +
|
|
" AND t.available = '1' ";
|
|
" AND t.available = '1' ";
|
|
|
|
checkTeamSql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(checkTeamSql,"r.patient_name");
|
|
List<SpecialistTeamVO> teamVOs = jdbcTemplate.query(checkTeamSql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
|
|
List<SpecialistTeamVO> teamVOs = jdbcTemplate.query(checkTeamSql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
|
|
if(teamVOs!=null&&teamVOs.size()>0){
|
|
if(teamVOs!=null&&teamVOs.size()>0){
|
|
|
|
|
|
@ -612,11 +601,11 @@ 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 " +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
|
|
" r.patient ,r.patient_name as patientName" +
|
|
|
|
// AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
// " r.patient_name AS patientName, " +
|
|
// " r.patient_name AS patientName, " +
|
|
" ,r.doctor " +
|
|
|
|
AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
|
|
|
|
|
|
" ,r.doctor ,r.doctor_name as doctorName" +
|
|
|
|
//AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
|
|
// " r.doctor_name AS doctorName, " +
|
|
// " r.doctor_name AS doctorName, " +
|
|
" ,d.hospital, " +
|
|
" ,d.hospital, " +
|
|
" d.hospital_name AS hospitalName, " +
|
|
" d.hospital_name AS hospitalName, " +
|
|
@ -635,6 +624,7 @@ public class SpecialistService{
|
|
" JOIN "+basedb+".wlyy_admin_team t ON t.id = r.team_code " +
|
|
" JOIN "+basedb+".wlyy_admin_team t ON t.id = r.team_code " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" r.id = '"+code+"'";
|
|
" r.id = '"+code+"'";
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name","r.doctor_name");
|
|
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) : new PatientSignInfoVO());
|
|
PatientSignInfoVO patientSignInfoVO = (null != patientSignInfoVOs && patientSignInfoVOs.size() > 0 ? patientSignInfoVOs.get(0) : new PatientSignInfoVO());
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientSignInfoVO);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientSignInfoVO);
|
|
@ -643,14 +633,14 @@ public class SpecialistService{
|
|
public MixEnvelop<SpecialistTeamVO, SpecialistTeamVO> findPatientTeamList(String patient){
|
|
public MixEnvelop<SpecialistTeamVO, SpecialistTeamVO> findPatientTeamList(String patient){
|
|
String sql = "SELECT " +
|
|
String sql = "SELECT " +
|
|
" r.id AS relationCode, " +
|
|
" r.id AS relationCode, " +
|
|
" r.patient " +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
|
|
" r.patient r.patient_name as patientName" +
|
|
|
|
// AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
// " r.patient_name AS 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" +
|
|
|
|
AesEncryptUtils.decryptMysql("md.name","doctorName") +
|
|
|
|
|
|
" md.code AS doctor,md.name as doctorName" +
|
|
|
|
// AesEncryptUtils.decryptMysql("md.name","doctorName") +
|
|
// " md.name AS doctorName," +
|
|
// " md.name AS doctorName," +
|
|
",d.hospital,d.hospital_name " +
|
|
",d.hospital,d.hospital_name " +
|
|
" FROM " +
|
|
" FROM " +
|
|
@ -662,6 +652,7 @@ public class SpecialistService{
|
|
" r.patient = '"+patient+"' " +
|
|
" r.patient = '"+patient+"' " +
|
|
" AND r.`status` >=0 " +
|
|
" AND r.`status` >=0 " +
|
|
" AND r.sign_status >0";
|
|
" AND r.sign_status >0";
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
|
|
List<SpecialistTeamVO> specialistTeamVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
|
|
List<SpecialistTeamVO> specialistTeamVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
|
|
if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){
|
|
if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){
|
|
|
|
|
|
@ -677,11 +668,12 @@ public class SpecialistService{
|
|
String sql = "SELECT " +
|
|
String sql = "SELECT " +
|
|
" r.id AS relationCode, " +
|
|
" r.id AS relationCode, " +
|
|
" r.patient, " +
|
|
" r.patient, " +
|
|
" r.team_code AS teamCode" +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
|
|
" r.team_code AS teamCode,r.patient_name as patientName" +
|
|
|
|
// AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
// " r.patient_name AS patientName, " +
|
|
// " r.patient_name AS patientName, " +
|
|
// " d.name AS doctorName, " +
|
|
// " d.name AS doctorName, " +
|
|
AesEncryptUtils.decryptMysql("d.name","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, " +
|
|
@ -698,6 +690,7 @@ public class SpecialistService{
|
|
" r.patient ='"+patient+"' " +
|
|
" r.patient ='"+patient+"' " +
|
|
" AND r.`status`>=0 " +
|
|
" AND r.`status`>=0 " +
|
|
" AND r.sign_status >0";
|
|
" AND r.sign_status >0";
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
|
|
List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
|
|
List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs);
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs);
|
|
}
|
|
}
|
|
@ -709,15 +702,13 @@ public class SpecialistService{
|
|
"(SELECT " +
|
|
"(SELECT " +
|
|
" r.id AS relationCode," +
|
|
" r.id AS relationCode," +
|
|
" r.patient, " +
|
|
" r.patient, " +
|
|
" r.team_code AS teamCode" +
|
|
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
// " r.patient_name AS patientName, " +
|
|
|
|
" ,r.health_assistant AS healthAssistant" +
|
|
|
|
AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") +
|
|
|
|
// " r.health_assistant_name AS healthAssistantName," +
|
|
|
|
" ,r.create_time AS createTime" +
|
|
|
|
AesEncryptUtils.decryptMysql("d.name","doctorName") +
|
|
|
|
// " d.name AS doctorName, " +
|
|
|
|
|
|
" 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" +
|
|
|
|
//AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") +
|
|
|
|
" ,r.create_time AS createTime," +
|
|
|
|
// AesEncryptUtils.decryptMysql("d.name","doctorName") +
|
|
|
|
" d.name AS doctorName, " +
|
|
" ,d.code AS doctor, " +
|
|
" ,d.code AS doctor, " +
|
|
" d.photo, " +
|
|
" d.photo, " +
|
|
" d.dept, " +
|
|
" d.dept, " +
|
|
@ -737,6 +728,7 @@ public class SpecialistService{
|
|
" 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 "+basedb+".wlyy_patient p on r.patient = p.code order by p.czrq DESC ";
|
|
" AND r.sign_status >0 ) r join "+basedb+".wlyy_patient p on r.patient = p.code order by p.czrq DESC ";
|
|
|
|
sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name","r.health_assistant_name");
|
|
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);
|
|
@ -749,8 +741,8 @@ 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," +
|
|
|
|
|
|
// AesEncryptUtils.decryptMysql("doctor.name","name") +
|
|
|
|
",doctor.NAME AS NAME" +
|
|
",doctor.sex AS sex," +
|
|
",doctor.sex AS sex," +
|
|
"doctor.birthday AS birthday," +
|
|
"doctor.birthday AS birthday," +
|
|
"doctor.photo AS photo," +
|
|
"doctor.photo AS photo," +
|
|
@ -774,12 +766,12 @@ public class SpecialistService{
|
|
"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 " + AesEncryptUtils.decryptMysqlNo("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," +
|
|
|
|
|
|
// AesEncryptUtils.decryptMysql("doctor.name","name") +
|
|
|
|
",doctor.NAME AS NAME" +
|
|
",doctor.sex AS sex," +
|
|
",doctor.sex AS sex," +
|
|
"doctor.birthday AS birthday," +
|
|
"doctor.birthday AS birthday," +
|
|
"doctor.photo AS photo," +
|
|
"doctor.photo AS photo," +
|
|
@ -829,8 +821,8 @@ 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," +
|
|
|
|
|
|
// AesEncryptUtils.decryptMysql("p.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 " +
|
|
@ -841,8 +833,8 @@ public class SpecialistService{
|
|
" AND doctor='"+specialdoctor+"') " +
|
|
" AND doctor='"+specialdoctor+"') " +
|
|
" AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') ";
|
|
" AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') ";
|
|
if(StringUtils.isNotBlank(nameKey)){
|
|
if(StringUtils.isNotBlank(nameKey)){
|
|
|
|
|
|
sql= sql + " AND " + AesEncryptUtils.decryptMysqlNo("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;
|
|
@ -859,7 +851,8 @@ 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" + 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 " +
|
|
"(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 "+basedb+".wlyy_patient_disease_server s on r.id = s.specialist_relation_code WHERE s.del = 1) s " +
|
|
"JOIN "+basedb+".wlyy_patient_disease_server s on r.id = s.specialist_relation_code WHERE s.del = 1) s " +
|
|
"JOIN "+basedb+".wlyy_patient p on s.patient = p.`code` where p.`status` >0 ";
|
|
"JOIN "+basedb+".wlyy_patient p on s.patient = p.`code` where p.`status` >0 ";
|
|
@ -1186,13 +1179,8 @@ public class SpecialistService{
|
|
public List<SpecialistPatientRelationDO> selectByAssistant(String patient,String doctor){
|
|
public List<SpecialistPatientRelationDO> selectByAssistant(String patient,String doctor){
|
|
|
|
|
|
String sql = "select *" +
|
|
String sql = "select *" +
|
|
AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
|
|
|
|
AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
|
|
|
|
AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") +
|
|
|
|
AesEncryptUtils.decryptMysql("r.health_doctor_name","healthDoctorName") +
|
|
|
|
AesEncryptUtils.decryptMysql("r.sign_doctor_name","signDoctorName") +
|
|
|
|
AesEncryptUtils.decryptMysql("r.create_user_name","createUserName") +
|
|
|
|
" 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+"' ";
|
|
|
|
sql = TransforSqlUtl.specialistPatientRelationAll(sql);
|
|
List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
|
|
List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
|
|
return relationDOS;
|
|
return relationDOS;
|
|
}
|
|
}
|
|
@ -1279,6 +1267,7 @@ public class SpecialistService{
|
|
" SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m " +
|
|
" 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 " +
|
|
" 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 " +
|
|
" 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";
|
|
|
|
sql = TransforSqlUtl.specialistPatientRelationAll(sql);
|
|
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();
|
|
return specialistPatientRelationDO;
|
|
return specialistPatientRelationDO;
|