|
@ -6603,20 +6603,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
*/
|
|
*/
|
|
public PageEnvelop findPatientAllPrescription(String keyName,String status,Integer page, Integer size) {
|
|
public PageEnvelop findPatientAllPrescription(String keyName,String status,Integer page, Integer size) {
|
|
String uid = userAgent.getUID();
|
|
String uid = userAgent.getUID();
|
|
StringBuffer sql = new StringBuffer("SELECT b.*, c.oneself_pickup_flg FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
|
|
|
|
|
|
StringBuffer sql = new StringBuffer("SELECT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
|
|
StringBuffer countSql = new StringBuffer("select COUNT(b.id) count FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
|
|
StringBuffer countSql = new StringBuffer("select COUNT(b.id) count FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
|
|
sql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id");
|
|
|
|
countSql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id ");
|
|
|
|
|
|
sql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id ");
|
|
|
|
countSql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id ");
|
|
|
|
|
|
if (StringUtils.isNotEmpty(keyName)){
|
|
if (StringUtils.isNotEmpty(keyName)){
|
|
sql.append(" AND (" +
|
|
|
|
|
|
sql.append(" where (" +
|
|
" b.doctor_name LIKE '%"+keyName+"%' " +
|
|
" b.doctor_name LIKE '%"+keyName+"%' " +
|
|
" OR b.dept_name LIKE'%"+keyName+"%' " +
|
|
" OR b.dept_name LIKE'%"+keyName+"%' " +
|
|
" OR b.hospital_name LIKE '%"+keyName+"%' " +
|
|
" OR b.hospital_name LIKE '%"+keyName+"%' " +
|
|
" OR d.drug_name LIKE '%"+keyName+"%' " +
|
|
" OR d.drug_name LIKE '%"+keyName+"%' " +
|
|
" OR b.real_order LIKE '%"+keyName+"%' " +
|
|
" OR b.real_order LIKE '%"+keyName+"%' " +
|
|
")");
|
|
")");
|
|
countSql.append(" AND (" +
|
|
|
|
|
|
countSql.append(" where (" +
|
|
" b.doctor_name LIKE '%"+keyName+"%' " +
|
|
" b.doctor_name LIKE '%"+keyName+"%' " +
|
|
" OR b.dept_name LIKE'%"+keyName+"%' " +
|
|
" OR b.dept_name LIKE'%"+keyName+"%' " +
|
|
" OR b.hospital_name LIKE '%"+keyName+"%' " +
|
|
" OR b.hospital_name LIKE '%"+keyName+"%' " +
|