|
@ -66,11 +66,20 @@ public class PatientLableService extends BaseJpaService<WlyyPatientLabelDO, Wlyy
|
|
|
String sql = "SELECT DISTINCT p.id,p.name,p.photo,p.idcard,p.mobile,p.openid,p.sex,p.pad_imei padImei " ;
|
|
|
sql +=",(select COUNT(*) from wlyy_patient_device a where a.`user` = p.id and a.del=0) deviceFlag ";
|
|
|
String countSql = "SELECT count(DISTINCT p.id) ";
|
|
|
String filters = "from base_service_package_sign_record sr,base_service_package_record r, " +
|
|
|
" base_patient p,wlyy_patient_label l " +
|
|
|
" WHERE sr.id = r.sign_id and sr.status=1 " +
|
|
|
" and r.team_code = '"+teamCode+"' " +
|
|
|
" and sr.patient = p.id and p.id = l.patient and l.label_type = 1 and l.label_code = '"+labelCode+"' ";
|
|
|
String filters ="";
|
|
|
if(StringUtils.isNotBlank(labelCode)){
|
|
|
filters = "from base_service_package_sign_record sr,base_service_package_record r, " +
|
|
|
" base_patient p,wlyy_patient_label l " +
|
|
|
" WHERE sr.id = r.sign_id and sr.status=1 " +
|
|
|
" and r.team_code = '"+teamCode+"' " +
|
|
|
" and sr.patient = p.id and p.id = l.patient and l.label_type = 1 and l.label_code = '"+labelCode+"' ";
|
|
|
}else {
|
|
|
filters = "from base_service_package_sign_record sr,base_service_package_record r, " +
|
|
|
" base_patient p,wlyy_patient_label l " +
|
|
|
" WHERE sr.id = r.sign_id and sr.status=1 " +
|
|
|
" and r.team_code = '"+teamCode+"' " +
|
|
|
" and sr.patient = p.id and p.id = l.patient and l.label_type = 1 ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(name)){
|
|
|
filters += " and (p.name like '%"+name+"%' or p.idcard like '%"+name+"%') ";
|
|
|
}
|