Преглед изворни кода

告警所有接口,数据为模拟

wukai пре 9 месеци
родитељ
комит
83e97b2ac0

+ 103 - 53
jjt-biz/src/main/java/com/jjt/biz/controller/AlarmRecordController.java

@@ -2,19 +2,23 @@ package com.jjt.biz.controller;
 
 import com.jjt.biz.domain.AlarmRecord;
 import com.jjt.biz.service.IAlarmRecordService;
-import com.jjt.common.annotation.Log;
+import com.jjt.biz.vo.BizAccessVO;
+import com.jjt.biz.vo.BizSortVO;
+import com.jjt.biz.vo.BizTypeVO;
+import com.jjt.biz.vo.LevelSortVO;
 import com.jjt.common.core.controller.BaseController;
-import com.jjt.common.core.domain.AjaxResult;
 import com.jjt.common.core.page.TableDataInfo;
-import com.jjt.common.enums.BusinessType;
-import com.jjt.common.utils.poi.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -42,59 +46,105 @@ public class AlarmRecordController extends BaseController {
         return getDataTable(list);
     }
 
-    /**
-     * 导出告警记录列表
-     */
-    @ApiOperation("导出告警记录列表")
-    @PreAuthorize("@ss.hasPermi('alarm:record:export')")
-    @Log(title = "告警记录" , businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, AlarmRecord alarmRecord) {
-        List<AlarmRecord> list = alarmRecordService.selectAlarmRecordList(alarmRecord);
-        ExcelUtil<AlarmRecord> util = new ExcelUtil<AlarmRecord>(AlarmRecord.class);
-        util.exportExcel(response, list, "告警记录数据");
+    @ApiOperation("业务类型统计")
+    @GetMapping("/list/bizType")
+    public TableDataInfo listBizType(@ApiParam(value = "开始时间") Date start, @ApiParam(value = "结束时间") Date end) {
+        List<BizTypeVO> list = new ArrayList();
+        for (int i = 0; i < 10; i++) {
+            list.add(new BizTypeVO(true));
+        }
+        return getDataTable(list);
     }
 
-    /**
-     * 获取告警记录详细信息
-     */
-    @ApiOperation("获取告警记录详细信息")
-    @PreAuthorize("@ss.hasPermi('alarm:record:query')")
-    @GetMapping(value = "/{alarmId}")
-    public AjaxResult getInfo(@PathVariable("alarmId") Long alarmId) {
-        return success(alarmRecordService.selectAlarmRecordByAlarmId(alarmId));
+    @ApiOperation("应用组件统计")
+    @GetMapping("/list/bizSort")
+    public TableDataInfo listBizSort(@ApiParam(value = "分类") String bizType, @ApiParam(value = "开始时间") Date start, @ApiParam(value = "结束时间") Date end) {
+        List<BizSortVO> list = new ArrayList();
+        for (int i = 0; i < 10; i++) {
+            list.add(new BizSortVO(true));
+        }
+        return getDataTable(list);
     }
 
-    /**
-     * 新增告警记录
-     */
-    @ApiOperation("新增告警记录")
-    @PreAuthorize("@ss.hasPermi('alarm:record:add')")
-    @Log(title = "告警记录" , businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody AlarmRecord alarmRecord) {
-        return toAjax(alarmRecordService.insertAlarmRecord(alarmRecord));
+    @ApiOperation("系统压力排名")
+    @GetMapping("/list/bizAccess")
+    public TableDataInfo listBizAccess(@ApiParam(value = "开始时间") Date start, @ApiParam(value = "结束时间") Date end) {
+        List<BizAccessVO> list = new ArrayList();
+        for (int i = 0; i < 10; i++) {
+            list.add(new BizAccessVO(true));
+        }
+        return getDataTable(list);
     }
 
-    /**
-     * 修改告警记录
-     */
-    @ApiOperation("修改告警记录")
-    @PreAuthorize("@ss.hasPermi('alarm:record:edit')")
-    @Log(title = "告警记录" , businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody AlarmRecord alarmRecord) {
-        return toAjax(alarmRecordService.updateAlarmRecord(alarmRecord));
+    @ApiOperation("等级级别排名")
+    @GetMapping("/list/levelSort")
+    public TableDataInfo listLevelSort(@ApiParam(value = "开始时间") Date start, @ApiParam(value = "结束时间") Date end) {
+        List<LevelSortVO> list = new ArrayList();
+        LevelSortVO ls1 = new LevelSortVO();
+        ls1.setLevel("1");
+        ls1.setNum(88L);
+        LevelSortVO ls2 = new LevelSortVO();
+        ls2.setLevel("2");
+        ls1.setNum(15L);
+        LevelSortVO ls3 = new LevelSortVO();
+        ls3.setLevel("3");
+        ls1.setNum(3L);
+        return getDataTable(list);
     }
 
-    /**
-     * 删除告警记录
-     */
-    @ApiOperation("删除告警记录")
-    @PreAuthorize("@ss.hasPermi('alarm:record:remove')")
-    @Log(title = "告警记录" , businessType = BusinessType.DELETE)
-    @DeleteMapping("/{alarmIds}")
-    public AjaxResult remove(@PathVariable Long[] alarmIds) {
-        return toAjax(alarmRecordService.deleteAlarmRecordByAlarmIds(alarmIds));
-    }
+//    /**
+//     * 导出告警记录列表
+//     */
+//    @ApiOperation("导出告警记录列表")
+//    @PreAuthorize("@ss.hasPermi('alarm:record:export')")
+//    @Log(title = "告警记录", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, AlarmRecord alarmRecord) {
+//        List<AlarmRecord> list = alarmRecordService.selectAlarmRecordList(alarmRecord);
+//        ExcelUtil<AlarmRecord> util = new ExcelUtil<AlarmRecord>(AlarmRecord.class);
+//        util.exportExcel(response, list, "告警记录数据");
+//    }
+//
+//    /**
+//     * 获取告警记录详细信息
+//     */
+//    @ApiOperation("获取告警记录详细信息")
+//    @PreAuthorize("@ss.hasPermi('alarm:record:query')")
+//    @GetMapping(value = "/{alarmId}")
+//    public AjaxResult getInfo(@PathVariable("alarmId") Long alarmId) {
+//        return success(alarmRecordService.selectAlarmRecordByAlarmId(alarmId));
+//    }
+//
+//    /**
+//     * 新增告警记录
+//     */
+//    @ApiOperation("新增告警记录")
+//    @PreAuthorize("@ss.hasPermi('alarm:record:add')")
+//    @Log(title = "告警记录", businessType = BusinessType.INSERT)
+//    @PostMapping
+//    public AjaxResult add(@RequestBody AlarmRecord alarmRecord) {
+//        return toAjax(alarmRecordService.insertAlarmRecord(alarmRecord));
+//    }
+//
+//    /**
+//     * 修改告警记录
+//     */
+//    @ApiOperation("修改告警记录")
+//    @PreAuthorize("@ss.hasPermi('alarm:record:edit')")
+//    @Log(title = "告警记录", businessType = BusinessType.UPDATE)
+//    @PutMapping
+//    public AjaxResult edit(@RequestBody AlarmRecord alarmRecord) {
+//        return toAjax(alarmRecordService.updateAlarmRecord(alarmRecord));
+//    }
+//
+//    /**
+//     * 删除告警记录
+//     */
+//    @ApiOperation("删除告警记录")
+//    @PreAuthorize("@ss.hasPermi('alarm:record:remove')")
+//    @Log(title = "告警记录", businessType = BusinessType.DELETE)
+//    @DeleteMapping("/{alarmIds}")
+//    public AjaxResult remove(@PathVariable Long[] alarmIds) {
+//        return toAjax(alarmRecordService.deleteAlarmRecordByAlarmIds(alarmIds));
+//    }
 }

+ 37 - 0
jjt-biz/src/main/java/com/jjt/biz/vo/BizAccessVO.java

@@ -0,0 +1,37 @@
+package com.jjt.biz.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Random;
+
+/**
+ * 业务类型统计
+ *
+ * @author wukai
+ * @date 2024/8/21 10:16
+ */
+@ApiModel(value = "BizAccessVO", description = "业务类型统计")
+@Data
+@NoArgsConstructor
+public class BizAccessVO {
+    @ApiModelProperty("模型ID")
+    private Long modelId;
+    @ApiModelProperty("模型名称")
+    private String modelName;
+    @ApiModelProperty("压力")
+    private Long access;
+    @ApiModelProperty("告警数量")
+    private Long num;
+
+    public BizAccessVO(boolean flag) {
+        if (flag) {
+            this.modelName = "测试模型" + (new Random().nextInt(10) + 1);
+            this.access = Long.valueOf(new Random().nextInt(100) + 10);
+            this.num = Long.valueOf(new Random().nextInt(200) + 10);
+            this.modelId = Long.valueOf(new Random().nextInt(20) + 1);
+        }
+    }
+}

+ 37 - 0
jjt-biz/src/main/java/com/jjt/biz/vo/BizSortVO.java

@@ -0,0 +1,37 @@
+package com.jjt.biz.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Random;
+
+/**
+ * 业务类型统计
+ *
+ * @author wukai
+ * @date 2024/8/21 10:16
+ */
+@ApiModel(value = "BizSortVO", description = "应用组件统计")
+@Data
+@NoArgsConstructor
+public class BizSortVO {
+    @ApiModelProperty("业务对象ID")
+    private Long objId;
+    @ApiModelProperty("对象名称")
+    private String objName;
+    @ApiModelProperty("业务类型")
+    private String bizType;
+    @ApiModelProperty("告警数量")
+    private Long num;
+
+    public BizSortVO(boolean flag) {
+        if (flag) {
+            this.objName = "测试数据" + (new Random().nextInt(10) + 1);
+            this.num = Long.valueOf(new Random().nextInt(200) + 10);
+            this.bizType = "" + (new Random().nextInt(10) + 1);
+            this.objId = Long.valueOf(new Random().nextInt(20) + 1);
+        }
+    }
+}

+ 32 - 0
jjt-biz/src/main/java/com/jjt/biz/vo/BizTypeVO.java

@@ -0,0 +1,32 @@
+package com.jjt.biz.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Random;
+
+/**
+ * 业务类型统计
+ *
+ * @author wukai
+ * @date 2024/8/21 10:16
+ */
+@ApiModel(value = "BizTypeVO", description = "业务类型统计")
+@Data
+@NoArgsConstructor
+public class BizTypeVO {
+    @ApiModelProperty("业务类型")
+    private String bizType;
+    @ApiModelProperty("告警数量")
+    private Long num;
+
+    public BizTypeVO(boolean flag) {
+        if (flag) {
+            this.bizType = "" + (new Random().nextInt(10) + 1);
+            this.num = Long.valueOf(new Random().nextInt(200) + 10);
+        }
+
+    }
+}

+ 31 - 0
jjt-biz/src/main/java/com/jjt/biz/vo/LevelSortVO.java

@@ -0,0 +1,31 @@
+package com.jjt.biz.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Random;
+
+/**
+ * 业务类型统计
+ *
+ * @author wukai
+ * @date 2024/8/21 10:16
+ */
+@ApiModel(value = "LevelSortVO", description = "告警级别排名")
+@Data
+@NoArgsConstructor
+public class LevelSortVO {
+    @ApiModelProperty("告警级别")
+    private String level;
+    @ApiModelProperty("告警数量")
+    private Long num;
+
+    public LevelSortVO(boolean flag) {
+        if (flag) {
+            this.level = "" + (new Random().nextInt(3) + 1);
+            this.num = Long.valueOf(new Random().nextInt(200) + 10);
+        }
+    }
+}

+ 169 - 118
jjt-biz/src/main/resources/mapper/alarm/AlarmRecordMapper.xml

@@ -5,157 +5,208 @@
 <mapper namespace="com.jjt.biz.mapper.AlarmRecordMapper">
 
     <resultMap type="AlarmRecord" id="AlarmRecordResult">
-            <result property="alarmId" column="ALARM_ID"/>
-            <result property="objId" column="OBJ_ID"/>
-            <result property="objMetricsId" column="OBJ_METRICS_ID"/>
-            <result property="alarmType" column="ALARM_TYPE"/>
-            <result property="alarmLevel" column="ALARM_LEVEL"/>
-            <result property="alarmValue" column="ALARM_VALUE"/>
-            <result property="alarmTime" column="ALARM_TIME"/>
-            <result property="createBy" column="CREATE_BY"/>
-            <result property="createTime" column="CREATE_TIME"/>
-            <result property="updateBy" column="UPDATE_BY"/>
-            <result property="updateTime" column="UPDATE_TIME"/>
-            <result property="remark" column="REMARK"/>
+        <result property="alarmId" column="ALARM_ID"/>
+        <result property="objId" column="OBJ_ID"/>
+        <result property="objMetricsId" column="OBJ_METRICS_ID"/>
+        <result property="alarmType" column="ALARM_TYPE"/>
+        <result property="alarmLevel" column="ALARM_LEVEL"/>
+        <result property="alarmValue" column="ALARM_VALUE"/>
+        <result property="alarmTime" column="ALARM_TIME"/>
+        <result property="createBy" column="CREATE_BY"/>
+        <result property="createTime" column="CREATE_TIME"/>
+        <result property="updateBy" column="UPDATE_BY"/>
+        <result property="updateTime" column="UPDATE_TIME"/>
+        <result property="remark" column="REMARK"/>
+        <association property="bizobj" javaType="BizObj">
+            <result property="objType" column="OBJ_TYPE"/>
+            <result property="appId" column="APP_ID"/>
+            <result property="accessTimes" column="ACCESS_TIMES"/>
+            <result property="objName" column="OBJ_NAME"/>
+            <result property="objAddr" column="OBJ_ADDR"/>
+            <result property="objPort" column="OBJ_PORT"/>
+        </association>
+        <association property="bizObjMetrics" javaType="BizObjMetrics">
+            <result property="tplId" column="TPL_ID"/>
+            <result property="metricsId" column="METRICS_ID"/>
+            <result property="metricsName" column="METRICS_NAME"/>
+            <result property="metricsCode" column="METRICS_CODE"/>
+            <result property="alarmLow" column="ALARM_LOW"/>
+            <result property="alarmMid" column="ALARM_MID"/>
+            <result property="alarmHigh" column="ALARM_HIGH"/>
+            <result property="dValue" column="D_VALUE"/>
+            <result property="dataExp" column="DATA_EXP"/>
+        </association>
     </resultMap>
 
     <sql id="selectAlarmRecordVo">
-        select ALARM_ID, OBJ_ID, OBJ_METRICS_ID, ALARM_TYPE, ALARM_LEVEL, ALARM_VALUE, ALARM_TIME, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
-        from alarm_record
+        select *
+        from (SELECT A.ALARM_ID,
+                     A.OBJ_ID,
+                     A.OBJ_METRICS_ID,
+                     A.ALARM_TYPE,
+                     A.ALARM_LEVEL,
+                     A.ALARM_VALUE,
+                     A.ALARM_TIME,
+                     A.CREATE_BY,
+                     A.CREATE_TIME,
+                     A.UPDATE_BY,
+                     A.UPDATE_TIME,
+                     A.REMARK,
+                     B.OBJ_TYPE,
+                     B.APP_ID,
+                     B.ACCESS_TIMES,
+                     B.OBJ_NAME,
+                     B.OBJ_ADDR,
+                     B.OBJ_PORT,
+                     c.TPL_ID,
+                     c.METRICS_ID,
+                     c.METRICS_NAME,
+                     c.METRICS_CODE,
+                     c.DATA_EXP,
+                     c.ALARM_LOW,
+                     c.ALARM_MID,
+                     c.ALARM_HIGH,
+                     c.D_VALUE
+              FROM alarm_record a,
+                   biz_obj b,
+                   biz_obj_metrics c
+              WHERE a.obj_id = b.obj_id
+                AND a.OBJ_METRICS_ID = c.OBJ_METRICS_ID) t
     </sql>
 
     <select id="selectAlarmRecordList" parameterType="AlarmRecord" resultMap="AlarmRecordResult">
         <include refid="selectAlarmRecordVo"/>
         <where>
-                        <if test="objId != null ">
-                            and OBJ_ID = #{objId}
-                        </if>
-                        <if test="objMetricsId != null ">
-                            and OBJ_METRICS_ID = #{objMetricsId}
-                        </if>
-                        <if test="alarmType != null  and alarmType != ''">
-                            and ALARM_TYPE = #{alarmType}
-                        </if>
-                        <if test="alarmLevel != null  and alarmLevel != ''">
-                            and ALARM_LEVEL = #{alarmLevel}
-                        </if>
-                        <if test="alarmValue != null  and alarmValue != ''">
-                            and ALARM_VALUE = #{alarmValue}
-                        </if>
-                        <if test="params.beginAlarmTime != null and params.beginAlarmTime != '' and params.endAlarmTime != null and params.endAlarmTime != ''">
-                            and ALARM_TIME between #{params.beginAlarmTime} and #{params.endAlarmTime}
-                        </if>
-                        <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
-                            and CREATE_TIME between #{params.beginCreateTime} and #{params.endCreateTime}
-                        </if>
-                        <if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
-                            and UPDATE_TIME between #{params.beginUpdateTime} and #{params.endUpdateTime}
-                        </if>
+            <if test="objId != null ">
+                and OBJ_ID = #{objId}
+            </if>
+            <if test="objMetricsId != null ">
+                and OBJ_METRICS_ID = #{objMetricsId}
+            </if>
+            <if test="alarmType != null  and alarmType != ''">
+                and ALARM_TYPE = #{alarmType}
+            </if>
+            <if test="alarmLevel != null  and alarmLevel != ''">
+                and ALARM_LEVEL = #{alarmLevel}
+            </if>
+            <if test="alarmValue != null  and alarmValue != ''">
+                and ALARM_VALUE = #{alarmValue}
+            </if>
+            <if test="params.beginAlarmTime != null and params.beginAlarmTime != '' and params.endAlarmTime != null and params.endAlarmTime != ''">
+                and ALARM_TIME between #{params.beginAlarmTime} and #{params.endAlarmTime}
+            </if>
+            <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
+                and CREATE_TIME between #{params.beginCreateTime} and #{params.endCreateTime}
+            </if>
+            <if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
+                and UPDATE_TIME between #{params.beginUpdateTime} and #{params.endUpdateTime}
+            </if>
         </where>
     </select>
 
     <select id="selectAlarmRecordByAlarmId" parameterType="Long"
             resultMap="AlarmRecordResult">
-            <include refid="selectAlarmRecordVo"/>
-            where ALARM_ID = #{alarmId}
+        <include refid="selectAlarmRecordVo"/>
+        where ALARM_ID = #{alarmId}
     </select>
 
     <insert id="insertAlarmRecord" parameterType="AlarmRecord" useGeneratedKeys="true"
             keyProperty="alarmId">
         insert into alarm_record
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                    <if test="objId != null">OBJ_ID,
-                    </if>
-                    <if test="objMetricsId != null">OBJ_METRICS_ID,
-                    </if>
-                    <if test="alarmType != null">ALARM_TYPE,
-                    </if>
-                    <if test="alarmLevel != null">ALARM_LEVEL,
-                    </if>
-                    <if test="alarmValue != null">ALARM_VALUE,
-                    </if>
-                    <if test="alarmTime != null">ALARM_TIME,
-                    </if>
-                    <if test="createBy != null">CREATE_BY,
-                    </if>
-                    <if test="createTime != null">CREATE_TIME,
-                    </if>
-                    <if test="updateBy != null">UPDATE_BY,
-                    </if>
-                    <if test="updateTime != null">UPDATE_TIME,
-                    </if>
-                    <if test="remark != null">REMARK,
-                    </if>
+            <if test="objId != null">OBJ_ID,
+            </if>
+            <if test="objMetricsId != null">OBJ_METRICS_ID,
+            </if>
+            <if test="alarmType != null">ALARM_TYPE,
+            </if>
+            <if test="alarmLevel != null">ALARM_LEVEL,
+            </if>
+            <if test="alarmValue != null">ALARM_VALUE,
+            </if>
+            <if test="alarmTime != null">ALARM_TIME,
+            </if>
+            <if test="createBy != null">CREATE_BY,
+            </if>
+            <if test="createTime != null">CREATE_TIME,
+            </if>
+            <if test="updateBy != null">UPDATE_BY,
+            </if>
+            <if test="updateTime != null">UPDATE_TIME,
+            </if>
+            <if test="remark != null">REMARK,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                    <if test="objId != null">#{objId},
-                    </if>
-                    <if test="objMetricsId != null">#{objMetricsId},
-                    </if>
-                    <if test="alarmType != null">#{alarmType},
-                    </if>
-                    <if test="alarmLevel != null">#{alarmLevel},
-                    </if>
-                    <if test="alarmValue != null">#{alarmValue},
-                    </if>
-                    <if test="alarmTime != null">#{alarmTime},
-                    </if>
-                    <if test="createBy != null">#{createBy},
-                    </if>
-                    <if test="createTime != null">#{createTime},
-                    </if>
-                    <if test="updateBy != null">#{updateBy},
-                    </if>
-                    <if test="updateTime != null">#{updateTime},
-                    </if>
-                    <if test="remark != null">#{remark},
-                    </if>
+            <if test="objId != null">#{objId},
+            </if>
+            <if test="objMetricsId != null">#{objMetricsId},
+            </if>
+            <if test="alarmType != null">#{alarmType},
+            </if>
+            <if test="alarmLevel != null">#{alarmLevel},
+            </if>
+            <if test="alarmValue != null">#{alarmValue},
+            </if>
+            <if test="alarmTime != null">#{alarmTime},
+            </if>
+            <if test="createBy != null">#{createBy},
+            </if>
+            <if test="createTime != null">#{createTime},
+            </if>
+            <if test="updateBy != null">#{updateBy},
+            </if>
+            <if test="updateTime != null">#{updateTime},
+            </if>
+            <if test="remark != null">#{remark},
+            </if>
         </trim>
     </insert>
 
     <update id="updateAlarmRecord" parameterType="AlarmRecord">
         update alarm_record
         <trim prefix="SET" suffixOverrides=",">
-                    <if test="objId != null">OBJ_ID =
-                        #{objId},
-                    </if>
-                    <if test="objMetricsId != null">OBJ_METRICS_ID =
-                        #{objMetricsId},
-                    </if>
-                    <if test="alarmType != null">ALARM_TYPE =
-                        #{alarmType},
-                    </if>
-                    <if test="alarmLevel != null">ALARM_LEVEL =
-                        #{alarmLevel},
-                    </if>
-                    <if test="alarmValue != null">ALARM_VALUE =
-                        #{alarmValue},
-                    </if>
-                    <if test="alarmTime != null">ALARM_TIME =
-                        #{alarmTime},
-                    </if>
-                    <if test="createBy != null">CREATE_BY =
-                        #{createBy},
-                    </if>
-                    <if test="createTime != null">CREATE_TIME =
-                        #{createTime},
-                    </if>
-                    <if test="updateBy != null">UPDATE_BY =
-                        #{updateBy},
-                    </if>
-                    <if test="updateTime != null">UPDATE_TIME =
-                        #{updateTime},
-                    </if>
-                    <if test="remark != null">REMARK =
-                        #{remark},
-                    </if>
+            <if test="objId != null">OBJ_ID =
+                #{objId},
+            </if>
+            <if test="objMetricsId != null">OBJ_METRICS_ID =
+                #{objMetricsId},
+            </if>
+            <if test="alarmType != null">ALARM_TYPE =
+                #{alarmType},
+            </if>
+            <if test="alarmLevel != null">ALARM_LEVEL =
+                #{alarmLevel},
+            </if>
+            <if test="alarmValue != null">ALARM_VALUE =
+                #{alarmValue},
+            </if>
+            <if test="alarmTime != null">ALARM_TIME =
+                #{alarmTime},
+            </if>
+            <if test="createBy != null">CREATE_BY =
+                #{createBy},
+            </if>
+            <if test="createTime != null">CREATE_TIME =
+                #{createTime},
+            </if>
+            <if test="updateBy != null">UPDATE_BY =
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">UPDATE_TIME =
+                #{updateTime},
+            </if>
+            <if test="remark != null">REMARK =
+                #{remark},
+            </if>
         </trim>
         where ALARM_ID = #{alarmId}
     </update>
 
     <delete id="deleteAlarmRecordByAlarmId" parameterType="Long">
         delete
-        from alarm_record where ALARM_ID = #{alarmId}
+        from alarm_record
+        where ALARM_ID = #{alarmId}
     </delete>
 
     <delete id="deleteAlarmRecordByAlarmIds" parameterType="String">