import cn.hutool.core.date.DateUtil
import cn.hutool.json.JSONUtil
import org.dromara.domain.bo.TblSensorRecordBo
def runjs(){
    TblSensorRecordBo bo = new TblSensorRecordBo();
    bo.setSensorId(JSONUtil.parse(exchange.in.body)["sensorId"]);
    bo.getParams().put("startTime", (int)(DateUtil.current()/1000 - 60*60*24*2))
    bo.getParams().put("endTime",(int)(DateUtil.current()/1000))
    def records =  sensorRecordService.queryList(bo);
    //过去两天没数据就报断网故障
    System.out.println(records.size())
}
runjs()

