Browse Source

宁夏分公司代码修改,修改报警分析和报警查询与预警查询

shilin 2 weeks ago
parent
commit
cda9f9c0d6

+ 15 - 15
alarm-scanner/src/main/java/com/gyee/alarm/model/vo/AlarmTag.java

@@ -126,27 +126,27 @@ public class AlarmTag {
             return false;
         }
 
-        if (StringUtils.empty(pointData.getPointTime())) {
-            return false;
-        }
-
-        if (pointData.getPointTime().intValue()==0) {
-            return false;
-        }
-        if(StringUtils.notEmp(wpId) && wpId.contains("_SBS"))
-        {
-            log.info("判定相等报警tagId_"+tagId+"_wpId_"+wpId+"_ts_"+ts+"_val_"+oval.doubleValue());
-        }
+//        if (StringUtils.empty(pointData.getPointTime())) {
+//            return false;
+//        }
+//
+//        if (pointData.getPointTime().intValue()==0) {
+//            return false;
+//        }
+//        if(StringUtils.notEmp(wpId) && wpId.contains("_SBS"))
+//        {
+//            log.info("判定相等报警tagId_"+tagId+"_wpId_"+wpId+"_ts_"+ts+"_val_"+oval.doubleValue());
+//        }
         ts = pointData.getPointTime();
         oval = pointData.getPointValueInDouble();
         endts= pointData.getPointTime();
         val=0.0;
 
 
