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