Kaynağa Gözat

代码修改

LAPTOP-KB9HII50\70708 9 ay önce
ebeveyn
işleme
5c45039136

+ 102 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/team/DoctorTeamEndpoint.java

@ -1,14 +1,29 @@
package com.yihu.jw.hospital.endpoint.team;
package com.yihu.jw.hospital.endpoint.team;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
/**
 * Created by yeshijie on 2023/4/24.
 * Created by yeshijie on 2023/4/24.
@ -20,8 +35,91 @@ public class DoctorTeamEndpoint extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    private WlyyBusinessService wlyyBusinessService;
    @Autowired
    private WlyyHttpService wlyyHttpService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    private static final String TONGAN_TOWN = "350212";
    private static final String TONGAN_TOWN = "350212";
    @GetMapping(value = "signTeamPage")
    @ApiOperation(value = "三师共管患者")
    public ListEnvelop signTeamPage(@RequestParam(required = true) String doctor,
                                    @RequestParam(required = false) String name) {
        try {
            String sql = "SELECT DISTINCT p.id,p.`name`,p.idcard,p.mobile,p.photo,m.team_code teamCode,t.name teamName " +
                    "from base_team_member m,base_team_relation r,wlyy_sign s,base_patient p,base_team t " +
                    "WHERE m.doctor_code='"+doctor+"' and m.del='1' and m.team_code=r.team_id and r.admin_team_id=s.admin_team_id " +
                    "and p.idcard = s.idcard and m.team_code=t.id and t.del='1'" ;
            if(StringUtils.isNotBlank(name)){
                sql += " and p.name like '"+name+"' ";
            }
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
            for (Map<String, Object> map : list) {
                if (map.get("idcard") != null) {
                    String idcard = map.get("idcard").toString();
                    Integer age = IdCardUtil.getAgeForIdcard(idcard);
                    String sex = IdCardUtil.getSexForIdcard(idcard);
                    map.put("patientAge", age);
                    map.put("patientSex", sex);
                }
            }
            Map<String, List<Map<String, Object>>> map1 = list.stream().collect(Collectors.groupingBy(e -> e.get("teamCode").toString()));
            Map<String, String> map2 = list.stream().collect(Collectors.toMap(e -> e.get("teamCode").toString(), e -> e.get("teamName").toString(),(p1, p2) -> p1));
            List<Map<String,Object>> result = new ArrayList<>();
            for (Map.Entry<String, String> entry : map2.entrySet()) {
                String key = entry.getKey();
                String value = entry.getValue();
                Map<String,Object> map = new HashMap<>();
                map.put("teamCode",key);
                map.put("teamName",value);
                List<Map<String,Object>> tmp = map1.get(key);
                map.put("size",tmp.size());
                map.put("list",tmp);
                result.add(map);
            }
            return ListEnvelop.getSuccess("查询成功",result);
        } catch (Exception e) {
            e.printStackTrace();
            return ListEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "commonGet")
    @ApiOperation(value = "通用请求接口")
    public String commonGet(HttpServletRequest request,String api) {
        try {
            JSONObject jsonObject = wlyyBusinessService.commonGet(request,api);
            if(jsonObject==null){
                return error(-1,"查询失败");
            }
            return jsonObject.toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @PostMapping(value = "uploadImg")
    @ApiOperation(value = "文件流上传图片", notes = "文件流上传图片")
    public ObjEnvelop<UploadVO> uploadImg(@ApiParam(value = "文件", required = true)
                                          @RequestParam(value = "file", required = true) MultipartFile file) throws Exception{
        try {
            UploadVO uploadVO = new UploadVO();
            String originalFilename = file.getOriginalFilename();
            String[] fs = originalFilename.split("\\.");
            String type = fs[1];
            //内网上传
            String rs = wlyyHttpService.request(file,type,"uploadImg");
            System.out.println("rs="+rs);
            JSONObject json = JSON.parseObject(rs);
            uploadVO = objectMapper.readValue(json.getJSONObject("result").toJSONString(),UploadVO.class);
            return success("上传成功", uploadVO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("上传失败");
        }
    }
    @GetMapping(value = "doctorInfo")
    @GetMapping(value = "doctorInfo")
    @ApiOperation(value = "获取社区医生信息")
    @ApiOperation(value = "获取社区医生信息")
    public String doctorInfo(@RequestParam(required = true) String code) {
    public String doctorInfo(@RequestParam(required = true) String code) {

+ 15 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/LabelController.java

@ -105,4 +105,19 @@ public class LabelController extends EnvelopRestEndpoint {
            return failedObjEnvelopException(e);
            return failedObjEnvelopException(e);
        }
        }
    }
    }
    @PostMapping(value = "delLableDict")
    @ApiOperation(value = "删除自定义标签字典", notes = "删除自定义标签字典")
    public Envelop delLableDict(@ApiParam(name = "labelName", value = "标签名称")
                                @RequestParam(value = "labelName", required = true) String labelName) {
        try {
            labelService.delLableDict(labelName);
            return success("删除成功");
        }catch (ServiceException se){
            return Envelop.getError(se.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("删除失败");
        }
    }
}
}

+ 12 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/service/LabelService.java

@ -142,4 +142,16 @@ public class LabelService {
        dictDO = wlyyHospitalSysDictDao.save(dictDO);
        dictDO = wlyyHospitalSysDictDao.save(dictDO);
        return dictDO;
        return dictDO;
    }
    }
    //删除
    public void delLableDict(String labelName) throws Exception{
        List<WlyyHospitalSysDictDO> dictDOList = wlyyHospitalSysDictDao.findByDictNameAndDictCode("patient_lable_custom",labelName);
        if(dictDOList.size()>0){
            List<WlyyPatientLabelDO> list = patientLabelDao.findByPatientLablelName(labelName);
            if(list.size()>0){
                throw new ServiceException("该标签还存在已标记的患者,请先取消标记后删除");
            }
            wlyyHospitalSysDictDao.deleteAll(dictDOList);
        }
    }
}
}

+ 8 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/controller/ChronicDiseaseController.java

@ -274,6 +274,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
            }
            }
            return write(200, "查询成功", "data", doctorSchemeService.getTrackPatientServerCount(null, doctorId, startDate, endDate));
            return write(200, "查询成功", "data", doctorSchemeService.getTrackPatientServerCount(null, doctorId, startDate, endDate));
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
@ -291,6 +292,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
            }
            }
            return write(200, "查询成功", "data", doctorSchemeService.getPatientHealthIndexNew(startDate, endDate, type, doctorId));
            return write(200, "查询成功", "data", doctorSchemeService.getPatientHealthIndexNew(startDate, endDate, type, doctorId));
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
@ -308,6 +310,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
            }
            }
            return write(200, "查询成功", "data", doctorSchemeService.getTrackPatientAimByteam(doctorId,startDate, endDate));
            return write(200, "查询成功", "data", doctorSchemeService.getTrackPatientAimByteam(doctorId,startDate, endDate));
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
@ -322,6 +325,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
            }
            }
            return write(200, "查询成功", "data", doctorSchemeService.getDeviceStateByTeam(doctorId));
            return write(200, "查询成功", "data", doctorSchemeService.getDeviceStateByTeam(doctorId));
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
@ -335,6 +339,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
        try {
        try {
            return write(200, "操作成功", "data", doctorSchemeService.setPatientAim(patient, suggerJson, pressureJson, sportJson));
            return write(200, "操作成功", "data", doctorSchemeService.setPatientAim(patient, suggerJson, pressureJson, sportJson));
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
@ -348,6 +353,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
        try {
        try {
            return write(200, "操作成功", "data", doctorSchemeService.setSinglePatientAim(patient, suggerJson, pressureJson, sportJson));
            return write(200, "操作成功", "data", doctorSchemeService.setSinglePatientAim(patient, suggerJson, pressureJson, sportJson));
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
@ -364,6 +370,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
        try {
        try {
            return write(200, "查询成功", "data", doctorSchemeService.getTrackPatientIndexCountList(getUID(), teamCode, type, startDate, endDate, keyword, page, size));
            return write(200, "查询成功", "data", doctorSchemeService.getTrackPatientIndexCountList(getUID(), teamCode, type, startDate, endDate, keyword, page, size));
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
@ -406,6 +413,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
            List<Map<String, Object>> result = doctorSchemeService.getLabelDetail(doctorId, labelType, searchContent, page, pageSize);
            List<Map<String, Object>> result = doctorSchemeService.getLabelDetail(doctorId, labelType, searchContent, page, pageSize);
            return write(200, "查询成功", "data", result);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }

+ 49 - 49
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/scheme/DoctorSchemeService.java

@ -565,7 +565,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS befHighCount " +
                " COUNT(1) AS befHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -579,7 +579,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS aftHighCount " +
                " COUNT(1) AS aftHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -596,7 +596,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS befHighCount " +
                " COUNT(1) AS befHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -611,7 +611,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS aftHighCount " +
                " COUNT(1) AS aftHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -629,7 +629,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS befHighCount " +
                " COUNT(1) AS befHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -643,7 +643,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS aftHighCount " +
                " COUNT(1) AS aftHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -657,7 +657,7 @@ public class DoctorSchemeService {
        String pHighSql = "SELECT " +
        String pHighSql = "SELECT " +
                " count(1) AS highCount " +
                " count(1) AS highCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.type = '2' " +
@ -668,7 +668,7 @@ public class DoctorSchemeService {
        String pStdSql = "SELECT " +
        String pStdSql = "SELECT " +
                " count(1) AS stdCount " +
                " count(1) AS stdCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.type = '2' " +
@ -680,7 +680,7 @@ public class DoctorSchemeService {
        String pLowSql = "SELECT " +
        String pLowSql = "SELECT " +
                " count(1) AS lowCount " +
                " count(1) AS lowCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.type = '2' " +
@ -746,7 +746,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS befHighCount " +
                " COUNT(1) AS befHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -755,13 +755,13 @@ public class DoctorSchemeService {
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (" +
                " AND i.user IN (" +
                "SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                "SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " ) bf, " +
                " ) bf, " +
                " (  " +
                " (  " +
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS aftHighCount " +
                " COUNT(1) AS aftHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -769,7 +769,7 @@ public class DoctorSchemeService {
                " AND i.value1 > 11.1 " +
                " AND i.value1 > 11.1 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " ) aft";
                " ) aft";
        String stdSql = "SELECT  " +
        String stdSql = "SELECT  " +
                " (bf.befHighCount + aft.aftHighCount) AS stdCount " +
                " (bf.befHighCount + aft.aftHighCount) AS stdCount " +
@ -778,7 +778,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS befHighCount " +
                " COUNT(1) AS befHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -787,13 +787,13 @@ public class DoctorSchemeService {
                " AND i.value1 >= 4 " +
                " AND i.value1 >= 4 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " ) bf, " +
                " ) bf, " +
                " (  " +
                " (  " +
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS aftHighCount " +
                " COUNT(1) AS aftHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -802,7 +802,7 @@ public class DoctorSchemeService {
                " AND i.value1 >= 4 " +
                " AND i.value1 >= 4 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " ) aft";
                " ) aft";
        String lowSql = "SELECT  " +
        String lowSql = "SELECT  " +
                " (bf.befHighCount + aft.aftHighCount) AS lowCount " +
                " (bf.befHighCount + aft.aftHighCount) AS lowCount " +
@ -811,7 +811,7 @@ public class DoctorSchemeService {
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS befHighCount " +
                " COUNT(1) AS befHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -819,13 +819,13 @@ public class DoctorSchemeService {
                " AND i.value1 < 4 " +
                " AND i.value1 < 4 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " ) bf, " +
                " ) bf, " +
                " (  " +
                " (  " +
                " SELECT " +
                " SELECT " +
                " COUNT(1) AS aftHighCount " +
                " COUNT(1) AS aftHighCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.type = '1' " +
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.del = '1' " +
@ -833,24 +833,24 @@ public class DoctorSchemeService {
                " AND i.value1 < 4 " +
                " AND i.value1 < 4 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )" +
                " ) aft";
                " ) aft";
        String pHighSql = "SELECT " +
        String pHighSql = "SELECT " +
                " count(1) AS highCount " +
                " count(1) AS highCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.type = '2' " +
                " AND i.value1 > 139 " +
                " AND i.value1 > 139 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )";
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )";
        String pStdSql = "SELECT " +
        String pStdSql = "SELECT " +
                " count(1) AS stdCount " +
                " count(1) AS stdCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.type = '2' " +
@ -858,18 +858,18 @@ public class DoctorSchemeService {
                " AND i.value1 >= 90 " +
                " AND i.value1 >= 90 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )";
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "' )";
        String pLowSql = "SELECT " +
        String pLowSql = "SELECT " +
                " count(1) AS lowCount " +
                " count(1) AS lowCount " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.type = '2' " +
                " AND i.value1 < 90 " +
                " AND i.value1 < 90 " +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date >='" + startDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.record_date <='" + endDate + "'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "')";
                " AND i.user IN (SELECT t.patient_code FROM wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='" + doctor + "')";
        Map<String, Object> rs = new HashedMap();
        Map<String, Object> rs = new HashedMap();
        //0血檀
        //0血檀
@ -927,7 +927,7 @@ public class DoctorSchemeService {
                " i.value2 AS height, " +
                " i.value2 AS height, " +
                " i.value3 AS BMI " +
                " i.value3 AS BMI " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = '3'  " +
                " AND i.type = '3'  " +
@ -997,7 +997,7 @@ public class DoctorSchemeService {
                " i.value2 AS height, " +
                " i.value2 AS height, " +
                " i.value3 AS BMI " +
                " i.value3 AS BMI " +
                " FROM " +
                " FROM " +
                " device.wlyy_patient_health_index i " +
                " wlyy_patient_health_index i " +
                " WHERE " +
                " WHERE " +
                " i.del = '1' " +
                " i.del = '1' " +
                " AND i.type = 3 " +
                " AND i.type = 3 " +
@ -1219,7 +1219,7 @@ public class DoctorSchemeService {
                "   i.`user`, " +
                "   i.`user`, " +
                "   COUNT(1) AS total " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "   wlyy_patient_health_index i " +
                "    WHERE  " +
                "    WHERE  " +
                "   i.`user` in  " +
                "   i.`user` in  " +
                "    ( " +
                "    ( " +
@ -1237,7 +1237,7 @@ public class DoctorSchemeService {
                "  i.`user`, " +
                "  i.`user`, " +
                "  COUNT(1) AS dbtotal " +
                "  COUNT(1) AS dbtotal " +
                " FROM " +
                " FROM " +
                "  device.wlyy_patient_health_index i " +
                "  wlyy_patient_health_index i " +
                " JOIN wlyy_patient_aim_blood_pressure p ON p.patientcode = i.`user` " +
                " JOIN wlyy_patient_aim_blood_pressure p ON p.patientcode = i.`user` " +
                " WHERE " +
                " WHERE " +
                "  i.`user` in  " +
                "  i.`user` in  " +
@ -1302,7 +1302,7 @@ public class DoctorSchemeService {
                "   i.`user`, " +
                "   i.`user`, " +
                "   COUNT(1) AS total " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "   wlyy_patient_health_index i " +
                "    WHERE  " +
                "    WHERE  " +
                "   i.`user` in  " +
                "   i.`user` in  " +
                "    ( " +
                "    ( " +
@ -1322,7 +1322,7 @@ public class DoctorSchemeService {
                "  i.`user`, " +
                "  i.`user`, " +
                "  COUNT(1) AS dbtotal " +
                "  COUNT(1) AS dbtotal " +
                " FROM " +
                " FROM " +
                "  device.wlyy_patient_health_index i " +
                "  wlyy_patient_health_index i " +
                " JOIN wlyy_patient_aim_blood_sugger p ON p.patientcode = i.`user` " +
                " JOIN wlyy_patient_aim_blood_sugger p ON p.patientcode = i.`user` " +
                " WHERE " +
                " WHERE " +
                "  i.`user` in  " +
                "  i.`user` in  " +
@ -1354,7 +1354,7 @@ public class DoctorSchemeService {
                "   i.`user`, " +
                "   i.`user`, " +
                "   COUNT(1) AS total " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "   wlyy_patient_health_index i " +
                "  WHERE " +
                "  WHERE " +
                "   i.`user` IN ( " +
                "   i.`user` IN ( " +
                "    SELECT " +
                "    SELECT " +
@ -1378,7 +1378,7 @@ public class DoctorSchemeService {
                "  i.`user`, " +
                "  i.`user`, " +
                "  COUNT(1) AS dbtotal " +
                "  COUNT(1) AS dbtotal " +
                " FROM " +
                " FROM " +
                "  device.wlyy_patient_health_index i " +
                "  wlyy_patient_health_index i " +
                " JOIN wlyy_patient_aim_blood_sugger p ON p.patientcode = i.`user` " +
                " JOIN wlyy_patient_aim_blood_sugger p ON p.patientcode = i.`user` " +
                " WHERE " +
                " WHERE " +
                "  i.`user` IN ( " +
                "  i.`user` IN ( " +
@ -1406,7 +1406,7 @@ public class DoctorSchemeService {
                "  i.`user`, " +
                "  i.`user`, " +
                "  COUNT(1) AS dbtotal " +
                "  COUNT(1) AS dbtotal " +
                " FROM " +
                " FROM " +
                "  device.wlyy_patient_health_index i " +
                "  wlyy_patient_health_index i " +
                " JOIN wlyy_patient_aim_blood_sugger p ON p.patientcode = i.`user` " +
                " JOIN wlyy_patient_aim_blood_sugger p ON p.patientcode = i.`user` " +
                " WHERE " +
                " WHERE " +
                "  i.`user` IN ( " +
                "  i.`user` IN ( " +
@ -1641,7 +1641,7 @@ public class DoctorSchemeService {
                "    i. USER, " +
                "    i. USER, " +
                "    COUNT(1) AS total " +
                "    COUNT(1) AS total " +
                "   FROM " +
                "   FROM " +
                "    device.wlyy_patient_health_index i " +
                "    wlyy_patient_health_index i " +
                "   WHERE " +
                "   WHERE " +
                "    i.del = '1' " +
                "    i.del = '1' " +
                "   AND i.type = 1 " +
                "   AND i.type = 1 " +
@ -1676,7 +1676,7 @@ public class DoctorSchemeService {
                "   i. USER, " +
                "   i. USER, " +
                "   COUNT(1) AS total " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "   wlyy_patient_health_index i " +
                "  WHERE " +
                "  WHERE " +
                "   i.del = '1' " +
                "   i.del = '1' " +
                "  AND i.type = 1 " +
                "  AND i.type = 1 " +
@ -1718,7 +1718,7 @@ public class DoctorSchemeService {
                "    i. USER, " +
                "    i. USER, " +
                "    COUNT(1) AS total " +
                "    COUNT(1) AS total " +
                "   FROM " +
                "   FROM " +
                "    device.wlyy_patient_health_index i " +
                "    wlyy_patient_health_index i " +
                "   WHERE " +
                "   WHERE " +
                "    i.del = '1' " +
                "    i.del = '1' " +
                "   AND i.type = 1 " +
                "   AND i.type = 1 " +
@ -1753,7 +1753,7 @@ public class DoctorSchemeService {
                "   i. USER, " +
                "   i. USER, " +
                "   COUNT(1) AS total " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "   wlyy_patient_health_index i " +
                "  WHERE " +
                "  WHERE " +
                "   i.del = '1' " +
                "   i.del = '1' " +
                "  AND i.type = 1 " +
                "  AND i.type = 1 " +
@ -1796,7 +1796,7 @@ public class DoctorSchemeService {
                "    i. USER, " +
                "    i. USER, " +
                "    COUNT(1) AS total " +
                "    COUNT(1) AS total " +
                "   FROM " +
                "   FROM " +
                "    device.wlyy_patient_health_index i " +
                "    wlyy_patient_health_index i " +
                "   WHERE " +
                "   WHERE " +
                "    i.del = '1' " +
                "    i.del = '1' " +
                "   AND i.type = 1 " +
                "   AND i.type = 1 " +
@ -1832,7 +1832,7 @@ public class DoctorSchemeService {
                "   i. USER, " +
                "   i. USER, " +
                "   COUNT(1) AS total " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "   wlyy_patient_health_index i " +
                "  WHERE " +
                "  WHERE " +
                "   i.del = '1' " +
                "   i.del = '1' " +
                "  AND i.type = 1 " +
                "  AND i.type = 1 " +
@ -1893,7 +1893,7 @@ public class DoctorSchemeService {
                "    i. USER, " +
                "    i. USER, " +
                "    COUNT(1) AS total " +
                "    COUNT(1) AS total " +
                "   FROM " +
                "   FROM " +
                "    device.wlyy_patient_health_index i " +
                "    wlyy_patient_health_index i " +
                "   WHERE " +
                "   WHERE " +
                "    i.del = '1' " +
                "    i.del = '1' " +
                "   AND i.type = 2 " +
                "   AND i.type = 2 " +
@ -1925,7 +1925,7 @@ public class DoctorSchemeService {
                "    i. USER, " +
                "    i. USER, " +
                "    COUNT(1) AS total " +
                "    COUNT(1) AS total " +
                "   FROM " +
                "   FROM " +
                "    device.wlyy_patient_health_index i " +
                "    wlyy_patient_health_index i " +
                "   WHERE " +
                "   WHERE " +
                "    i.del = '1' " +
                "    i.del = '1' " +
                "   AND i.type = 2 " +
                "   AND i.type = 2 " +
@ -1959,7 +1959,7 @@ public class DoctorSchemeService {
                "    i. USER, " +
                "    i. USER, " +
                "    COUNT(1) AS total " +
                "    COUNT(1) AS total " +
                "   FROM " +
                "   FROM " +
                "    device.wlyy_patient_health_index i " +
                "    wlyy_patient_health_index i " +
                "   WHERE " +
                "   WHERE " +
                "    i.del = '1' " +
                "    i.del = '1' " +
                "   AND i.type = 2 " +
                "   AND i.type = 2 " +
@ -2191,9 +2191,9 @@ public class DoctorSchemeService {
        HashMap<String, Object> map = new HashMap<>();
        HashMap<String, Object> map = new HashMap<>();
        map.put("gxy_yj", count1);// 高血压预警
        map.put("gxy_yj", count1);// 高血压预警
        map.put("gxy", count2);// 高血压预警
        map.put("tnb_yj", count3);// 高血压预警
        map.put("tnb", count4);// 高血压预警
        map.put("gxy", count2);// 高血压
        map.put("tnb_yj", count3);// 糖尿病预警
        map.put("tnb", count4);// 糖尿病
        return map;
        return map;
    }
    }
@ -2201,7 +2201,7 @@ public class DoctorSchemeService {
     * labelType 1高血压 2糖尿病
     * labelType 1高血压 2糖尿病
     */
     */
    public List<Map<String, Object>> getLabelDetail(String doctorId, String labelType, String searchContent, int page, int pageSize) {
    public List<Map<String, Object>> getLabelDetail(String doctorId, String labelType, String searchContent, int page, int pageSize) {
        String sql = "SELECTDISTINCT a.id,a.`name`,a.idcard,a.mobile,a.ssc, TIMESTAMPDIFF(YEAR, a.birthday, CURDATE()) AS age ,a.sex \n" +
        String sql = "SELECT DISTINCT a.id,a.`name`,a.idcard,a.mobile,a.ssc, TIMESTAMPDIFF(YEAR, a.birthday, CURDATE()) AS age ,a.sex \n" +
                "FROM base_patient a \n" +
                "FROM base_patient a \n" +
                "INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
                "INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
                "WHERE 1=1\n" +
                "WHERE 1=1\n" +