liubing 4 年 前
コミット
c83b01349f

+ 4 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/copdDevice/WlyyCopdXeekLungDO.java

@ -17,10 +17,13 @@ public class WlyyCopdXeekLungDO extends UuidIdentityEntity {
    private String deviceSN;// String Y 设备 SN 号 设备唯一
    /**
     *  String Y 报告类型:
     * 1=吸气测试;
     *  1=吸气测试;
     * 2=呼气测试;
     * * 3=吸气训练
     *  4=呼气训练
     * 6=MVV 测试;
     * 7=慢通气测试;
     *
     类型不同时,details
     的参数也不同,参
     考 details 参数备注

+ 6 - 9
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/CopdXeekDeviceService.java

@ -54,14 +54,13 @@ public class CopdXeekDeviceService  {
        }
        sql.append(" GROUP BY inspect_time,de.id order by de.parameter, lu.inspect_time asc ");
        detailList = jdbcTemplate.queryForList(sql.toString());
        StringBuilder sqlIn= new StringBuilder("select count(de.id) test1_value ,LEFT(inspect_time,10) dayTime,'次' unit,'吸气训练数据' name,'inCount' parameter from xmiot.wlyy_copd_xeek_lung_detail de,xmiot.wlyy_copd_xeek_lung lu," +
                  " xmiot.wlyy_iot_tz_dict dict  where  de.code = lu.id and dict.del=1 \n" +
                  "and  dict.code='COPD_PARAMETER' and dict.value = de.parameter and  de.parameter='MIP' GROUP BY LEFT(inspect_time,10) ");
        //lu.report_type1=吸气测试;2=呼气测试; 3=吸气训练4=呼气训练6=MVV 测试;7=慢通气测试;
        StringBuilder sqlIn= new StringBuilder("select de.times test1_value ,inspect_time dayTime,'次' unit,'吸气训练数据' name,'inCount' parameter " +
                "from xmiot.wlyy_copd_xeek_lung_training de,xmiot.wlyy_copd_xeek_lung lu  where  de.code = lu.id and lu.report_type=3 ");
        StringBuilder sqlOut= new StringBuilder("select count(de.id) test1_value ,LEFT(inspect_time,10) dayTime,'次' unit,'呼气训练数据' name,'outCount' parameter from xmiot.wlyy_copd_xeek_lung_detail de,xmiot.wlyy_copd_xeek_lung lu," +
                  " xmiot.wlyy_iot_tz_dict dict  where  de.code = lu.id and dict.del=1 \n" +
                  "and  dict.code='COPD_PARAMETER' and dict.value = de.parameter and  de.parameter='FVC'  GROUP BY LEFT(inspect_time,10)");
        StringBuilder sqlOut= new StringBuilder("select de.times test1_value ,inspect_time dayTime,'次' unit,'呼气训练数据' name,'outCount' parameter " +
                "from xmiot.wlyy_copd_xeek_lung_training de,xmiot.wlyy_copd_xeek_lung lu  where  de.code = lu.id and lu.report_type=4 ");
        sql = new StringBuilder("");
        if (StringUtils.isNotBlank(patient)){
            sql.append(" and lu.patient='"+patient+"' ");
@ -69,15 +68,13 @@ public class CopdXeekDeviceService  {
        if (StringUtils.isNotBlank(deviceSN)){
            sql.append(" and lu.device_sn='"+deviceSN+"' ");
        }
        if (StringUtils.isNotBlank(reportType)){
            sql.append(" and lu.report_type='"+reportType+"' ");
        }
        if (StringUtils.isNotBlank(begin)){
            sql.append(" and lu.inspect_time>='"+begin+"' ");
        }
        if (StringUtils.isNotBlank(end)){
            sql.append(" and lu.inspect_time<='"+end+"' ");
        }
        sql.append(" order by  lu.inspect_time asc ");
        if ((StringUtils.isNotBlank(parameter)&&parameter.equals("inCount"))||StringUtils.isBlank(parameter)){//吸气训练次数 MIP
            List<Map<String,Object>> tmp = jdbcTemplate.queryForList(sqlIn.append(sql).toString());