#2894 修改

Zlúčené
liubing mergnuté 3 commitov z xiaoyunquan/dev do Amoy2/dev 2 rokov pred

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -3881,7 +3881,7 @@ public class StatisticsService {
        //离线设备数量
        //离线设备数量
        String offLineDeviceSql="select count(distinct pd.device_sn) total from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
        String offLineDeviceSql="select count(distinct pd.device_sn) total from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
                "                 INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " + teamCodeSql +
                "                 INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " + teamCodeSql +
                "                where dev.contact_status=0  and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
                "                where ( dev.contact_status=0 or dev.contact_status IS NULL )  and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
        //设备总数
        //设备总数
        String deviceTotalSql = "SELECT count(DISTINCT device_code) FROM wlyy_devices WHERE (device_code IS NOT NULL OR device_code <> '') AND device_type = "+type+"";
        String deviceTotalSql = "SELECT count(DISTINCT device_code) FROM wlyy_devices WHERE (device_code IS NOT NULL OR device_code <> '') AND device_type = "+type+"";

+ 15 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -1013,7 +1013,11 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                    detailInfo.put("warnStatus",false);
                }
                }
                //获取最新一次燃气浓度
                //获取最新一次燃气浓度
                sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                if(bl){
                    sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' and record_time >= '"+beforeTime+"' and record_time <= '"+afterTime+"' ORDER BY record_time desc limit 1 ";
                }else {
                    sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                }
                sqlResult = jdbcTemplate.queryForList(sql);
                sqlResult = jdbcTemplate.queryForList(sql);
                if (sqlResult.size()>0){
                if (sqlResult.size()>0){
                    detailInfo.putAll(sqlResult.get(0));
                    detailInfo.putAll(sqlResult.get(0));
@ -1035,7 +1039,11 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                    detailInfo.put("warnStatus",false);
                }
                }
                //获取最新一次烟雾浓度
                //获取最新一次烟雾浓度
                sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                if(bl){
                    sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' and record_time >='"+beforeTime+"' and record_time <= '"+afterTime+"'  ORDER BY record_time desc limit 1 ";
                }else {
                    sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                }
                sqlResult = jdbcTemplate.queryForList(sql);
                sqlResult = jdbcTemplate.queryForList(sql);
                if (sqlResult.size()>0){
                if (sqlResult.size()>0){
                    detailInfo.putAll(sqlResult.get(0));
                    detailInfo.putAll(sqlResult.get(0));
@ -1044,7 +1052,11 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("value",null);
                    detailInfo.put("value",null);
                    detailInfo.put("record_time",null);
                    detailInfo.put("record_time",null);
                }
                }
                sql = " select temperature_value ,record_time as temperature_value_record_time  from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null  ORDER BY record_time desc limit 1 ";
                if(bl){
                    sql = " select temperature_value ,record_time as temperature_value_record_time  from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null and record_time >= '"+beforeTime+"' and record_time<= '"+afterTime+"'  ORDER BY record_time desc limit 1 ";
                }else {
                    sql = " select temperature_value ,record_time as temperature_value_record_time  from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null  ORDER BY record_time desc limit 1 ";
                }
                sqlResult = jdbcTemplate.queryForList(sql);
                sqlResult = jdbcTemplate.queryForList(sql);
                if (sqlResult.size()>0){
                if (sqlResult.size()>0){
                    detailInfo.putAll(sqlResult.get(0));
                    detailInfo.putAll(sqlResult.get(0));