|
@ -55,7 +55,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
String fastdfs_file_url;
|
|
|
|
|
|
//获取居民端取药码列表
|
|
|
public JSONArray findByStatusAndTime(Integer timeType, String patientCode, Integer status, Integer page, Integer pagesize) {
|
|
|
public JSONArray findByStatusAndTime(Integer timeType, String patientCode, Integer status, Integer page, Integer pagesize,Integer type) {
|
|
|
// 分页信息
|
|
|
long timeLimit = 0;
|
|
|
if(timeType!=null){
|
|
@ -67,8 +67,9 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
List<Object> params = new ArrayList<>();
|
|
|
String precriptionSql = "select * from wlyy_prescription_dispensary_code p2 left join wlyy_prescription p1 on p2.prescription_code=p1.code LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code where 1=1 ";
|
|
|
|
|
|
String precriptionSql = "select p2.*,p1.diagnosis as diagnosis ,p3.address as address from wlyy_prescription_dispensary_code p2 left join wlyy_prescription p1 on p2.prescription_code=p1.code LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code where p1.patient=? and p2.type=? ";
|
|
|
params.add(patientCode);
|
|
|
params.add(type);
|
|
|
if(status!=null){
|
|
|
precriptionSql += " and p1.status = ? ";
|
|
|
params.add(status);
|
|
@ -76,14 +77,14 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
precriptionSql += " and p1.status in (20,21,100)" ;
|
|
|
}
|
|
|
if(timeType!=null){
|
|
|
precriptionSql += "and TIMESTAMPDIFF(SECOND, a.create_Time, CURRENT_TIME) > ? ORDER BY p1.status desc ,p2.create_Time desc ";
|
|
|
precriptionSql += "and TIMESTAMPDIFF(SECOND, p2.create_Time, CURRENT_TIME) < ? ORDER BY p1.status desc ,p2.create_Time desc ";
|
|
|
params.add(timeLimit);
|
|
|
}
|
|
|
precriptionSql += " limit "+(page-1)*pagesize+","+pagesize;
|
|
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(precriptionSql,params.toArray());
|
|
|
List<Map<String, Object>> result2 = new ArrayList<>();
|
|
|
for (Map<String, Object> m:result) {
|
|
|
List<PrescriptionInfo> list = prescriptionInfoDao.findByPrescriptionCode(m.get("code").toString());
|
|
|
List<PrescriptionInfo> list = prescriptionInfoDao.findByPrescriptionCode(m.get("prescription_code").toString());
|
|
|
m.put("data",list);
|
|
|
result2.add(m);
|
|
|
}
|