whyclxw
2025-05-08 4c0f551e508bce3e853737a57a7cb09c0fbbb56f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.whyc.service;
 
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.PwrdevAlarmParamMapper;
import com.whyc.mapper.PwrdevTimeAdjAlarmMapper;
import com.whyc.pojo.PwrdevTimeAdjAlarm;
import com.whyc.pojo.PwrdevTimeOutAlarm;
import com.whyc.pojo.UserInf;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
@Service
public class PwrdevTimeAdjAlarmService {
 
    @Resource
    private PwrdevTimeAdjAlarmMapper mapper;
 
    @Resource
    private PwrdevAlarmParamMapper paramMapper;
 
    @Autowired
    private SubTablePageInfoService subService;
 
 
    //监控主站告警--查询
    public Response getList() {
        List<String> tablelist=paramMapper.getParamList();
        //取第一条记录,即param表
        String alarmParamTableName = tablelist.get(0);
        UserInf uinf= ActionUtil.getUser();
        //List<PwrdevTimeAdjAlarm> list=mapper.getList(uinf.getUId().intValue(),alarmParamTableName);
        List<PwrdevTimeAdjAlarm> list=subService.getList_adj(uinf.getUId().intValue(),alarmParamTableName);
        PageInfo pageInfo=new PageInfo(list);
        return  new Response().set(1,pageInfo);
    }
    //webSocket监控主站告警--查询
    public Response getListOfWebSocket(int uId) {
        List<String> tablelist=paramMapper.getParamList();
        //取第一条记录,即param表
        String alarmParamTableName = tablelist.get(0);
        //List<PwrdevTimeAdjAlarm> list=mapper.getList(uId,alarmParamTableName);
        List<PwrdevTimeAdjAlarm> list=subService.getList_adj(uId,alarmParamTableName);
        PageInfo pageInfo=new PageInfo(list);
        return  new Response().set(1,pageInfo);
    }
 
    //监控主站告警--删除
    public Response delete(int num) {
        int flag=mapper.deleteById(num);
        return new Response().set(flag);
    }
}