|
@ -6609,15 +6609,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
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(status)){
|
|
|
status= status.substring(1, status.length() - 1);
|
|
|
sql.append(" where b.status IN(").append(status).append(")");
|
|
|
countSql.append(" where b.status IN(").append(status).append(")");
|
|
|
}else {
|
|
|
sql.append(" where b.status IN(20,21,30,31,32,100,101)");
|
|
|
countSql.append(" where b.status IN(20,21,30,31,32,100,101) ");
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(keyName)){
|
|
|
sql.append(" where (" +
|
|
|
sql.append(" and (" +
|
|
|
" b.doctor_name LIKE '%"+keyName+"%' " +
|
|
|
" OR b.dept_name LIKE'%"+keyName+"%' " +
|
|
|
" OR b.hospital_name LIKE '%"+keyName+"%' " +
|
|
|
" OR d.drug_name LIKE '%"+keyName+"%' " +
|
|
|
" OR b.real_order LIKE '%"+keyName+"%' " +
|
|
|
")");
|
|
|
countSql.append(" where (" +
|
|
|
countSql.append(" and (" +
|
|
|
" b.doctor_name LIKE '%"+keyName+"%' " +
|
|
|
" OR b.dept_name LIKE'%"+keyName+"%' " +
|
|
|
" OR b.hospital_name LIKE '%"+keyName+"%' " +
|
|
@ -6625,15 +6634,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" OR b.real_order LIKE '%"+keyName+"%' " +
|
|
|
")");
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(status)){
|
|
|
|
|
|
status= status.substring(1, status.length() - 1);
|
|
|
sql.append(" AND b.status IN(").append(status).append(")");
|
|
|
countSql.append(" AND b.status IN(").append(status).append(")");
|
|
|
}else {
|
|
|
sql.append(" and b.status IN(20,21,30,31,32,100,101)");
|
|
|
countSql.append(" and b.status IN(20,21,30,31,32,100,101) ");
|
|
|
}
|
|
|
sql.append(" order by b.prescribe_time DESC limit ").append((page-1)*size).append(",").append(size);
|
|
|
List<WlyyPrescriptionVO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(countSql.toString());
|