增加设备接口
This commit is contained in:
parent
8d36fc433e
commit
eb0e151648
|
|
@ -363,14 +363,22 @@ public class WxAppletController {
|
||||||
@ApiOperation("获取预警数据")
|
@ApiOperation("获取预警数据")
|
||||||
public R getAlertRecord(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
public R getAlertRecord(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
@RequestParam(value = "stationCode",required = false)String stationCode, @RequestParam(value = "yearStr",required = false)String yearStr){
|
@RequestParam(value = "stationCode",required = false)String stationCode,
|
||||||
|
@RequestParam(value = "deployId",required = false)String deployId,
|
||||||
|
@RequestParam(value = "yearStr",required = false)String yearStr){
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
//效果评价
|
//效果评价
|
||||||
Page<SurvAlertRecord> page = new Page<SurvAlertRecord>(pageNo, pageSize);
|
Page<SurvAlertRecord> page = new Page<SurvAlertRecord>(pageNo, pageSize);
|
||||||
//查询站点里的所有设备
|
//查询站点里的所有设备
|
||||||
List<SurvDeviceDeploy> dList = deviceDeployService.getDeviceByStation(stationCode,"");
|
|
||||||
List<String> allList =new ArrayList<>();
|
List<String> allList =new ArrayList<>();
|
||||||
dList.forEach(item->allList.add(item.getDeployCode()));
|
if(StringUtils.isNotBlank(stationCode)){
|
||||||
|
List<SurvDeviceDeploy> dList = deviceDeployService.getDeviceByStation(stationCode,"");
|
||||||
|
dList.forEach(item->allList.add(item.getId()));
|
||||||
|
} else if (StringUtils.isNotBlank(deployId)) {
|
||||||
|
allList.add(deployId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
IPage<SurvAlertRecord> pageList = alertRecordService.pages(page, allList,yearStr);
|
IPage<SurvAlertRecord> pageList = alertRecordService.pages(page, allList,yearStr);
|
||||||
return R.ok(pageList);
|
return R.ok(pageList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@
|
||||||
<select id="pages" resultMap="baseResultMap">
|
<select id="pages" resultMap="baseResultMap">
|
||||||
select <include refid="baseSql"/>
|
select <include refid="baseSql"/>
|
||||||
from surv_alert_record where 1=1
|
from surv_alert_record where 1=1
|
||||||
<if test="deviceList!=null">
|
<if test="deviceList!=null and deviceList.size()>0">
|
||||||
and DEPLOY_CODE IN
|
and DEPLOY_ID IN
|
||||||
<foreach collection="deviceList" index="index" item="id" open="(" separator="," close=")">
|
<foreach collection="deviceList" index="index" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue