LAPTOP-KB9HII50\70708 2 years ago
parent
commit
6abf752a4a

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

@ -3909,22 +3909,37 @@ public class StatisticsService {
                    "                where pd.user NOT IN ("+testUsqlSql+") "+categoryCodeTotalSql;
        }
        //long start=System.currentTimeMillis();
        Integer typeTotal = 0;
        Integer offLineDevice = 0;
        Integer deviceTotal = 0;
        Integer lineDevice = 0;
        List<Integer> total = jdbcTemplate.queryForList(typeTotalSql, Integer.class);
        //long end=System.currentTimeMillis();
        //System.out.println("类型数量运行多少毫秒:" + "=" + (end-start));
        jsonObject.put("typeTotal",total.get(0));
        if(total.size()>0){
            typeTotal = total.get(0);
        }
        jsonObject.put("typeTotal",typeTotal);
        total = jdbcTemplate.queryForList(offLineDeviceSql,Integer.class);
        jsonObject.put("offLineDevice",total.get(0));
        if(total.size()>0){
            offLineDevice = total.get(0);
        }
        jsonObject.put("offLineDevice",offLineDevice);
        total = jdbcTemplate.queryForList(deviceTotalSql,Integer.class);
        jsonObject.put("deviceTotal",total.get(0));
        if(total.size()>0){
            deviceTotal = total.get(0);
        }
        jsonObject.put("deviceTotal",deviceTotal);
        total = jdbcTemplate.queryForList(lineDeviceSql,Integer.class);
        jsonObject.put("lineDevice",total.get(0));
        if(total.size()>0){
            lineDevice = total.get(0);
        }
        jsonObject.put("lineDevice",lineDevice);
        total = jdbcTemplate.queryForList(sevenDayUseSql,Integer.class);
        Float num = 0F;
        if (total.size()>0) {
            Integer deviceCodeTotal = jdbcTemplate.queryForObject(deviceCodeTotalSql,Integer.class);
            num= (float)total.get(0)/(float)deviceCodeTotal;
            if(deviceCodeTotal>0){
                num= (float)total.get(0)/(float)deviceCodeTotal;
            }
        }
        jsonObject.put("sevenDayUse",num*100);
        return jsonObject;

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/platform/WlyyXeekPatientDeviceDao.java

@ -15,6 +15,6 @@ public interface WlyyXeekPatientDeviceDao extends PagingAndSortingRepository<Wly
    WlyyXeekPatientDeviceDO findByDeviceSnAndNameAndSexAndBirthday(String deviceSn,String name,Integer sex,String birthday);
    @Query("from WlyyXeekPatientDeviceDO c where c.patient is null)")
    @Query("from WlyyXeekPatientDeviceDO c where c.patient is null")
    List<WlyyXeekPatientDeviceDO> findNoPatient();
}