-        if(StringUtils.notEmp(wpId) && wpId.contains("_SBS"))
-        {
-            log.info("报警发生tagId_"+tagId+"_wpId_"+wpId+"_ts_"+ts+"_val_"+pointData.getPointValueInDouble());
-        }
+//        if(StringUtils.notEmp(wpId) && wpId.contains("_SBS"))
+//        {
+//            log.info("报警发生tagId_"+tagId+"_wpId_"+wpId+"_ts_"+ts+"_val_"+pointData.getPointValueInDouble());
+//        }
         if(StringUtils.notEmp(uniformCode) && uniformCode.startsWith("BI")){
 
             int decimal = oval.intValue(); // 十进制报警数

+ 38 - 4
alarm-scanner/src/main/java/com/gyee/alarm/service/AlarmScannerService.java

@@ -165,13 +165,47 @@ public class AlarmScannerService {
 
             if (alarmType.equals("bt_alarms")) {
 
-                CountDownLatch countDownLatch = new CountDownLatch(2);
+//                CountDownLatch countDownLatch = new CountDownLatch(2);
 
 //                new Thread(new AlarmThread(executor, edosUtil, alarmService, alarmTags, interval, String.valueOf(1), readRows, alarmType, countDownLatch, alarmTsService, historymap)).start();
 //                new Thread(new AlarmThread(executor, edosUtil, alarmService, alarmInTags, interval, String.valueOf(2), readRows, alarmType, countDownLatch, alarmTsService, historymap)).start();
-                executor.execute(new AlarmThread(executor, edosUtil, alarmService, alarmTags, interval, String.valueOf(1), readRows, alarmType, countDownLatch, alarmTsService, historymap));
-                executor.execute(new AlarmThread(executor, edosUtil, alarmService, alarmInTags, interval, String.valueOf(2), readRows, alarmType, countDownLatch, alarmTsService, historymap));
+//                executor.execute(new AlarmThread(executor, edosUtil, alarmService, alarmTags, interval, String.valueOf(1), readRows, alarmType, countDownLatch, alarmTsService, historymap));
+//                executor.execute(new AlarmThread(executor, edosUtil, alarmService, alarmInTags, interval, String.valueOf(2), readRows, alarmType, countDownLatch, alarmTsService, historymap));
+//
+//                countDownLatch.await(30, TimeUnit.SECONDS);
+
+
+                int len = 1;
+
+                List<AlarmTag> alarmls = new ArrayList<>();
+
+                int listNumber = alarmTags.size() / taskCount;
+                int number = 0;
+                if (alarmTags.size() % taskCount != 0) {
+                    listNumber = listNumber + 1;
+                }
+                CountDownLatch countDownLatch = new CountDownLatch(listNumber);
+
+                StringBuilder str = new StringBuilder();
+                str.append("总数:").append(alarmTags.size()).append(",线程数:").append(listNumber).append(",分块大小:").append(taskCount);
+                log.info(String.valueOf(str));
+                for (int i = 0; i < alarmTags.size(); i++) {
+                    alarmls.add(alarmTags.get(i));
+                    if (i != 0 && alarmls.size() % taskCount == 0) {
+//                        new Thread(new AlarmThread(executor, edosUtil, alarmService, alarmls, interval, String.valueOf(len), readRows, alarmType, countDownLatch, alarmTsService, historymap)).start();
+
+                        executor.execute(new AlarmThread(executor, edosUtil, alarmService, alarmls, interval, String.valueOf(len), readRows, alarmType, countDownLatch, alarmTsService, historymap));
+
+                        alarmls = new ArrayList<>();
+                        len++;
+                    }
+                }
+
+                if (!alarmls.isEmpty()) {
+                    executor.execute(new AlarmThread(executor, edosUtil, alarmService, alarmls, interval, String.valueOf(len), readRows, alarmType, countDownLatch, alarmTsService, historymap));
 
+//                    new Thread(new AlarmThread(executor, edosUtil, alarmService, alarmls, interval, String.valueOf(len), readRows, alarmType, countDownLatch, alarmTsService, historymap)).start();
+                }
                 countDownLatch.await(30, TimeUnit.SECONDS);
 //                countDownLatch.await();
             } else {
@@ -193,7 +227,7 @@ public class AlarmScannerService {
                 log.info(String.valueOf(str));
                 for (int i = 0; i < alarmTags.size(); i++) {
                     alarmls.add(alarmTags.get(i));
-                    if (i != 0 && (i) % taskCount == 0) {
+                    if (i != 0 && alarmls.size() % taskCount == 0) {
 //                        new Thread(new AlarmThread(executor, edosUtil, alarmService, alarmls, interval, String.valueOf(len), readRows, alarmType, countDownLatch, alarmTsService, historymap)).start();
 
                         executor.execute(new AlarmThread(executor, edosUtil, alarmService, alarmls, interval, String.valueOf(len), readRows, alarmType, countDownLatch, alarmTsService, historymap));

+ 2 - 2
alarm-service/src/main/java/com/gyee/alarm/service/AlarmWtService.java

@@ -528,8 +528,8 @@ public class AlarmWtService {
             StringBuilder sb = new StringBuilder();
             Map<String, AlarmSimpleVo> map = new HashMap<>();
             for (AlarmTag alarm : ls) {
-                if (CacheContext.alarmWtMap.containsKey(alarm.getId())) {
-                    AlarmVo vo = CacheContext.alarmWtMap.get(alarm.getId());
+                if (CacheContext.alarmWtMap.containsKey(alarm.getId().toUpperCase())) {
+                    AlarmVo vo = CacheContext.alarmWtMap.get(alarm.getId().toUpperCase());
                     if (vo.getAlarmtype().equals(AlarmTypeValue.WT.getCode())) {
                         sb.append("'").append(alarm.getId().toLowerCase()).append("',");
                     }

+ 1 - 1
alarm-service/src/main/java/com/gyee/alarm/service/auto/impl/AlarmTsServiceImpl.java

@@ -198,7 +198,7 @@ public class AlarmTsServiceImpl extends ServiceImpl<AlarmTsMapper, AlarmTs> impl
             sb.append(" select last_row(ts) as ts, last_row(val) as val, last_row(confirmed) as confirmed, last_row(endts) as endts, last_row(timelong) as timelong,tbname from ")
             .append(superTableName).append(" where tbname in( ");
             sb.append(tbnames)
-                    .append(" ) and endts is null group by tbname");
+                    .append(" )  group by tbname");
 
             ls= alarmTsMapper.selectLastRowByTbname(String.valueOf(sb));
         }

+ 6 - 1
alarm-web/src/main/java/com/gyee/alarm/controller/AlarmHistoryController.java

@@ -180,6 +180,11 @@ public class AlarmHistoryController {
         if(StringUtils.empty(alarmIds))
         {
             alarmIds=null;
+        }else
+        {
+            StringBuilder alarmIdsSql=new  StringBuilder();
+            alarmIdsSql.append("%").append(alarmIds).append("%");
+            alarmIds=String.valueOf(alarmIdsSql);
         }
         if(StringUtils.empty(alarmType))
         {
@@ -192,7 +197,7 @@ public class AlarmHistoryController {
         Map<String, List<AlarmStatVo>> alarmStatMapGroupbyWindturbineId = pressureList.stream().collect(Collectors.groupingBy(AlarmStatVo::getWindturbineId));
 
         Map<String, List<AlarmStatVo>> resultMap = new TreeMap<>();
-        int max=0;
+        int max=10;
 
 
 

File diff suppressed because it is too large
+ 14 - 8
alarm-web/src/main/java/com/gyee/alarm/mapper/auto/AlarmTsMapper.java


+ 200 - 39
alarm-web/src/main/java/com/gyee/alarm/service/AlarmHistoryService.java

@@ -137,8 +137,14 @@ public class AlarmHistoryService   {
 //                            alarm.setVal(tag.getVal().doubleValue());
 //                        }
 //
-                        alarm.setEndts(null!=tag.getEndts()?tag.getEndts().getTime():null);
-                        alarm.setTimeLong(null!=tag.getTimelong()?tag.getTimelong():null);
+                        alarm.setEndts(null!=tag.getEndts()?tag.getEndts().getTime():new Date().getTime());
+
+                        Date begin = new Date(alarm.getEndts());
+                        Date end = new Date(alarm.getTs());
+
+                        double value = DateUtils.secondsDiff(begin, end);
+                        alarm.setTimeLong(value);
+//                        alarm.setTimeLong(null!=tag.getTimelong()?tag.getTimelong():null);
 //                        alarm.setConfirmed(true);
 //                        savels.add(alarm);
                     }
@@ -289,13 +295,21 @@ public class AlarmHistoryService   {
             }
         }
 
-
+        String characteristic=null;
 //
         if(StringUtils.notEmp(description)  )
         {
             descriptionSql.append("%").append(description).append("%");
             description=String.valueOf(descriptionSql);
+
+            if(alarmType.equals(AlarmTypeValue.CT.getCode()))
+            {
+                characteristic=description;
+                description=null;
+            }
+
         }
+
         if(StringUtils.empty(deviceid)  )
         {
             deviceid=null;
@@ -323,7 +337,7 @@ public class AlarmHistoryService   {
             components=null;
         }else
         {
-             StringBuilder componentsList=new StringBuilder();
+            StringBuilder componentsList=new StringBuilder();
             String [] componentsStr=components.split(",");
             for(String c:componentsStr)
             {
@@ -362,7 +376,7 @@ public class AlarmHistoryService   {
         {
             isclose=null;
         }
-        vos = alarmTsMapper.selectByWtLimit(begin,end,modelId,superTableName, alarmType, stationid, deviceid, description,deviceType,components, alarmId,isclose,pageNum*pageSize, pageSize,subcomponents);
+        vos = alarmTsMapper.selectByWtLimit(begin,end,modelId,superTableName, alarmType, stationid, deviceid, description,deviceType,components, alarmId,isclose,pageNum*pageSize, pageSize,subcomponents,characteristic);
 
         for(AlarmVo vo:vos)
         {
@@ -390,12 +404,19 @@ public class AlarmHistoryService   {
             {
                 vo.setDescription(CacheContext.alarmMap.get(vo.getAlarmId()).getDescription());
             }
+            StringBuilder sb=new StringBuilder();
+            sb.append(vo.getDeviceId()+"_"+vo.getAlarmId());
+            if(CacheContext.alarmCtMap.containsKey(String.valueOf(sb).toUpperCase()))
+            {
+                vo.setCharacteristic(CacheContext.alarmCtMap.get(String.valueOf(sb).toUpperCase()).getCharacteristic());
+            }
+
 
         }
 
 
         map.put("ls",vos);
-        List<Integer> total=alarmTsMapper.selectByWtCount(begin,end,modelId,superTableName, alarmType, stationid, deviceid, description,deviceType,components,alarmId,isclose,subcomponents);
+        List<Integer> total=alarmTsMapper.selectByWtCount(begin,end,modelId,superTableName, alarmType, stationid, deviceid, description,deviceType,components,alarmId,isclose,subcomponents,characteristic);
 
         if(!total.isEmpty())
         {
@@ -408,6 +429,7 @@ public class AlarmHistoryService   {
 
 
 
+
     /**
      * 查询报警信息接口
      * @param begin 开始时间
@@ -478,15 +500,15 @@ public class AlarmHistoryService   {
             Date beginDate = DateUtils.truncate(endDate);
             if(type.equals(AlarmTypeValue.BT.getCode()))
             {
-                vos = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.BT.getCode(), AlarmTypeValue.BT.getCode(), null, null, null,null,null, null,null,1, home_pagep_size,null);
+                vos = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.BT.getCode(), AlarmTypeValue.BT.getCode(), null, null, null,null,null, null,null,1, home_pagep_size,null,null);
 
             }else if(type.equals(AlarmTypeValue.WT.getCode()))
             {
-                vos = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.WT.getCode(), AlarmTypeValue.WT.getCode(), null, null, null,null, null,null,null,1, home_pagep_size,null);
+                vos = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.WT.getCode(), AlarmTypeValue.WT.getCode(), null, null, null,null, null,null,null,1, home_pagep_size,null,null);
 
             }else if(type.equals(AlarmTypeValue.CT.getCode()))
             {
-                vos = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.CT.getCode(), AlarmTypeValue.CT.getCode(), null, null, null,null, null,null,null,1, home_pagep_size,null);
+                vos = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.CT.getCode(), AlarmTypeValue.CT.getCode(), null, null, null,null, null,null,null,1, home_pagep_size,null,null);
 
             }
 
@@ -515,21 +537,21 @@ public class AlarmHistoryService   {
             }
 
         }
-        if(StringUtils.notEmp(alarmIds))
-        {
-            String [] alarmIdStr=alarmIds.split(",");
-            for(String c:alarmIdStr)
-            {
-                alarmIdList.append("'").append(c).append("',");
-                alarmIdMap.put(c,c);
-            }
-
-        }
-        String alarmId=null;
+//        if(StringUtils.notEmp(alarmIds))
+//        {
+//            String [] alarmIdStr=alarmIds.split(",");
+//            for(String c:alarmIdStr)
+//            {
+//                alarmIdList.append("'").append(c).append("',");
+//                alarmIdMap.put(c,c);
+//            }
+//
+//        }
+        String alarmId=alarmIds;
         String component=null;
         if(alarmIdList.length()>0)
         {
-             alarmId=String.valueOf(alarmIdList.substring(0,alarmIdList.length()-1));
+            alarmId=String.valueOf(alarmIdList.substring(0,alarmIdList.length()-1));
         }
         if(componentsList.length()>0)
         {
@@ -547,7 +569,16 @@ public class AlarmHistoryService   {
         {
             fsls = alarmTsMapper.findWtFeatureStat(AlarmSuperTalbeType.WT.getCode(),startTime.getTime(), endTime.getTime(),stationId,modelId,component,alarmId, alarmType);
         }
+        List<ProBasicFeatureStat> templs= new ArrayList<>();
+        for(ProBasicFeatureStat fs:fsls)
+        {
+            if(StringUtils.notEmp(fs.getTotalSeconds()) && StringUtils.notEmp(fs.getTotal()) && fs.getTotal()>0)
+            {
+                templs.add(fs);
+            }
+        }
 
+        fsls=templs;
         Map<String, ProBasicFeatureStat> map = new HashMap<>();
         Date statDate=DateUtils.truncate(new Date());
 
@@ -564,8 +595,46 @@ public class AlarmHistoryService   {
                 map.put(String.valueOf(sb), fs);
             }
         }
-        List<ProBasicFeatureStat> vos = new ArrayList<>();
 
+
+//        if(CacheContext.wpwtmap.containsKey(stationId))
+//        {
+//            List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get(stationId);
+//            for (ProBasicEquipment wt : wtls) {
+//
+//                StringBuilder sb=new StringBuilder();
+//                sb.append(wt.getWindpowerstationId()).append(wt.getModelId());
+//                if(CacheContext.wtAlarmMap.containsKey(String.valueOf(sb))) {
+//                    List<ProEconAlarmConfiguration> ls = CacheContext.wtAlarmMap.get(String.valueOf(sb));
+//                    for (ProEconAlarmConfiguration at : ls) {
+//                        if(StringUtils.notEmp(components) )
+//                        {
+//                            if(componentsMap.containsKey(at.getComponents()) )
+//                            {
+//                                if(StringUtils.notEmp(alarmIdMap) && !alarmIdMap.isEmpty())
+//                                {
+//                                    if( alarmIdMap.containsKey(at.getId()))
+//                                    {
+//                                        setWtValues(statDate, map, vos, wt, at);
+//                                    }
+//
+//                                }else
+//                                {
+//                                    setWtValues(statDate, map, vos, wt, at);
+//                                }
+//                            }
+//                        }else
+//                        {
+//                            setWtValues(statDate, map, vos, wt, at);
+//                        }
+//
+//                    }
+//                }
+//            }
+//        }
+
+
+        List<ProBasicFeatureStat> vos = new ArrayList<>();
         if(CacheContext.wpwtmap.containsKey(stationId))
         {
             List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get(stationId);
@@ -602,6 +671,51 @@ public class AlarmHistoryService   {
             }
         }
 
+        if(vos.size()<10)
+        {
+            if(CacheContext.wpwtmap.containsKey(stationId))
+            {
+                List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get(stationId);
+                for (ProBasicEquipment wt : wtls) {
+
+                    StringBuilder sb=new StringBuilder();
+                    sb.append(wt.getWindpowerstationId()).append(wt.getModelId());
+                    if(CacheContext.wtAlarmMap.containsKey(String.valueOf(sb))) {
+                        List<ProEconAlarmConfiguration> ls = CacheContext.wtAlarmMap.get(String.valueOf(sb));
+                        for (ProEconAlarmConfiguration at : ls) {
+                            if(vos.size()>=10)
+                            {
+                                break;
+                            }
+                            if(StringUtils.notEmp(components) )
+                            {
+                                if(componentsMap.containsKey(at.getComponents()) )
+                                {
+                                    if(StringUtils.notEmp(alarmIdMap) && !alarmIdMap.isEmpty())
+                                    {
+                                        if( alarmIdMap.containsKey(at.getId()))
+                                        {
+                                            setWtValues2(statDate, map, vos, wt, at);
+                                        }
+
+                                    }else
+                                    {
+                                        setWtValues2(statDate, map, vos, wt, at);
+                                    }
+                                }
+                            }else
+                            {
+                                setWtValues2(statDate, map, vos, wt, at);
+                            }
+
+                        }
+                    }
+                }
+            }
+        }
+
+
+
 
         Map<String,List<AlarmStatVo>> vomap=new HashMap<>();
         for(ProBasicFeatureStat fs:vos)
@@ -685,6 +799,35 @@ public class AlarmHistoryService   {
     }
     private  static void setWtValues(Date statDate,Map<String, ProBasicFeatureStat> map, List<ProBasicFeatureStat> vos, ProBasicEquipment wt, ProEconAlarmConfiguration at) {
 
+//        ProBasicFeatureStat fs = new ProBasicFeatureStat();
+//
+//        StringBuilder sb = new StringBuilder();
+//        sb.append(wt.getId()).append("_").append(at.getId());
+//        if (map.containsKey(String.valueOf(sb))) {
+//            ProBasicFeatureStat old = map.get(String.valueOf(sb));
+//            BeanUtil.copyProperties(old, fs);
+//        }
+//        else {
+//            fs.setStatDate(new Timestamp(statDate.getTime()));
+//            fs.setId(String.valueOf(SnowflakeGenerator.generateId()));
+//            fs.setWtId(wt.getId());
+//            fs.setStationId(wt.getWindpowerstationId());
+//            fs.setTypeCode(at.getComponents());
+//            if(CacheContext.alarmTypeMap.containsKey(at.getComponents()))
+//            {
+//                fs.setTypeName(CacheContext.alarmTypeMap.get(at.getComponents()).getName());
+//            }
+//            fs.setAlarmid(at.getId());
+//            fs.setDescription(at.getDescription());
+//            fs.setTotal(0L);
+//            fs.setAvgSeconds(0.0);
+//            fs.setMaxSeconds(0.0);
+//            fs.setMinSeconds(0.0);
+//            fs.setTotalSeconds(0.0);
+//
+//        }
+//        vos.add(fs);
+
         ProBasicFeatureStat fs = new ProBasicFeatureStat();
 
         StringBuilder sb = new StringBuilder();
@@ -692,26 +835,44 @@ public class AlarmHistoryService   {
         if (map.containsKey(String.valueOf(sb))) {
             ProBasicFeatureStat old = map.get(String.valueOf(sb));
             BeanUtil.copyProperties(old, fs);
-        } else {
-            fs.setStatDate(new Timestamp(statDate.getTime()));
-            fs.setId(String.valueOf(SnowflakeGenerator.generateId()));
-            fs.setWtId(wt.getId());
-            fs.setStationId(wt.getWindpowerstationId());
-            fs.setTypeCode(at.getComponents());
-            if(CacheContext.alarmTypeMap.containsKey(at.getComponents()))
-            {
-                fs.setTypeName(CacheContext.alarmTypeMap.get(at.getComponents()).getName());
-            }
-            fs.setAlarmid(at.getId());
-            fs.setDescription(at.getDescription());
-            fs.setTotal(0L);
-            fs.setAvgSeconds(0.0);
-            fs.setMaxSeconds(0.0);
-            fs.setMinSeconds(0.0);
-            fs.setTotalSeconds(0.0);
+            vos.add(fs);
+        }
+
 
+    }
+
+    private  static void setWtValues2(Date statDate,Map<String, ProBasicFeatureStat> map, List<ProBasicFeatureStat> vos, ProBasicEquipment wt, ProEconAlarmConfiguration at) {
+
+        ProBasicFeatureStat fs = new ProBasicFeatureStat();
+
+        if(vos.size()<10)
+        {
+            StringBuilder sb = new StringBuilder();
+            sb.append(wt.getId()).append("_").append(at.getId());
+            if (!map.containsKey(String.valueOf(sb))) {
+                fs.setStatDate(new Timestamp(statDate.getTime()));
+                fs.setId(String.valueOf(SnowflakeGenerator.generateId()));
+                fs.setWtId(wt.getId());
+                fs.setStationId(wt.getWindpowerstationId());
+                fs.setTypeCode(at.getComponents());
+                if(CacheContext.alarmTypeMap.containsKey(at.getComponents()))
+                {
+                    fs.setTypeName(CacheContext.alarmTypeMap.get(at.getComponents()).getName());
+                }
+                fs.setAlarmid(at.getId());
+                fs.setDescription(at.getDescription());
+                fs.setTotal(0L);
+                fs.setAvgSeconds(0.0);
+                fs.setMaxSeconds(0.0);
+                fs.setMinSeconds(0.0);
+                fs.setTotalSeconds(0.0);
+            }
         }
+
         vos.add(fs);
+
+
+
     }
 
     public List<AlarmStatVo> findCtFeatureStat(String stationId,String modelId, Date startTime, Date endTime,String components,String deviceType,String alarmIds,String timeType) {

+ 1 - 1
alarm-web/src/main/java/com/gyee/alarm/service/auto/impl/AlarmTsServiceImpl.java

@@ -160,7 +160,7 @@ public class AlarmTsServiceImpl extends ServiceImpl<AlarmTsMapper, AlarmTs> impl
         if(StringUtils.notEmp(superTableName) && StringUtils.notEmp(tbnames))
         {
             StringBuilder sb=new StringBuilder();
-            sb.append("select last_row(*),tbname from ").append(superTableName).append(" where tbname in( ").append(tbnames).append(" ) group by tbname");
+            sb.append("select last_row(*),tbname,ts,endts from ").append(superTableName).append(" where tbname in( ").append(tbnames).append(" ) group by tbname");
 
             ls= alarmTsMapper.selectLastRowByTbname(String.valueOf(sb));
         }