Kaynağa Gözat

Merge branch 'dev' of shikejing/wlyy2.0 into dev

shikejing 3 yıl önce
ebeveyn
işleme
7b2339e845

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

@ -99,5 +99,14 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "nightRecordList")
    @ApiOperation(value = "根据设备sn码查询起夜记录")
    public ListEnvelop nightRecordList(            @ApiParam(name="deviceSn",value = "deviceSn") @RequestParam(required = true) String deviceSn){
        try {
            return success("查询成功",200, platformService.nightRecordList(deviceSn));
        }catch (Exception e){
            return failedListEnvelopException(e);
        }
    }
}

+ 6 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/DetectionPlatformService.java

@ -317,4 +317,10 @@ public class DetectionPlatformService  {
        return object;
    }
    public List<Map<String , Object>> nightRecordList(String deviceSn){
        String nightRecordSql = "SELECT * FROM base_sleep_night_record WHERE device_sn = '"+deviceSn+"' ORDER BY create_time DESC LIMIT 0,20";
        List<Map<String , Object>> nightRecordList = jdbcTemplate.queryForList(nightRecordSql);
        return nightRecordList;  //起夜记录
    }
}