|
@ -8546,12 +8546,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param size
|
|
|
* @return
|
|
|
*/
|
|
|
public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size) {
|
|
|
String uid = userAgent.getUID();
|
|
|
public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient) {
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patient);
|
|
|
if (patientDO==null){
|
|
|
return PageEnvelop.getError("找不到该患者",-1);
|
|
|
}
|
|
|
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 left join wlyy_outpatient o ON o.id=a.outpatient_id WHERE o.consumer = '");
|
|
|
StringBuffer countSql = new StringBuffer("select COUNT(b.id) count FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id WHERE o.consumer = '");
|
|
|
sql.append(uid).append("') b 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_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id ");
|
|
|
sql.append(patient).append("') b 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(patient).append("') b 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(status)) {
|
|
|
status = status.substring(1, status.length() - 1);
|