Browse Source

代码修改

liubing 3 years ago
parent
commit
a34462a2d9

+ 3 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java

@ -75,12 +75,14 @@ public class PadDeviceController extends BaseController {
    @RequestMapping(value = "PatientDeviceList", method = RequestMethod.GET)
    public String getDeviceByPatient(@ApiParam(name = "patientName", value = "居民姓名", defaultValue = "张")
                                     @RequestParam(value = "patientName", required = false) String patientName,
                                     @ApiParam(name = "doctor", value = "doctor")
                                     @RequestParam(value = "doctor", required = false) String doctor,
                                     @ApiParam(name = "page", value = "分页起始id", defaultValue = "1")
                                     @RequestParam(value = "page", required = true) int page,
                                     @ApiParam(name = "pagesize", value = "每页条数", defaultValue = "10")
                                     @RequestParam(value = "pagesize", required = true) int pagesize) {
        try {
            List<Map<String , Object>> list = patientDeviceService.findDeviceFromAdmin(patientName, page, pagesize);
            List<Map<String , Object>> list = patientDeviceService.findDeviceFromAdmin(doctor,patientName, page, pagesize);
            return write(200, "查询成功", "data", list);
        } catch (Exception ex) {

+ 7 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -388,7 +388,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        return page;
    }
    public List<Map<String , Object>> findDeviceFromAdmin(String patientName, int page, int pageSize) {
    public List<Map<String , Object>> findDeviceFromAdmin(String doctor,String patientName, int page, int pageSize) {
        String sql = "select Distinct p.id,p.`name`,dd.photo,pd.device_id deviceId,pd.category_code categoryCode,pd.device_name deviceName, " +
                " pd.device_sn deviceSn,pd.czrq,pd.doctor,pd.doctor_name doctorName,pd.agent,pd.agent_name agentName " +
                " from wlyy_patient_device pd,wlyy_devices wd,base_patient p,dm_device dd where p.id = pd.`user`  and pd.del = 0 " +
@ -396,6 +396,12 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        if (StringUtils.isNotBlank(patientName)){
            sql += " AND (p.`name` LIKE '%" + patientName +"%' or  p.idcard LIKE '%" + patientName + "%') ";
        }
        if (StringUtils.isNotBlank(doctor)){//著老远查看时之查看签约居民的绑定
            sql += " and EXISTS (SELECT sr.patient from base_service_package_sign_record sr,base_service_package_record r,base_team_member m " +
                    " WHERE sr.patient = p.id and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id " +
                    " and m.doctor_code = '"+doctor+"' and m.del = '1') ";
        }
        sql += " ORDER BY pd.czrq DESC LIMIT "+ (page-1)*pageSize +" , " + pageSize + " ";
        List<Map<String , Object>> list = jdbcTemplate.queryForList(sql);
        return list;