|
@ -187,8 +187,6 @@ public class SpecialistService{
|
|
|
|
|
|
|
|
|
public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType, String labelCode, Integer page, Integer size){
|
|
|
|
|
|
|
|
|
String sql="SELECT " +
|
|
|
" p. NAME, " +
|
|
|
" p. CODE, " +
|
|
@ -223,7 +221,11 @@ public class SpecialistService{
|
|
|
" ) lb " +
|
|
|
" JOIN "+basedb+".wlyy_patient p ON p. CODE = lb.patient " +
|
|
|
" JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient " +
|
|
|
" WHERE ( s.doctor ='"+doctor+"' OR s.health_doctor='"+doctor+"' OR s.health_assistant='"+doctor+ "') AND s.status >=0 AND s.sign_status >0"+
|
|
|
" WHERE s.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 dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctor+"') AND m.available='1') "+
|
|
|
" AND s.status >=0 AND s.sign_status >0"+
|
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
|
System.out.print("日志:"+sql);
|
|
|
if("7".equals(labelType)){
|
|
@ -242,13 +244,15 @@ public class SpecialistService{
|
|
|
"JOIN "+basedb+".wlyy_patient_disease_server b ON a.id=b.specialist_relation_code AND b.disease=" +labelCode+" and b.del=1 "+
|
|
|
"JOIN "+basedb+".wlyy_patient c ON a.patient=c.CODE " +
|
|
|
"LEFT JOIN "+basedb+".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 AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
|
|
|
"' LIMIT "+(page-1)*size+","+size;
|
|
|
" WHERE a.sign_status> 0 AND a.`status`>=0 " +
|
|
|
// "AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
|
|
|
" AND a.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 dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctor+"') AND m.available='1') "+
|
|
|
" LIMIT "+(page-1)*size+","+size;
|
|
|
}
|
|
|
|
|
|
|
|
|
List<PatientLabelVO> PatientLabelVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientLabelVO.class));
|
|
|
|
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,PatientLabelVOs);
|
|
|
}
|
|
|
|
|
@ -624,7 +628,8 @@ public class SpecialistService{
|
|
|
" 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 ";
|
|
|
List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
|
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs.get(0));
|
|
|
PatientSignInfoVO patientSignInfoVO = (null == patientSignInfoVOs && patientSignInfoVOs.size() > 0 )? null : patientSignInfoVOs.get(0);
|
|
|
return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientSignInfoVO);
|
|
|
}
|
|
|
|
|
|
public MixEnvelop findDoctorAndDoctorHealthBySpecialDoctor(String doctor,String name) {
|