add - 添加告警单元信息
parent
26089a2727
commit
ed4c787759
@ -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.BaseAlarmModule;
|
||||
import com.ruoyi.system.service.IBaseAlarmModuleService;
|
||||
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-03-26
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/base/alarmModule")
|
||||
public class BaseAlarmModuleController extends BaseController
|
||||
{
|
||||
private String prefix = "base/alarmModule";
|
||||
|
||||
@Autowired
|
||||
private IBaseAlarmModuleService baseAlarmModuleService;
|
||||
|
||||
@RequiresPermissions("base:alarmModule:view")
|
||||
@GetMapping()
|
||||
public String alarmModule()
|
||||
{
|
||||
return prefix + "/alarmModule";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报警信息单元列表
|
||||
*/
|
||||
@RequiresPermissions("base:alarmModule:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BaseAlarmModule baseAlarmModule)
|
||||
{
|
||||
startPage();
|
||||
List<BaseAlarmModule> list = baseAlarmModuleService.selectBaseAlarmModuleList(baseAlarmModule);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报警信息单元列表
|
||||
*/
|
||||
@RequiresPermissions("base:alarmModule:export")
|
||||
@Log(title = "报警信息单元", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BaseAlarmModule baseAlarmModule)
|
||||
{
|
||||
List<BaseAlarmModule> list = baseAlarmModuleService.selectBaseAlarmModuleList(baseAlarmModule);
|
||||
ExcelUtil<BaseAlarmModule> util = new ExcelUtil<BaseAlarmModule>(BaseAlarmModule.class);
|
||||
return util.exportExcel(list, "报警信息单元数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警信息单元
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存报警信息单元
|
||||
*/
|
||||
@RequiresPermissions("base:alarmModule:add")
|
||||
@Log(title = "报警信息单元", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BaseAlarmModule baseAlarmModule)
|
||||
{
|
||||
baseAlarmModule.setAlarmmoduleId(UUID.randomUUID().toString());
|
||||
baseAlarmModule.setCreatedBy(ShiroUtils.getLoginName());
|
||||
baseAlarmModule.setCreatedTime(new Date());
|
||||
return toAjax(baseAlarmModuleService.insertBaseAlarmModule(baseAlarmModule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警信息单元
|
||||
*/
|
||||
@GetMapping("/edit/{objId}")
|
||||
public String edit(@PathVariable("objId") String objId, ModelMap mmap)
|
||||
{
|
||||
BaseAlarmModule baseAlarmModule = baseAlarmModuleService.selectBaseAlarmModuleByObjId(objId);
|
||||
mmap.put("baseAlarmModule", baseAlarmModule);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存报警信息单元
|
||||
*/
|
||||
@RequiresPermissions("base:alarmModule:edit")
|
||||
@Log(title = "报警信息单元", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BaseAlarmModule baseAlarmModule)
|
||||
{
|
||||
baseAlarmModule.setUpdatedBy(ShiroUtils.getLoginName());
|
||||
baseAlarmModule.setUpdatedTime(new Date());
|
||||
return toAjax(baseAlarmModuleService.updateBaseAlarmModule(baseAlarmModule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警信息单元
|
||||
*/
|
||||
@RequiresPermissions("base:alarmModule:remove")
|
||||
@Log(title = "报警信息单元", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(baseAlarmModuleService.deleteBaseAlarmModuleByObjIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增报警信息单元')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-alarmModule-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">告警单元:</label>
|
||||
<div class="col-sm-8">
|
||||
<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">
|
||||
<input name="monitorunitId" 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" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "base/alarmModule"
|
||||
$("#form-alarmModule-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-alarmModule-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='createdTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("input[name='updatedTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,129 @@
|
||||
<!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="alarmmoduleText"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>监控单元:</label>
|
||||
<input type="text" name="monitorunitId"/>
|
||||
</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:alarmModule:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="base:alarmModule:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="base:alarmModule:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:alarmModule: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:alarmModule:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('base:alarmModule:remove')}]];
|
||||
var enableFlagDatas = [[${@dict.getType('enable_flag')}]];
|
||||
var prefix = ctx + "base/alarmModule";
|
||||
|
||||
$(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: 'alarmmoduleText',
|
||||
title: '告警单元'
|
||||
},
|
||||
{
|
||||
field: 'alarmTypeId',
|
||||
title: '报警类型'
|
||||
},
|
||||
{
|
||||
field: 'monitorunitId',
|
||||
title: '监控单元'
|
||||
},
|
||||
{
|
||||
field: 'enableFlag',
|
||||
title: '是否启用',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(enableFlagDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createdBy',
|
||||
title: '创建人'
|
||||
},
|
||||
{
|
||||
field: 'createdTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
field: 'updatedBy',
|
||||
title: '更新人'
|
||||
},
|
||||
{
|
||||
field: 'updatedTime',
|
||||
title: '更新时间'
|
||||
},
|
||||
{
|
||||
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,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改报警信息单元')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-alarmModule-edit" th:object="${baseAlarmModule}">
|
||||
<input name="objId" th:field="*{objId}" type="hidden">
|
||||
<input name="alarmmoduleId" th:field="*{alarmmoduleId}" type="hidden">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">告警单元:</label>
|
||||
<div class="col-sm-8">
|
||||
<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">
|
||||
<input name="monitorunitId" th:field="*{monitorunitId}" 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" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "base/alarmModule";
|
||||
$("#form-alarmModule-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-alarmModule-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='createdTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("input[name='updatedTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,164 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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_module
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
public class BaseAlarmModule extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键标识 */
|
||||
private String objId;
|
||||
|
||||
/** 单元编号 */
|
||||
@Excel(name = "单元编号")
|
||||
private String alarmmoduleId;
|
||||
|
||||
/** 告警单元 */
|
||||
@Excel(name = "告警单元")
|
||||
private String alarmmoduleText;
|
||||
|
||||
/** 监控单元 */
|
||||
@Excel(name = "监控单元")
|
||||
private String monitorunitId;
|
||||
|
||||
/** 报警类型 */
|
||||
private String alarmTypeId;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private Long enableFlag;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdTime;
|
||||
|
||||
/** 更新人 */
|
||||
@Excel(name = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedTime;
|
||||
|
||||
public void setObjId(String objId)
|
||||
{
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public String getObjId()
|
||||
{
|
||||
return objId;
|
||||
}
|
||||
public void setAlarmmoduleId(String alarmmoduleId)
|
||||
{
|
||||
this.alarmmoduleId = alarmmoduleId;
|
||||
}
|
||||
|
||||
public String getAlarmmoduleId()
|
||||
{
|
||||
return alarmmoduleId;
|
||||
}
|
||||
public void setAlarmmoduleText(String alarmmoduleText)
|
||||
{
|
||||
this.alarmmoduleText = alarmmoduleText;
|
||||
}
|
||||
|
||||
public String getAlarmmoduleText()
|
||||
{
|
||||
return alarmmoduleText;
|
||||
}
|
||||
public void setMonitorunitId(String monitorunitId)
|
||||
{
|
||||
this.monitorunitId = monitorunitId;
|
||||
}
|
||||
|
||||
public String getMonitorunitId()
|
||||
{
|
||||
return monitorunitId;
|
||||
}
|
||||
public void setEnableFlag(Long enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public Long getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setCreatedBy(String createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setCreatedTime(Date createdTime)
|
||||
{
|
||||
this.createdTime = createdTime;
|
||||
}
|
||||
|
||||
public Date getCreatedTime()
|
||||
{
|
||||
return createdTime;
|
||||
}
|
||||
public void setUpdatedBy(String updatedBy)
|
||||
{
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getUpdatedBy()
|
||||
{
|
||||
return updatedBy;
|
||||
}
|
||||
public void setUpdatedTime(Date updatedTime)
|
||||
{
|
||||
this.updatedTime = updatedTime;
|
||||
}
|
||||
|
||||
public Date getUpdatedTime()
|
||||
{
|
||||
return updatedTime;
|
||||
}
|
||||
|
||||
public String getAlarmTypeId() {
|
||||
return alarmTypeId;
|
||||
}
|
||||
|
||||
public void setAlarmTypeId(String alarmTypeId) {
|
||||
this.alarmTypeId = alarmTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId", getObjId())
|
||||
.append("alarmmoduleId", getAlarmmoduleId())
|
||||
.append("alarmmoduleText", getAlarmmoduleText())
|
||||
.append("monitorunitId", getMonitorunitId())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("createdTime", getCreatedTime())
|
||||
.append("updatedBy", getUpdatedBy())
|
||||
.append("updatedTime", getUpdatedTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseAlarmModule;
|
||||
|
||||
/**
|
||||
* 报警信息单元Mapper接口
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
public interface BaseAlarmModuleMapper
|
||||
{
|
||||
/**
|
||||
* 查询报警信息单元
|
||||
*
|
||||
* @param objId 报警信息单元主键
|
||||
* @return 报警信息单元
|
||||
*/
|
||||
public BaseAlarmModule selectBaseAlarmModuleByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 查询报警信息单元列表
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 报警信息单元集合
|
||||
*/
|
||||
public List<BaseAlarmModule> selectBaseAlarmModuleList(BaseAlarmModule baseAlarmModule);
|
||||
|
||||
/**
|
||||
* 新增报警信息单元
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseAlarmModule(BaseAlarmModule baseAlarmModule);
|
||||
|
||||
/**
|
||||
* 修改报警信息单元
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseAlarmModule(BaseAlarmModule baseAlarmModule);
|
||||
|
||||
/**
|
||||
* 删除报警信息单元
|
||||
*
|
||||
* @param objId 报警信息单元主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseAlarmModuleByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 批量删除报警信息单元
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseAlarmModuleByObjIds(String[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseAlarmModule;
|
||||
|
||||
/**
|
||||
* 报警信息单元Service接口
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
public interface IBaseAlarmModuleService
|
||||
{
|
||||
/**
|
||||
* 查询报警信息单元
|
||||
*
|
||||
* @param objId 报警信息单元主键
|
||||
* @return 报警信息单元
|
||||
*/
|
||||
public BaseAlarmModule selectBaseAlarmModuleByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 查询报警信息单元列表
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 报警信息单元集合
|
||||
*/
|
||||
public List<BaseAlarmModule> selectBaseAlarmModuleList(BaseAlarmModule baseAlarmModule);
|
||||
|
||||
/**
|
||||
* 新增报警信息单元
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseAlarmModule(BaseAlarmModule baseAlarmModule);
|
||||
|
||||
/**
|
||||
* 修改报警信息单元
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseAlarmModule(BaseAlarmModule baseAlarmModule);
|
||||
|
||||
/**
|
||||
* 批量删除报警信息单元
|
||||
*
|
||||
* @param objIds 需要删除的报警信息单元主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseAlarmModuleByObjIds(String objIds);
|
||||
|
||||
/**
|
||||
* 删除报警信息单元信息
|
||||
*
|
||||
* @param objId 报警信息单元主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseAlarmModuleByObjId(String objId);
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BaseAlarmModuleMapper;
|
||||
import com.ruoyi.system.domain.BaseAlarmModule;
|
||||
import com.ruoyi.system.service.IBaseAlarmModuleService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 报警信息单元Service业务层处理
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
@Service
|
||||
public class BaseAlarmModuleServiceImpl implements IBaseAlarmModuleService
|
||||
{
|
||||
@Autowired
|
||||
private BaseAlarmModuleMapper baseAlarmModuleMapper;
|
||||
|
||||
/**
|
||||
* 查询报警信息单元
|
||||
*
|
||||
* @param objId 报警信息单元主键
|
||||
* @return 报警信息单元
|
||||
*/
|
||||
@Override
|
||||
public BaseAlarmModule selectBaseAlarmModuleByObjId(String objId)
|
||||
{
|
||||
return baseAlarmModuleMapper.selectBaseAlarmModuleByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报警信息单元列表
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 报警信息单元
|
||||
*/
|
||||
@Override
|
||||
public List<BaseAlarmModule> selectBaseAlarmModuleList(BaseAlarmModule baseAlarmModule)
|
||||
{
|
||||
return baseAlarmModuleMapper.selectBaseAlarmModuleList(baseAlarmModule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警信息单元
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseAlarmModule(BaseAlarmModule baseAlarmModule)
|
||||
{
|
||||
return baseAlarmModuleMapper.insertBaseAlarmModule(baseAlarmModule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警信息单元
|
||||
*
|
||||
* @param baseAlarmModule 报警信息单元
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseAlarmModule(BaseAlarmModule baseAlarmModule)
|
||||
{
|
||||
return baseAlarmModuleMapper.updateBaseAlarmModule(baseAlarmModule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除报警信息单元
|
||||
*
|
||||
* @param objIds 需要删除的报警信息单元主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseAlarmModuleByObjIds(String objIds)
|
||||
{
|
||||
return baseAlarmModuleMapper.deleteBaseAlarmModuleByObjIds(Convert.toStrArray(objIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警信息单元信息
|
||||
*
|
||||
* @param objId 报警信息单元主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseAlarmModuleByObjId(String objId)
|
||||
{
|
||||
return baseAlarmModuleMapper.deleteBaseAlarmModuleByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
<?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.BaseAlarmModuleMapper">
|
||||
|
||||
<resultMap type="BaseAlarmModule" id="BaseAlarmModuleResult">
|
||||
<result property="objId" column="ObjId" />
|
||||
<result property="alarmmoduleId" column="AlarmModule_Id" />
|
||||
<result property="alarmmoduleText" column="AlarmModule_Text" />
|
||||
<result property="monitorunitId" column="MonitorUnit_Id" />
|
||||
<result property="alarmTypeId" column="AlarmType_Id" />
|
||||
<result property="enableFlag" column="Enable_Flag" />
|
||||
<result property="createdBy" column="CREATED_BY" />
|
||||
<result property="createdTime" column="CREATED_TIME" />
|
||||
<result property="updatedBy" column="UPDATED_BY" />
|
||||
<result property="updatedTime" column="UPDATED_TIME" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseAlarmModuleVo">
|
||||
select ObjId, AlarmModule_Id, AlarmModule_Text, MonitorUnit_Id,AlarmType_Id, Enable_Flag, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME from base_alarm_module
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseAlarmModuleList" parameterType="BaseAlarmModule" resultMap="BaseAlarmModuleResult">
|
||||
<include refid="selectBaseAlarmModuleVo"/>
|
||||
<where>
|
||||
<if test="alarmmoduleId != null and alarmmoduleId != ''"> and AlarmModule_Id = #{alarmmoduleId}</if>
|
||||
<if test="alarmmoduleText != null and alarmmoduleText != ''"> and AlarmModule_Text = #{alarmmoduleText}</if>
|
||||
<if test="monitorunitId != null and monitorunitId != ''"> and MonitorUnit_Id = #{monitorunitId}</if>
|
||||
<if test="alarmTypeId != null and alarmTypeId != ''"> and AlarmType_Id = #{alarmTypeId}</if>
|
||||
<if test="enableFlag != null "> and Enable_Flag = #{enableFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseAlarmModuleByObjId" parameterType="String" resultMap="BaseAlarmModuleResult">
|
||||
<include refid="selectBaseAlarmModuleVo"/>
|
||||
where ObjId = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseAlarmModule" parameterType="BaseAlarmModule">
|
||||
insert into base_alarm_module
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">ObjId,</if>
|
||||
<if test="alarmmoduleId != null">AlarmModule_Id,</if>
|
||||
<if test="alarmmoduleText != null">AlarmModule_Text,</if>
|
||||
<if test="monitorunitId != null">MonitorUnit_Id,</if>
|
||||
<if test="alarmTypeId != null">AlarmType_Id,</if>
|
||||
<if test="enableFlag != null">Enable_Flag,</if>
|
||||
<if test="createdBy != null">CREATED_BY,</if>
|
||||
<if test="createdTime != null">CREATED_TIME,</if>
|
||||
<if test="updatedBy != null">UPDATED_BY,</if>
|
||||
<if test="updatedTime != null">UPDATED_TIME,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">#{objId},</if>
|
||||
<if test="alarmmoduleId != null">#{alarmmoduleId},</if>
|
||||
<if test="alarmmoduleText != null">#{alarmmoduleText},</if>
|
||||
<if test="monitorunitId != null">#{monitorunitId},</if>
|
||||
<if test="alarmTypeId != null">#{alarmTypeId},</if>
|
||||
<if test="enableFlag != null">#{enableFlag},</if>
|
||||
<if test="createdBy != null">#{createdBy},</if>
|
||||
<if test="createdTime != null">#{createdTime},</if>
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="updatedTime != null">#{updatedTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseAlarmModule" parameterType="BaseAlarmModule">
|
||||
update base_alarm_module
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="alarmmoduleId != null">AlarmModule_Id = #{alarmmoduleId},</if>
|
||||
<if test="alarmmoduleText != null">AlarmModule_Text = #{alarmmoduleText},</if>
|
||||
<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="createdBy != null">CREATED_BY = #{createdBy},</if>
|
||||
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
|
||||
<if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
|
||||
<if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
|
||||
</trim>
|
||||
where ObjId = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseAlarmModuleByObjId" parameterType="String">
|
||||
delete from base_alarm_module where ObjId = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseAlarmModuleByObjIds" parameterType="String">
|
||||
delete from base_alarm_module where ObjId in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue