Selaa lähdekoodia

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

liubing 3 vuotta sitten
vanhempi
commit
f4b37c141e

+ 47 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java

@ -1,8 +1,13 @@
package com.yihu.jw.care.endpoint.statistics;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.endpoint.BaseController;
import com.yihu.jw.care.service.device.PatientDeviceService;
import com.yihu.jw.care.service.statistics.DetectionPlatformService;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
@ -11,10 +16,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/***
 * @ClassName: DetectionPlatformEndpoint
@ -30,6 +32,8 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DetectionPlatformService platformService;
    @Autowired
    private PatientDeviceService patientDeviceService;
    @GetMapping(value = "getHealthMonitoringListNew")
    @ApiOperation(value = "体征监测/安防监护")
@ -109,4 +113,43 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
        }
    }
    @ApiOperation("获取设备详情信息")
    @RequestMapping(value = "getPatientDeviceDetail",method = RequestMethod.GET)
    public Envelop getPatientDeviceDetail(@ApiParam(name="patient")
                                         @RequestParam(value = "patient")String patient,
                                          @ApiParam(name="deviceSN")
                                         @RequestParam(value = "deviceSN")String deviceSn,
                                          @ApiParam(name="day",value = "yyyy-mm-dd")
                                         @RequestParam(value = "day",required = false)String day){
        try {
            org.json.JSONObject result = patientDeviceService.getPatientDeviceDetail(patient,deviceSn,day);
            if (result.getInt(ResponseContant.resultFlag)==ResponseContant.success){
                return success(JSON.parseObject(result.getString(ResponseContant.resultMsg)));
            }else {
                return success(result.getString(ResponseContant.resultMsg), -1);
            }
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
    }
    @ApiOperation("获取设备详情数据 --设备可多人绑定查询数据时与patient无关")
    @RequestMapping(value = "getPatientDeviceData",method = RequestMethod.GET)
    public Envelop getPatientDeviceData(@ApiParam(name="patient")
                                       @RequestParam(value = "patient")String patient,
                                       @ApiParam(name="deviceSN")
                                       @RequestParam(value = "deviceSN")String deviceSn,
                                       @ApiParam(name="page")
                                       @RequestParam(value = "page")Integer page,
                                       @ApiParam(name="pageSize")
                                       @RequestParam(value = "pageSize")Integer pageSize){
        try {
            return success(patientDeviceService.getPatientDeviceData(patient,deviceSn,page,pageSize));
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
    }
}

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

@ -910,88 +910,93 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
            result.put(ResponseContant.resultMsg,"未查询到该设备");
        }else {
            DevicePatientDevice device = devices.get(0);
            if (!patient.equals(device.getUser())){
                result.put(ResponseContant.resultFlag,ResponseContant.fail);
                result.put(ResponseContant.resultMsg,"居民未绑定该设备");
            }else {
                String sql = "select dd.photo,GROUP_CONCAT( p.name) as patientName,pd.device_sn,dd.brands,dd.category_code,dd.model,pd.device_name,date_format(pd.czrq,'%Y-%m-%d %H:%i:%S' ) deviceTime,wd.manufacturer,p.mobile,p.address,p.idcard,wd.device_type  " +
                        "from dm_device dd INNER JOIN wlyy_patient_device pd on dd.category_code = pd.category_code INNER JOIN base_patient p on p.id = pd.user " +
                        " INNER JOIN wlyy_devices wd on dd.model = wd.device_model and pd.device_sn = wd.device_code " +
                        "where 1=1 and  pd.del=0 and pd.device_sn ='"+deviceSn+"' group by pd.device_sn";
                Map<String,Object> devInfo = jdbcTemplate.queryForMap(sql);
                devInfo.put("patient",patient);
                devInfo.put("sosContactsDOS",new ArrayList<>());
                String dataSql= "";
                String recordSql = "";
                List<Map<String , Object>> dataList = new ArrayList<>();
                List<Map<String , Object>> recordList = new ArrayList<>();
                String addresSql = "SELECT sp.org_code orgCode,sp.org_name orgName FROM base_service_package_record spr , base_service_package sp\n" +
                        "WHERE spr.service_package_id = sp.id AND spr.patient = '"+patient+"' AND sp.org_code IS NOT NULL GROUP BY sp.org_code,sp.org_name";
                List<Map<String, Object>> addressList = jdbcTemplate.queryForList(addresSql);
                if (addressList.size() > 0) {
                    devInfo.put("orgName",addressList.get(0).get("orgName"));
                    devInfo.put("orgCode",addressList.get(0).get("orgCode"));
                } else {
                    devInfo.put("orgName","");
                    devInfo.put("orgCode","");
                }
//            if (!patient.equals(device.getUser())){
//                result.put(ResponseContant.resultFlag,ResponseContant.fail);
//                result.put(ResponseContant.resultMsg,"居民未绑定该设备");
//            }else {
            String sql = "select dd.photo,GROUP_CONCAT(DISTINCT p.name) as patientName,pd.device_sn,dd.brands,dd.category_code,dd.model,pd.device_name,date_format(pd.czrq,'%Y-%m-%d %H:%i:%S' ) deviceTime,wd.manufacturer,p.mobile,p.address,p.idcard,wd.device_type  " +
                    "from dm_device dd INNER JOIN wlyy_patient_device pd on dd.category_code = pd.category_code INNER JOIN base_patient p on p.id = pd.user " +
                    " INNER JOIN wlyy_devices wd on dd.model = wd.device_model and pd.device_sn = wd.device_code " +
                    "where 1=1 and  pd.del=0 and pd.device_sn ='" + deviceSn + "' group by pd.device_sn";
            Map<String, Object> devInfo = jdbcTemplate.queryForMap(sql);
            devInfo.put("patient", patient);
            devInfo.put("sosContactsDOS", new ArrayList<>());
            String dataSql = "";
            String recordSql = "";
            List<Map<String, Object>> dataList = new ArrayList<>();
            List<Map<String, Object>> recordList = new ArrayList<>();
            String addresSql = "SELECT sp.org_code orgCode,sp.org_name orgName FROM base_service_package_record spr , base_service_package sp\n" +
                    "WHERE spr.service_package_id = sp.id AND spr.patient = '" + patient + "' AND sp.org_code IS NOT NULL GROUP BY sp.org_code,sp.org_name";
            List<Map<String, Object>> addressList = jdbcTemplate.queryForList(addresSql);
            if (addressList.size() > 0) {
                devInfo.put("orgName", addressList.get(0).get("orgName"));
                devInfo.put("orgCode", addressList.get(0).get("orgCode"));
            } else {
                devInfo.put("orgName", "");
                devInfo.put("orgCode", "");
            }
                if ("4".equals(device.getCategoryCode())||"7".equals(device.getCategoryCode())){
                    devInfo.put("sosContactsDOS",contactsService.getPatientSosContacts(patient));
                }
                com.alibaba.fastjson.JSONObject devInfoObj = JSON.parseObject(JSON.toJSONString(devInfo, SerializerFeature.WriteMapNullValue));
                switch (device.getCategoryCode()){
                    case "1"://血压设备
                        dataSql = "SELECT record_date recordDate,value1,value2,value3,value4,value5,value6,value7,type FROM wlyy_patient_health_index WHERE device_sn = '"+deviceSn+"' AND del = 1 ORDER BY sort_date DESC LIMIT 10";
                        dataList = jdbcTemplate.queryForList(dataSql);
                        devInfoObj.put("data",dataList);
                        break;
                    case "2"://血糖设备
                        dataSql = "SELECT record_date recordDate,value1,value2,value3,value4,value5,value6,value7,type FROM wlyy_patient_health_index WHERE device_sn = '"+deviceSn+"' AND del = 1 ORDER BY sort_date DESC LIMIT 10";
                        dataList = jdbcTemplate.queryForList(dataSql);
                        devInfoObj.put("data",dataList);
                        break;
                    case "4"://手表 围栏与轨迹
                        if (StringUtils.isBlank(day)){
                            day = DateUtil.getStringDateShort();
                        }
                        devInfoObj =  securityMonitoringOrderService.patientSignTopicInfo(devInfoObj,patient,"preventLost");
                        //轨迹动态
                        JSONArray locations = getX1Locations(deviceSn,day.replace("-",""));
                        devInfoObj.put("routes",locations);
                        break;
                    case "7"://报警器 紧急工单
                        break;
                    case "12"://监控 视频地址
                        com.alibaba.fastjson.JSONObject tmp =ysDeviceService.getDeviceLiveAddress(patient,deviceSn,1,null);
                        devInfoObj.put("monitorInfoStatus",tmp.getIntValue(ResponseContant.resultFlag));
                        if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                            devInfoObj.put("monitorInfo",tmp.getString(ResponseContant.resultMsg));
                        }
                        else {
                            devInfoObj.put("monitorInfo",tmp.getJSONObject(ResponseContant.resultMsg));
                        }
                        break;
                    case "13"://睡眠带 获取当天睡眠详情
                        securityMonitoringOrderService.preventOutOfBed(devInfoObj,patient,false,day);
                        break;
                    case "14"://气感报警器 当天监测记录以及最新浓度
                        if (StringUtils.isBlank(day)){
                            day = DateUtil.getStringDateShort();
                        }
                        List<Map<String,Object>> listTmp = gasConcentration(patient,day,deviceSn);
                        devInfoObj.put("monitorInfo",listTmp);
                        devInfoObj.put("day",day);
                        securityMonitoringOrderService.preventGasLeakage(devInfoObj,patient,false);
                        break;
                    case "15"://烟感报警器 获取最新浓度
                        securityMonitoringOrderService.preventFire(devInfoObj,patient,deviceSn,false);
                        devInfoObj.put("day",DateUtil.getStringDateShort());
                        break;
                }
            if ("4".equals(device.getCategoryCode()) || "7".equals(device.getCategoryCode())) {
                devInfo.put("sosContactsDOS", contactsService.getPatientSosContacts(patient));
            }
            com.alibaba.fastjson.JSONObject devInfoObj = JSON.parseObject(JSON.toJSONString(devInfo, SerializerFeature.WriteMapNullValue));
            switch (device.getCategoryCode()) {
                case "1"://血压设备
                    dataSql = "SELECT record_date recordDate,value1,value2,value3,value4,value5,value6,value7,type FROM wlyy_patient_health_index WHERE device_sn = '" + deviceSn + "' AND del = 1 ORDER BY sort_date DESC LIMIT 10";
                    dataList = jdbcTemplate.queryForList(dataSql);
                    devInfoObj.put("data", dataList);
                    break;
                case "2"://血糖设备
                    dataSql = "SELECT record_date recordDate,value1,value2,value3,value4,value5,value6,value7,type FROM wlyy_patient_health_index WHERE device_sn = '" + deviceSn + "' AND del = 1 ORDER BY sort_date DESC LIMIT 10";
                    dataList = jdbcTemplate.queryForList(dataSql);
                    devInfoObj.put("data", dataList);
                    break;
                case "4"://手表 围栏与轨迹
                    if (StringUtils.isBlank(day)) {
                        day = DateUtil.getStringDateShort();
                    }
                    devInfoObj = securityMonitoringOrderService.patientSignTopicInfo(devInfoObj, patient, "preventLost");
                    //轨迹动态
                    JSONArray locations = getX1Locations(deviceSn, day.replace("-", ""));
                    devInfoObj.put("routes", locations);
                    break;
                case "7"://报警器 紧急工单
                    break;
                case "12"://监控 视频地址
                    com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getDeviceLiveAddress(patient, deviceSn, 1, null);
                    devInfoObj.put("monitorInfoStatus", tmp.getIntValue(ResponseContant.resultFlag));
                    if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                        devInfoObj.put("monitorInfo", tmp.getString(ResponseContant.resultMsg));
                    } else {
                        devInfoObj.put("monitorInfo", tmp.getJSONObject(ResponseContant.resultMsg));
                    }
                    break;
                case "13"://睡眠带 获取当天睡眠详情
                    securityMonitoringOrderService.preventOutOfBed(devInfoObj, patient, false, day);
                    break;
                case "14"://气感报警器 当天监测记录以及最新浓度
                    if (StringUtils.isBlank(day)) {
                        day = DateUtil.getStringDateShort();
                    }
                    List<Map<String, Object>> listTmp = gasConcentration(patient, day, deviceSn);
                    devInfoObj.put("monitorInfo", listTmp);
                    devInfoObj.put("day", day);
                    securityMonitoringOrderService.preventGasLeakage(devInfoObj, patient, false);
                    break;
                case "15"://烟感报警器 获取最新浓度
                    securityMonitoringOrderService.preventFire(devInfoObj, patient, deviceSn, false);
                    devInfoObj.put("day", DateUtil.getStringDateShort());
                    break;
                case "16":
                    // 电子围栏
                    devInfoObj.put("safeAreaGz", securityMonitoringOrderService.getElectronicFence(deviceSn));
                    // 行动轨迹
                    devInfoObj.put("actionTrack", securityMonitoringOrderService.getActionTrack(deviceSn));
                    break;
            }
//        }
                result.put(ResponseContant.resultFlag,ResponseContant.success);
                result.put(ResponseContant.resultMsg,JSON.toJSONString(devInfoObj,SerializerFeature.WriteMapNullValue));
            }
        }
        return result;
    }

+ 49 - 16
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -21,6 +21,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientMedicardCardService;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.sms.dao.HospitalSysDictDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
@ -73,6 +74,8 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
    private String wxId;
    @Autowired
    private DeviceService deviceService;
    @Autowired
    private HospitalSysDictDao hospitalSysDictDao;
    /**
     * 签约记录
@ -441,21 +444,48 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        String online= imUtil.getOnlineListByType(null);
        JSONObject json = JSON.parseObject(online).getJSONObject("data");
        String limit = " limit "+(page-1)*size+","+size;
        String filter ="";
        if("1".equals(type)||StringUtil.isBlank(type)){
            List<Map<String,Object>> list = findChild(name,residentialArea,limit,json.getJSONObject("child"));
            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' ";
            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
            if(listtmp.size()>0){
                String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and id not in ('"+orgCodes+"')";
            }
            List<Map<String,Object>> list = findChild(name,residentialArea,limit,filter);
            re.put("child",list);
            re.put("childTotal",findChildTotal(name,residentialArea));
            re.put("childTotal",findChildTotal(name,residentialArea,filter));
        }
        if("2".equals(type)||StringUtil.isBlank(type)){
            List<Map<String,Object>> list = findOld(name,residentialArea,limit,json);
            filter = "";
            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_older' ";
            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
            if(listtmp.size()>0){
                String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and a.id not in ('"+orgCodes+"')";
            }
            List<Map<String,Object>> list = findOld(name,residentialArea,limit,json,filter);
            re.put("old",list);
            re.put("oldTotal",findOldTotal(name,residentialArea));
            re.put("oldTotal",findOldTotal(name,residentialArea,filter));
        }
        if("3".equals(type)||StringUtil.isBlank(type)){
            List<Map<String,Object>> list = findHelper(name,limit,json.getJSONObject("helper"));
            filter = "";
            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_helper' ";
            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
            if(listtmp.size()>0){
                String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and id not in ('"+orgCodes+"')";
            }
            List<Map<String,Object>> list = findHelper(name,limit,filter);
            re.put("helper",list);
            re.put("helperTotal",findHelperTotal(name));
            re.put("helperTotal",findHelperTotal(name,filter));
        }
        return re;
    }
@ -465,10 +495,9 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
     * @param name
     * @param residentialArea
     * @param limit
     * @param json
     * @return
     */
    public List<Map<String,Object>> findChild(String name,String residentialArea,String limit,JSONObject json){
    public List<Map<String,Object>> findChild(String name,String residentialArea,String limit,String filter1){
        String sql = "SELECT id,name,photo,idcard,CAST(IFNULL(birthday,'') AS char ) birthday,residential_area residentialArea" +
                ",sex,IFNULL(on_line,0) online  from base_patient WHERE archive_type = 2 and del = '1' ";
        if(!StringUtil.isBlank(name)){
@ -477,6 +506,8 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        if(!StringUtil.isBlank(residentialArea)){
            sql+= " and residential_area = '"+residentialArea+"' ";
        }
        sql += filter1;
        sql += " order by online desc";
        sql+=limit;
        List<Map<String,Object>>  list = jdbcTemplate.queryForList(sql);
@ -485,7 +516,6 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
            String paientId = map.get("id").toString();
            String filter = " and patient = '"+paientId+"'";
            Integer count = jdbcTemplate.queryForObject(sqlCount+filter,Integer.class);
//            map.put("online",json.containsKey(paientId));
            map.put("doorCoach",count);
            String idcardNo = map.get("idcard") + "";
            Date birthday = DateUtil.strToDate(map.get("birthday").toString());
@ -495,7 +525,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return list;
    }
    public Integer findChildTotal(String name,String residentialArea){
    public Integer findChildTotal(String name,String residentialArea,String filter){
        String sql = "SELECT count(id) from base_patient WHERE archive_type = 2 and del = '1' ";
        if(!StringUtil.isBlank(name)){
            sql+= " and name like '%"+name+"%' ";
@ -503,6 +533,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        if(!StringUtil.isBlank(residentialArea)){
            sql+= " and residential_area = '"+residentialArea+"' ";
        }
        sql += filter;
        return jdbcTemplate.queryForObject(sql,Integer.class);
    }
@ -514,7 +545,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
     * @param json
     * @return
     */
    public List<Map<String,Object>> findOld(String name,String residentialArea,String limit,JSONObject json){
    public List<Map<String,Object>> findOld(String name,String residentialArea,String limit,JSONObject json,String filter1){
        String sql = "SELECT a.id,a.name,a.photo,a.idcard,CAST(IFNULL(a.birthday,'') AS char ) birthday,a.residential_area residentialArea,a.sex " +
                ", GROUP_CONCAT(DISTINCT d.category_code) deviceFlag,IFNULL(on_line,0) online,IFNULL(sign_status,0) signStatus from base_patient a " +
                " LEFT JOIN wlyy_patient_device d on d.`user`=a.id  WHERE a.archive_type = 1 and a.del = '1' ";
@ -524,6 +555,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        if(!StringUtil.isBlank(residentialArea)){
            sql+= " and residential_area = '"+residentialArea+"' ";
        }
        sql += filter1;
        sql += " GROUP BY a.id,a.name,a.photo,a.idcard,a.birthday,a.residential_area,a.sex,online,signStatus ";
        sql += " ORDER BY online,signStatus desc";
        sql += limit;
@ -550,7 +582,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return list;
    }
    public Integer findOldTotal(String name,String residentialArea){
    public Integer findOldTotal(String name,String residentialArea,String filter){
        String sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' ";
        if(!StringUtil.isBlank(name)){
            sql+= " and name like '%"+name+"%' ";
@ -558,6 +590,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        if(!StringUtil.isBlank(residentialArea)){
            sql+= " and residential_area = '"+residentialArea+"' ";
        }
        sql += filter;
        return jdbcTemplate.queryForObject(sql,Integer.class);
    }
@ -565,14 +598,14 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
     * 查找助老员
     * @param name
     * @param limit
     * @param json
     * @return
     */
    public List<Map<String,Object>> findHelper(String name,String limit,JSONObject json){
    public List<Map<String,Object>> findHelper(String name,String limit,String fileter){
        String sql = "SELECT id,name,photo,sex,IFNULL(on_line,0) online from base_doctor WHERE doctor_level = 2 and del = '1' ";
        if(!StringUtil.isBlank(name)){
            sql+= " and name like '%"+name+"%' ";
        }
        sql += fileter;
        sql += " ORDER BY online desc";
        sql+=limit;
        List<Map<String,Object>>  list = jdbcTemplate.queryForList(sql);
@ -594,7 +627,6 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
            Integer lifeCare = jdbcTemplate.queryForObject(sqlLife+filter,Integer.class);
            Integer emergency = jdbcTemplate.queryForObject(sqlEmergency+filter,Integer.class);
            Integer security = jdbcTemplate.queryForObject(sqlSecurity+filter,Integer.class);
//            map.put("online",json.containsKey(doctorId));
            map.put("lifeCare",lifeCare);
            map.put("emergency",emergency);
            map.put("security",security);
@ -602,11 +634,12 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return list;
    }
    public Integer findHelperTotal(String name){
    public Integer findHelperTotal(String name,String filter){
        String sql = "SELECT count(id) from base_doctor WHERE doctor_level = 2 and del = '1' ";
        if(!StringUtil.isBlank(name)){
            sql+= " and name like '%"+name+"%' ";
        }
        sql += filter;
        return jdbcTemplate.queryForObject(sql,Integer.class);
    }

+ 10 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -250,6 +250,16 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        return result;
    }
    public List<Map<String , Object>> getElectronicFence(String deviceSn){
        String sql = " select safe_area_gz safeAreaGz from wlyy_patient_device where device_sn = '"+deviceSn+"' and del = 0 order by id desc limit 1";
        return jdbcTemplate.queryForList(sql);
    }
    public List<Map<String , Object>> getActionTrack(String deviceSn){
        String sql = "SELECT * FROM base_yxdevice_index WHERE sn = '"+deviceSn+"' AND lon != 0 AND lat != 0 ORDER BY create_time DESC LIMIT 0,20";
        return jdbcTemplate.queryForList(sql);
    }
    public JSONObject getSecurityOrderDetail(String orderID,String doctor){
        JSONObject result = new JSONObject();
        EmergencyOrderVO emergencyOrderVO = new EmergencyOrderVO();