add - 告警類別信息 change - 告警單元添加告警類別關聯

main
wenjy 3 years ago
parent 8f6d10b84c
commit 846a0491a7

@ -0,0 +1,135 @@
package com.ruoyi.web.controller.base;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import com.ruoyi.common.utils.ShiroUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BaseAlarmCategory;
import com.ruoyi.system.service.IBaseAlarmCategoryService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author WenJY
* @date 2022-05-03
*/
@Controller
@RequestMapping("/base/alarmCategory")
public class BaseAlarmCategoryController extends BaseController
{
private String prefix = "base/alarmCategory";
@Autowired
private IBaseAlarmCategoryService baseAlarmCategoryService;
@RequiresPermissions("base:alarmCategory:view")
@GetMapping()
public String alarmCategory()
{
return prefix + "/alarmCategory";
}
/**
*
*/
@RequiresPermissions("base:alarmCategory:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BaseAlarmCategory baseAlarmCategory)
{
startPage();
List<BaseAlarmCategory> list = baseAlarmCategoryService.selectBaseAlarmCategoryList(baseAlarmCategory);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("base:alarmCategory:export")
@Log(title = "告警类别信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseAlarmCategory baseAlarmCategory)
{
List<BaseAlarmCategory> list = baseAlarmCategoryService.selectBaseAlarmCategoryList(baseAlarmCategory);
ExcelUtil<BaseAlarmCategory> util = new ExcelUtil<BaseAlarmCategory>(BaseAlarmCategory.class);
return util.exportExcel(list, "告警类别信息数据");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("base:alarmCategory:add")
@Log(title = "告警类别信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseAlarmCategory baseAlarmCategory)
{
baseAlarmCategory.setAlarmcategoryId(UUID.randomUUID().toString());
baseAlarmCategory.setCreateBy(ShiroUtils.getLoginName());
baseAlarmCategory.setCreateTime(new Date());
return toAjax(baseAlarmCategoryService.insertBaseAlarmCategory(baseAlarmCategory));
}
/**
*
*/
@GetMapping("/edit/{objId}")
public String edit(@PathVariable("objId") Long objId, ModelMap mmap)
{
BaseAlarmCategory baseAlarmCategory = baseAlarmCategoryService.selectBaseAlarmCategoryByObjId(objId);
mmap.put("baseAlarmCategory", baseAlarmCategory);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("base:alarmCategory:edit")
@Log(title = "告警类别信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BaseAlarmCategory baseAlarmCategory)
{
baseAlarmCategory.setUpdateBy(ShiroUtils.getLoginName());
baseAlarmCategory.setUpdateTime(new Date());
return toAjax(baseAlarmCategoryService.updateBaseAlarmCategory(baseAlarmCategory));
}
/**
*
*/
@RequiresPermissions("base:alarmCategory:remove")
@Log(title = "告警类别信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(baseAlarmCategoryService.deleteBaseAlarmCategoryByObjIds(ids));
}
}

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增告警类别信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-alarmCategory-add">
<div class="form-group">
<label class="col-sm-3 control-label">告警类别名称:</label>
<div class="col-sm-8">
<input name="alarmcategoryName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否启用:</label>
<div class="col-sm-8">
<select name="enableFlag" class="form-control m-b" th:with="type=${@dict.getType('enable_flag')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "base/alarmCategory"
$("#form-alarmCategory-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-alarmCategory-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('告警类别信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<!--<li>
<label>告警类别编号:</label>
<input type="text" name="alarmcategoryId"/>
</li>-->
<li>
<label>告警类别:</label>
<input type="text" name="alarmcategoryName"/>
</li>
<li>
<label>是否启用:</label>
<select name="enableFlag" th:with="type=${@dict.getType('enable_flag')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="base:alarmCategory:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="base:alarmCategory:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="base:alarmCategory:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:alarmCategory:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('base:alarmCategory:edit')}]];
var removeFlag = [[${@permission.hasPermi('base:alarmCategory:remove')}]];
var enableFlagDatas = [[${@dict.getType('enable_flag')}]];
var prefix = ctx + "base/alarmCategory";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "告警类别信息",
columns: [{
checkbox: true
},
{
field: 'objId',
title: '',
visible: false
},
{
field: 'alarmcategoryId',
title: '告警类别编号',
visible: false
},
{
field: 'alarmcategoryName',
title: '告警类别'
},
{
field: 'enableFlag',
title: '是否启用',
formatter: function(value, row, index) {
return $.table.selectDictLabel(enableFlagDatas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改告警类别信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-alarmCategory-edit" th:object="${baseAlarmCategory}">
<input name="objId" th:field="*{objId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">告警类别名称:</label>
<div class="col-sm-8">
<input name="alarmcategoryName" th:field="*{alarmcategoryName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否启用:</label>
<div class="col-sm-8">
<select name="enableFlag" class="form-control m-b" th:with="type=${@dict.getType('enable_flag')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{enableFlag}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "base/alarmCategory";
$("#form-alarmCategory-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-alarmCategory-edit').serialize());
}
}
</script>
</body>
</html>

@ -14,6 +14,15 @@
<input name="alarmmoduleText" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">告警类别:</label>
<div class="col-sm-8">
<select name="alarmCategoryId" class="form-control m-b" th:with="type=${@alarmCategoryService.getParamType()}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.alarmcategoryName}" th:value="${dict.alarmcategoryId}"></option>
</select>
</div>
</div>
<!--<div class="form-group">
<label class="col-sm-3 control-label">监控单元:</label>
<div class="col-sm-8">

@ -42,6 +42,14 @@
<input type="text" name="alarmmoduleText"/>
</li>
<li>
<label>告警类别:</label>
<select name="alarmcategoryId" th:with="type=${@alarmCategoryService.getParamType()}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.alarmcategoryName}" th:value="${dict.alarmcategoryId}"></option>
</select>
</li>
<li>
<label>是否启用:</label>
<select name="enableFlag" th:with="type=${@dict.getType('enable_flag')}">
@ -130,7 +138,10 @@
{
field: 'alarmmoduleText',
title: '告警单元'
},
},{
field: 'alarmCategoryName',
title: '告警类别'
},
{
field: 'monitorunitName',
title: '智慧场景'

@ -17,6 +17,15 @@
<input name="alarmmoduleText" th:field="*{alarmmoduleText}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">告警类别:</label>
<div class="col-sm-8">
<select name="alarmCategoryId" class="form-control m-b" th:with="type=${@alarmCategoryService.getParamType()}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.alarmcategoryName}" th:value="${dict.alarmcategoryId}" th:field="*{alarmCategoryId}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">智慧场景:</label>
<div class="col-sm-8">

@ -0,0 +1,92 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* base_alarm_category
*
* @author WenJY
* @date 2022-05-03
*/
public class BaseAlarmCategory extends BaseEntity
{
private static final long serialVersionUID = 1L;
public BaseAlarmCategory() {
}
public BaseAlarmCategory(String alarmcategoryId, String alarmcategoryName, Long enableFlag) {
this.alarmcategoryId = alarmcategoryId;
this.alarmcategoryName = alarmcategoryName;
this.enableFlag = enableFlag;
}
/** */
private Long objId;
/** 告警类别编号 */
@Excel(name = "告警类别编号")
private String alarmcategoryId;
/** 告警类别名称 */
@Excel(name = "告警类别名称")
private String alarmcategoryName;
/** 是否启用 */
@Excel(name = "是否启用")
private Long enableFlag;
public void setObjId(Long objId)
{
this.objId = objId;
}
public Long getObjId()
{
return objId;
}
public void setAlarmcategoryId(String alarmcategoryId)
{
this.alarmcategoryId = alarmcategoryId;
}
public String getAlarmcategoryId()
{
return alarmcategoryId;
}
public void setAlarmcategoryName(String alarmcategoryName)
{
this.alarmcategoryName = alarmcategoryName;
}
public String getAlarmcategoryName()
{
return alarmcategoryName;
}
public void setEnableFlag(Long enableFlag)
{
this.enableFlag = enableFlag;
}
public Long getEnableFlag()
{
return enableFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("alarmcategoryId", getAlarmcategoryId())
.append("alarmcategoryName", getAlarmcategoryName())
.append("enableFlag", getEnableFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -39,6 +39,11 @@ public class BaseAlarmModule extends BaseEntity
@Excel(name = "监控单元")
private String monitorunitId;
/** 告警类别 */
private String alarmCategoryId;
private String alarmCategoryName;
/** 报警类型 */
private String alarmTypeId;
@ -164,6 +169,22 @@ public class BaseAlarmModule extends BaseEntity
this.orderFlag = orderFlag;
}
public String getAlarmCategoryId() {
return alarmCategoryId;
}
public void setAlarmCategoryId(String alarmCategoryId) {
this.alarmCategoryId = alarmCategoryId;
}
public String getAlarmCategoryName() {
return alarmCategoryName;
}
public void setAlarmCategoryName(String alarmCategoryName) {
this.alarmCategoryName = alarmCategoryName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BaseAlarmCategory;
/**
* Mapper
*
* @author WenJY
* @date 2022-05-03
*/
public interface BaseAlarmCategoryMapper
{
/**
*
*
* @param objId
* @return
*/
public BaseAlarmCategory selectBaseAlarmCategoryByObjId(Long objId);
/**
*
*
* @param baseAlarmCategory
* @return
*/
public List<BaseAlarmCategory> selectBaseAlarmCategoryList(BaseAlarmCategory baseAlarmCategory);
/**
*
*
* @param baseAlarmCategory
* @return
*/
public int insertBaseAlarmCategory(BaseAlarmCategory baseAlarmCategory);
/**
*
*
* @param baseAlarmCategory
* @return
*/
public int updateBaseAlarmCategory(BaseAlarmCategory baseAlarmCategory);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseAlarmCategoryByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseAlarmCategoryByObjIds(String[] objIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BaseAlarmCategory;
/**
* Service
*
* @author WenJY
* @date 2022-05-03
*/
public interface IBaseAlarmCategoryService
{
/**
*
*
* @param objId
* @return
*/
public BaseAlarmCategory selectBaseAlarmCategoryByObjId(Long objId);
/**
*
*
* @param baseAlarmCategory
* @return
*/
public List<BaseAlarmCategory> selectBaseAlarmCategoryList(BaseAlarmCategory baseAlarmCategory);
/**
*
*
* @param baseAlarmCategory
* @return
*/
public int insertBaseAlarmCategory(BaseAlarmCategory baseAlarmCategory);
/**
*
*
* @param baseAlarmCategory
* @return
*/
public int updateBaseAlarmCategory(BaseAlarmCategory baseAlarmCategory);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseAlarmCategoryByObjIds(String objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseAlarmCategoryByObjId(Long objId);
}

@ -0,0 +1,105 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.BaseAlarmType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseAlarmCategoryMapper;
import com.ruoyi.system.domain.BaseAlarmCategory;
import com.ruoyi.system.service.IBaseAlarmCategoryService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author WenJY
* @date 2022-05-03
*/
@Service("alarmCategoryService")
public class BaseAlarmCategoryServiceImpl implements IBaseAlarmCategoryService
{
@Autowired
private BaseAlarmCategoryMapper baseAlarmCategoryMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public BaseAlarmCategory selectBaseAlarmCategoryByObjId(Long objId)
{
return baseAlarmCategoryMapper.selectBaseAlarmCategoryByObjId(objId);
}
/**
*
*
* @param baseAlarmCategory
* @return
*/
@Override
public List<BaseAlarmCategory> selectBaseAlarmCategoryList(BaseAlarmCategory baseAlarmCategory)
{
return baseAlarmCategoryMapper.selectBaseAlarmCategoryList(baseAlarmCategory);
}
/**
*
*
* @param baseAlarmCategory
* @return
*/
@Override
public int insertBaseAlarmCategory(BaseAlarmCategory baseAlarmCategory)
{
baseAlarmCategory.setCreateTime(DateUtils.getNowDate());
return baseAlarmCategoryMapper.insertBaseAlarmCategory(baseAlarmCategory);
}
/**
*
*
* @param baseAlarmCategory
* @return
*/
@Override
public int updateBaseAlarmCategory(BaseAlarmCategory baseAlarmCategory)
{
baseAlarmCategory.setUpdateTime(DateUtils.getNowDate());
return baseAlarmCategoryMapper.updateBaseAlarmCategory(baseAlarmCategory);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteBaseAlarmCategoryByObjIds(String objIds)
{
return baseAlarmCategoryMapper.deleteBaseAlarmCategoryByObjIds(Convert.toStrArray(objIds));
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteBaseAlarmCategoryByObjId(Long objId)
{
return baseAlarmCategoryMapper.deleteBaseAlarmCategoryByObjId(objId);
}
public List<BaseAlarmCategory> getParamType(){
List<BaseAlarmCategory> baseAlarmCategories = baseAlarmCategoryMapper.selectBaseAlarmCategoryList(new BaseAlarmCategory("", "", 0L));
return baseAlarmCategories;
}
}

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BaseAlarmCategoryMapper">
<resultMap type="BaseAlarmCategory" id="BaseAlarmCategoryResult">
<result property="objId" column="objId" />
<result property="alarmcategoryId" column="AlarmCategory_Id" />
<result property="alarmcategoryName" column="AlarmCategory_Name" />
<result property="enableFlag" column="Enable_Flag" />
<result property="createBy" column="Create_By" />
<result property="createTime" column="Create_Time" />
<result property="updateBy" column="Update_By" />
<result property="updateTime" column="Update_Time" />
</resultMap>
<sql id="selectBaseAlarmCategoryVo">
select objId, AlarmCategory_Id, AlarmCategory_Name, Enable_Flag, Create_By, Create_Time, Update_By, Update_Time from base_alarm_category
</sql>
<select id="selectBaseAlarmCategoryList" parameterType="BaseAlarmCategory" resultMap="BaseAlarmCategoryResult">
<include refid="selectBaseAlarmCategoryVo"/>
<where>
<if test="alarmcategoryId != null and alarmcategoryId != ''"> and AlarmCategory_Id = #{alarmcategoryId}</if>
<if test="alarmcategoryName != null and alarmcategoryName != ''"> and AlarmCategory_Name like concat('%', #{alarmcategoryName}, '%')</if>
<if test="enableFlag != null "> and Enable_Flag = #{enableFlag}</if>
</where>
</select>
<select id="selectBaseAlarmCategoryByObjId" parameterType="Long" resultMap="BaseAlarmCategoryResult">
<include refid="selectBaseAlarmCategoryVo"/>
where objId = #{objId}
</select>
<insert id="insertBaseAlarmCategory" parameterType="BaseAlarmCategory" useGeneratedKeys="true" keyProperty="objId">
insert into base_alarm_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="alarmcategoryId != null">AlarmCategory_Id,</if>
<if test="alarmcategoryName != null">AlarmCategory_Name,</if>
<if test="enableFlag != null">Enable_Flag,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="alarmcategoryId != null">#{alarmcategoryId},</if>
<if test="alarmcategoryName != null">#{alarmcategoryName},</if>
<if test="enableFlag != null">#{enableFlag},</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>
</trim>
</insert>
<update id="updateBaseAlarmCategory" parameterType="BaseAlarmCategory">
update base_alarm_category
<trim prefix="SET" suffixOverrides=",">
<if test="alarmcategoryId != null">AlarmCategory_Id = #{alarmcategoryId},</if>
<if test="alarmcategoryName != null">AlarmCategory_Name = #{alarmcategoryName},</if>
<if test="enableFlag != null">Enable_Flag = #{enableFlag},</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>
</trim>
where objId = #{objId}
</update>
<delete id="deleteBaseAlarmCategoryByObjId" parameterType="Long">
delete from base_alarm_category where objId = #{objId}
</delete>
<delete id="deleteBaseAlarmCategoryByObjIds" parameterType="String">
delete from base_alarm_category where objId in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>

@ -9,6 +9,8 @@
<result property="alarmmoduleId" column="AlarmModule_Id"/>
<result property="alarmmoduleText" column="AlarmModule_Text"/>
<result property="monitorunitId" column="MonitorUnit_Id"/>
<result property="alarmCategoryId" column="AlarmCategory_Id"/>
<result property="alarmCategoryName" column="AlarmCategory_Name"/>
<result property="alarmTypeId" column="AlarmType_Id"/>
<result property="enableFlag" column="Enable_Flag"/>
<result property="orderFlag" column="Order_Flag"/>
@ -23,6 +25,8 @@
<result property="alarmmoduleId" column="AlarmModule_Id"/>
<result property="alarmmoduleText" column="AlarmModule_Text"/>
<result property="monitorunitId" column="MonitorUnit_Id"/>
<result property="alarmCategoryId" column="AlarmCategory_Id"/>
<result property="alarmCategoryName" column="AlarmCategory_Name"/>
<result property="alarmTypeId" column="AlarmType_Id"/>
<result property="alarmTypeName" column="AlarmType_Name"/>
<result property="monitorunitName" column="MonitorUnit_Name"/>
@ -40,6 +44,8 @@
select t1.ObjId,
t1.AlarmModule_Id,
t1.AlarmModule_Text,
t1.AlarmCategory_Id,
t4.AlarmCategory_Name,
t1.MonitorUnit_Id,
t2.MonitorUnitType_Name as MonitorUnit_Name,
t1.AlarmType_Id,
@ -53,6 +59,7 @@
from base_alarm_module t1
left join base_monitorunit_type t2 on t1.MonitorUnit_Id = t2.MonitorUnitType_Id
left join base_alarm_type t3 on t1.AlarmType_Id = t3.alarmType_Id
left join base_alarm_category t4 on t1.AlarmCategory_Id = t4.AlarmCategory_Id
</sql>
@ -60,7 +67,9 @@
<include refid="selectBaseAlarmModuleVo"/>
<where>
<if test="alarmmoduleId != null and alarmmoduleId != ''">and t1.AlarmModule_Id = #{alarmmoduleId}</if>
<if test="alarmmoduleText != null and alarmmoduleText != ''">and t1.AlarmModule_Text like concat('%', #{alarmmoduleText}, '%')</if>
<if test="alarmmoduleText != null and alarmmoduleText != ''">and t1.AlarmModule_Text like concat('%',
#{alarmmoduleText}, '%')
</if>
<if test="monitorunitId != null and monitorunitId != ''">and t1.MonitorUnit_Id = #{monitorunitId}</if>
<if test="alarmTypeId != null and alarmTypeId != ''">and t1.AlarmType_Id = #{alarmTypeId}</if>
<if test="enableFlag != null ">and t1.Enable_Flag = #{enableFlag}</if>
@ -80,6 +89,7 @@
<if test="alarmmoduleId != null">AlarmModule_Id,</if>
<if test="alarmmoduleText != null">AlarmModule_Text,</if>
<if test="monitorunitId != null">MonitorUnit_Id,</if>
<if test="alarmCategoryId != null">AlarmCategory_Id,</if>
<if test="alarmTypeId != null">AlarmType_Id,</if>
<if test="enableFlag != null">Enable_Flag,</if>
<if test="orderFlag != null">Order_Flag,</if>
@ -93,6 +103,7 @@
<if test="alarmmoduleId != null">#{alarmmoduleId},</if>
<if test="alarmmoduleText != null">#{alarmmoduleText},</if>
<if test="monitorunitId != null">#{monitorunitId},</if>
<if test="alarmCategoryId != null">#{alarmCategoryId},</if>
<if test="alarmTypeId != null">#{alarmTypeId},</if>
<if test="enableFlag != null">#{enableFlag},</if>
<if test="orderFlag != null">#{orderFlag},</if>
@ -111,6 +122,7 @@
<if test="monitorunitId != null">MonitorUnit_Id = #{monitorunitId},</if>
<if test="alarmTypeId != null">AlarmType_Id = #{alarmTypeId},</if>
<if test="enableFlag != null">Enable_Flag = #{enableFlag},</if>
<if test="alarmCategoryId != null and alarmCategoryId != ''">AlarmCategory_Id = #{alarmCategoryId},</if>
<if test="orderFlag != null">Order_Flag = #{orderFlag},</if>
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>

Loading…
Cancel
Save