add - 告警類別信息 change - 告警單元添加告警類別關聯
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> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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>
|
@ -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();
|
||||
}
|
||||
}
|
@ -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>
|
Loading…
Reference in New Issue