add - 能源测控点信息
parent
7b085f75c6
commit
d38cd81bb6
@ -0,0 +1,154 @@
|
||||
package com.ruoyi.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
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.BaseMonitorInfo;
|
||||
import com.ruoyi.system.service.IBaseMonitorInfoService;
|
||||
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.utils.StringUtils;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
|
||||
/**
|
||||
* 测控点信息Controller
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2021-11-25
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/ems/monitorInfo")
|
||||
public class BaseMonitorInfoController extends BaseController
|
||||
{
|
||||
private String prefix = "ems/monitorInfo";
|
||||
|
||||
@Autowired
|
||||
private IBaseMonitorInfoService baseMonitorInfoService;
|
||||
|
||||
@RequiresPermissions("ems:monitorInfo:view")
|
||||
@GetMapping()
|
||||
public String monitorInfo()
|
||||
{
|
||||
return prefix + "/monitorInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询测控点信息树列表
|
||||
*/
|
||||
@RequiresPermissions("ems:monitorInfo:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public List<BaseMonitorInfo> list(BaseMonitorInfo baseMonitorInfo)
|
||||
{
|
||||
List<BaseMonitorInfo> list = baseMonitorInfoService.selectBaseMonitorInfoList(baseMonitorInfo);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出测控点信息列表
|
||||
*/
|
||||
@RequiresPermissions("ems:monitorInfo:export")
|
||||
@Log(title = "测控点信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BaseMonitorInfo baseMonitorInfo)
|
||||
{
|
||||
List<BaseMonitorInfo> list = baseMonitorInfoService.selectBaseMonitorInfoList(baseMonitorInfo);
|
||||
ExcelUtil<BaseMonitorInfo> util = new ExcelUtil<BaseMonitorInfo>(BaseMonitorInfo.class);
|
||||
return util.exportExcel(list, "测控点信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测控点信息
|
||||
*/
|
||||
@GetMapping(value = { "/add/{objid}", "/add/" })
|
||||
public String add(@PathVariable(value = "objid", required = false) Long objid, ModelMap mmap)
|
||||
{
|
||||
if (StringUtils.isNotNull(objid))
|
||||
{
|
||||
mmap.put("baseMonitorInfo", baseMonitorInfoService.selectBaseMonitorInfoByObjid(objid));
|
||||
}
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存测控点信息
|
||||
*/
|
||||
@RequiresPermissions("ems:monitorInfo:add")
|
||||
@Log(title = "测控点信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BaseMonitorInfo baseMonitorInfo)
|
||||
{
|
||||
return toAjax(baseMonitorInfoService.insertBaseMonitorInfo(baseMonitorInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测控点信息
|
||||
*/
|
||||
@GetMapping("/edit/{objid}")
|
||||
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
|
||||
{
|
||||
BaseMonitorInfo baseMonitorInfo = baseMonitorInfoService.selectBaseMonitorInfoByObjid(objid);
|
||||
mmap.put("baseMonitorInfo", baseMonitorInfo);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存测控点信息
|
||||
*/
|
||||
@RequiresPermissions("ems:monitorInfo:edit")
|
||||
@Log(title = "测控点信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BaseMonitorInfo baseMonitorInfo)
|
||||
{
|
||||
return toAjax(baseMonitorInfoService.updateBaseMonitorInfo(baseMonitorInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequiresPermissions("ems:monitorInfo:remove")
|
||||
@Log(title = "测控点信息", businessType = BusinessType.DELETE)
|
||||
@GetMapping("/remove/{objid}")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(@PathVariable("objid") Long objid)
|
||||
{
|
||||
return toAjax(baseMonitorInfoService.deleteBaseMonitorInfoByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择测控点信息树
|
||||
*/
|
||||
@GetMapping(value = { "/selectMonitorInfoTree/{objid}", "/selectMonitorInfoTree/" })
|
||||
public String selectMonitorInfoTree(@PathVariable(value = "objid", required = false) Long objid, ModelMap mmap)
|
||||
{
|
||||
if (StringUtils.isNotNull(objid))
|
||||
{
|
||||
mmap.put("baseMonitorInfo", baseMonitorInfoService.selectBaseMonitorInfoByObjid(objid));
|
||||
}
|
||||
return prefix + "/tree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载测控点信息树列表
|
||||
*/
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> treeData()
|
||||
{
|
||||
List<Ztree> ztrees = baseMonitorInfoService.selectBaseMonitorInfoTree();
|
||||
return ztrees;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.web.controller.scada;
|
||||
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author WenJY
|
||||
* @date 2021年11月25日 15:13
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/Scada/Foamer")
|
||||
public class FoamerController {
|
||||
|
||||
@GetMapping("/ProductionPlan")
|
||||
public String ProductionPlan(HttpServletRequest req, HttpServletResponse resp) {
|
||||
String url = "http://10.100.71.101:8012/system/Foamer?id=1";
|
||||
return "redirect:"+url;
|
||||
}
|
||||
|
||||
@GetMapping("/DeviceInfo")
|
||||
public String DeviceInfo(HttpServletRequest req, HttpServletResponse resp) {
|
||||
String url = "http://10.100.71.101:8012/system/Foamer?id=2";
|
||||
return "redirect:"+url;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.web.controller.scada;
|
||||
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author WenJY
|
||||
* @date 2021年11月25日 15:25
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/Scada/SouthWareHouse")
|
||||
public class SouthWareHouseController {
|
||||
|
||||
@GetMapping("/Index")
|
||||
public String Index(HttpServletRequest req, HttpServletResponse resp) {
|
||||
String url = "http://10.100.71.101:8012/system/SouthWareHouse";
|
||||
return "redirect:"+url;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.web.controller.scada;
|
||||
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author WenJY
|
||||
* @date 2021年11月25日 15:22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/Scada/UShellMetalPlate")
|
||||
public class UShellMetalPlateController {
|
||||
|
||||
@GetMapping("/ProductionPlan")
|
||||
public String ProductionPlan(HttpServletRequest req, HttpServletResponse resp) {
|
||||
String url = "http://10.100.71.101:8012/system/UShellMetalPlate?id=1";
|
||||
return "redirect:"+url;
|
||||
}
|
||||
|
||||
@GetMapping("/DeviceInfo")
|
||||
public String DeviceInfo(HttpServletRequest req, HttpServletResponse resp) {
|
||||
String url = "http://10.100.71.101:8012/system/UShellMetalPlate?id=2";
|
||||
return "redirect:"+url;
|
||||
}
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
<!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="monitorId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>父级编号:</label>
|
||||
<input type="text" name="pMonitorId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>测控点名称:</label>
|
||||
<input type="text" name="monitorName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>测控点类型:</label>
|
||||
<select name="monitorType">
|
||||
<option value="">所有</option>
|
||||
<option value="-1">代码生成请选择字典属性</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>测控点位置:</label>
|
||||
<input type="text" name="monitorAddr"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>测控点状态:</label>
|
||||
<select name="monitorStatus" th:with="type=${@dict.getType('monitorType')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>记录时间:</label>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginRecordTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endRecordTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.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="ems:monitorInfo:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="ems:monitorInfo:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-info" id="expandAllBtn">
|
||||
<i class="fa fa-exchange"></i> 展开/折叠
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-tree-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var addFlag = [[${@permission.hasPermi('ems:monitorInfo:add')}]];
|
||||
var editFlag = [[${@permission.hasPermi('ems:monitorInfo:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('ems:monitorInfo:remove')}]];
|
||||
var monitorStatusDatas = [[${@dict.getType('monitorType')}]];
|
||||
var prefix = ctx + "ems/monitorInfo";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
code: "monitorId",
|
||||
parentCode: "pMonitorId",
|
||||
expandColumn: "4",
|
||||
uniqueId: "objid",
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add/{id}",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove/{id}",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "测控点信息",
|
||||
columns: [{
|
||||
field: 'selectItem',
|
||||
radio: true
|
||||
},
|
||||
{
|
||||
field: 'objid',
|
||||
title: '编号',
|
||||
align: 'left',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'monitorId',
|
||||
title: '测控点编号',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'pMonitorId',
|
||||
title: '父级编号',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'monitorName',
|
||||
title: '测控点名称',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'monitorType',
|
||||
title: '测控点类型',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'monitorAddr',
|
||||
title: '测控点位置',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'monitorStatus',
|
||||
title: '测控点状态',
|
||||
align: 'left',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(monitorStatusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'recordTime',
|
||||
title: '记录时间',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
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-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.objid + '\')"><i class="fa fa-plus"></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('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.treeTable.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('测控点信息树选择')" />
|
||||
<th:block th:include="include :: ztree-css" />
|
||||
</head>
|
||||
<style>
|
||||
body{height:auto;font-family: "Microsoft YaHei";}
|
||||
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
|
||||
</style>
|
||||
<body class="hold-transition box box-main">
|
||||
<input id="treeId" name="treeId" type="hidden" th:value="${baseMonitorInfo?.monitorId}"/>
|
||||
<input id="treeName" name="treeName" type="hidden" th:value="${baseMonitorInfo?.monitorName}"/>
|
||||
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||
</div>
|
||||
<div class="treeSearchInput" id="search">
|
||||
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
|
||||
</div>
|
||||
<div class="treeExpandCollapse">
|
||||
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||
</div>
|
||||
<div id="tree" class="ztree treeselect"></div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: ztree-js" />
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
var url = ctx + "ems/monitorInfo/treeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
});
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
var treeId = treeNode.id;
|
||||
var treeName = treeNode.name;
|
||||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,191 @@
|
||||
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.TreeEntity;
|
||||
|
||||
/**
|
||||
* 测控点信息对象 base_monitor_info
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2021-11-25
|
||||
*/
|
||||
public class BaseMonitorInfo extends TreeEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long objid;
|
||||
|
||||
/** 测控点编号 */
|
||||
@Excel(name = "测控点编号")
|
||||
private String monitorId;
|
||||
|
||||
/** 父级编号 */
|
||||
@Excel(name = "父级编号")
|
||||
private String pMonitorId;
|
||||
|
||||
/** 测控点名称 */
|
||||
@Excel(name = "测控点名称")
|
||||
private String monitorName;
|
||||
|
||||
/** 测控点类型 */
|
||||
@Excel(name = "测控点类型")
|
||||
private Long monitorType;
|
||||
|
||||
/** 测控点位置 */
|
||||
@Excel(name = "测控点位置")
|
||||
private String monitorAddr;
|
||||
|
||||
/** 测控点状态 */
|
||||
@Excel(name = "测控点状态")
|
||||
private Long monitorStatus;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long correctValue;
|
||||
|
||||
/** PT值 */
|
||||
private Long pt;
|
||||
|
||||
/** CT值 */
|
||||
private Long ct;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long grade;
|
||||
|
||||
/** 记录时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date recordTime;
|
||||
|
||||
public void setObjid(Long objid)
|
||||
{
|
||||
this.objid = objid;
|
||||
}
|
||||
|
||||
public Long getObjid()
|
||||
{
|
||||
return objid;
|
||||
}
|
||||
public void setMonitorId(String monitorId)
|
||||
{
|
||||
this.monitorId = monitorId;
|
||||
}
|
||||
|
||||
public String getMonitorId()
|
||||
{
|
||||
return monitorId;
|
||||
}
|
||||
public void setpMonitorId(String pMonitorId)
|
||||
{
|
||||
this.pMonitorId = pMonitorId;
|
||||
}
|
||||
|
||||
public String getpMonitorId()
|
||||
{
|
||||
return pMonitorId;
|
||||
}
|
||||
public void setMonitorName(String monitorName)
|
||||
{
|
||||
this.monitorName = monitorName;
|
||||
}
|
||||
|
||||
public String getMonitorName()
|
||||
{
|
||||
return monitorName;
|
||||
}
|
||||
public void setMonitorType(Long monitorType)
|
||||
{
|
||||
this.monitorType = monitorType;
|
||||
}
|
||||
|
||||
public Long getMonitorType()
|
||||
{
|
||||
return monitorType;
|
||||
}
|
||||
public void setMonitorAddr(String monitorAddr)
|
||||
{
|
||||
this.monitorAddr = monitorAddr;
|
||||
}
|
||||
|
||||
public String getMonitorAddr()
|
||||
{
|
||||
return monitorAddr;
|
||||
}
|
||||
public void setMonitorStatus(Long monitorStatus)
|
||||
{
|
||||
this.monitorStatus = monitorStatus;
|
||||
}
|
||||
|
||||
public Long getMonitorStatus()
|
||||
{
|
||||
return monitorStatus;
|
||||
}
|
||||
public void setCorrectValue(Long correctValue)
|
||||
{
|
||||
this.correctValue = correctValue;
|
||||
}
|
||||
|
||||
public Long getCorrectValue()
|
||||
{
|
||||
return correctValue;
|
||||
}
|
||||
public void setPt(Long pt)
|
||||
{
|
||||
this.pt = pt;
|
||||
}
|
||||
|
||||
public Long getPt()
|
||||
{
|
||||
return pt;
|
||||
}
|
||||
public void setCt(Long ct)
|
||||
{
|
||||
this.ct = ct;
|
||||
}
|
||||
|
||||
public Long getCt()
|
||||
{
|
||||
return ct;
|
||||
}
|
||||
public void setGrade(Long grade)
|
||||
{
|
||||
this.grade = grade;
|
||||
}
|
||||
|
||||
public Long getGrade()
|
||||
{
|
||||
return grade;
|
||||
}
|
||||
public void setRecordTime(Date recordTime)
|
||||
{
|
||||
this.recordTime = recordTime;
|
||||
}
|
||||
|
||||
public Date getRecordTime()
|
||||
{
|
||||
return recordTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objid", getObjid())
|
||||
.append("monitorId", getMonitorId())
|
||||
.append("pMonitorId", getpMonitorId())
|
||||
.append("monitorName", getMonitorName())
|
||||
.append("monitorType", getMonitorType())
|
||||
.append("monitorAddr", getMonitorAddr())
|
||||
.append("monitorStatus", getMonitorStatus())
|
||||
.append("correctValue", getCorrectValue())
|
||||
.append("pt", getPt())
|
||||
.append("ct", getCt())
|
||||
.append("grade", getGrade())
|
||||
.append("recordTime", getRecordTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseMonitorInfo;
|
||||
|
||||
/**
|
||||
* 测控点信息Mapper接口
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2021-11-25
|
||||
*/
|
||||
public interface BaseMonitorInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询测控点信息
|
||||
*
|
||||
* @param objid 测控点信息主键
|
||||
* @return 测控点信息
|
||||
*/
|
||||
public BaseMonitorInfo selectBaseMonitorInfoByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询测控点信息列表
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 测控点信息集合
|
||||
*/
|
||||
public List<BaseMonitorInfo> selectBaseMonitorInfoList(BaseMonitorInfo baseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 新增测控点信息
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 修改测控点信息
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 删除测控点信息
|
||||
*
|
||||
* @param objid 测控点信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorInfoByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 批量删除测控点信息
|
||||
*
|
||||
* @param objids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorInfoByObjids(String[] objids);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseMonitorInfo;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
|
||||
/**
|
||||
* 测控点信息Service接口
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2021-11-25
|
||||
*/
|
||||
public interface IBaseMonitorInfoService
|
||||
{
|
||||
/**
|
||||
* 查询测控点信息
|
||||
*
|
||||
* @param objid 测控点信息主键
|
||||
* @return 测控点信息
|
||||
*/
|
||||
public BaseMonitorInfo selectBaseMonitorInfoByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询测控点信息列表
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 测控点信息集合
|
||||
*/
|
||||
public List<BaseMonitorInfo> selectBaseMonitorInfoList(BaseMonitorInfo baseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 新增测控点信息
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 修改测控点信息
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 批量删除测控点信息
|
||||
*
|
||||
* @param objids 需要删除的测控点信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorInfoByObjids(String objids);
|
||||
|
||||
/**
|
||||
* 删除测控点信息信息
|
||||
*
|
||||
* @param objid 测控点信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorInfoByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询测控点信息树列表
|
||||
*
|
||||
* @return 所有测控点信息信息
|
||||
*/
|
||||
public List<Ztree> selectBaseMonitorInfoTree();
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BaseMonitorInfoMapper;
|
||||
import com.ruoyi.system.domain.BaseMonitorInfo;
|
||||
import com.ruoyi.system.service.IBaseMonitorInfoService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 测控点信息Service业务层处理
|
||||
*
|
||||
* @author WenJY
|
||||
* @date 2021-11-25
|
||||
*/
|
||||
@Service
|
||||
public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
|
||||
{
|
||||
@Autowired
|
||||
private BaseMonitorInfoMapper baseMonitorInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询测控点信息
|
||||
*
|
||||
* @param objid 测控点信息主键
|
||||
* @return 测控点信息
|
||||
*/
|
||||
@Override
|
||||
public BaseMonitorInfo selectBaseMonitorInfoByObjid(Long objid)
|
||||
{
|
||||
return baseMonitorInfoMapper.selectBaseMonitorInfoByObjid(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询测控点信息列表
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 测控点信息
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMonitorInfo> selectBaseMonitorInfoList(BaseMonitorInfo baseMonitorInfo)
|
||||
{
|
||||
return baseMonitorInfoMapper.selectBaseMonitorInfoList(baseMonitorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测控点信息
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo)
|
||||
{
|
||||
return baseMonitorInfoMapper.insertBaseMonitorInfo(baseMonitorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测控点信息
|
||||
*
|
||||
* @param baseMonitorInfo 测控点信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo)
|
||||
{
|
||||
return baseMonitorInfoMapper.updateBaseMonitorInfo(baseMonitorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除测控点信息
|
||||
*
|
||||
* @param objids 需要删除的测控点信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseMonitorInfoByObjids(String objids)
|
||||
{
|
||||
return baseMonitorInfoMapper.deleteBaseMonitorInfoByObjids(Convert.toStrArray(objids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测控点信息信息
|
||||
*
|
||||
* @param objid 测控点信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseMonitorInfoByObjid(Long objid)
|
||||
{
|
||||
return baseMonitorInfoMapper.deleteBaseMonitorInfoByObjid(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询测控点信息树列表
|
||||
*
|
||||
* @return 所有测控点信息信息
|
||||
*/
|
||||
@Override
|
||||
public List<Ztree> selectBaseMonitorInfoTree()
|
||||
{
|
||||
List<BaseMonitorInfo> baseMonitorInfoList = baseMonitorInfoMapper.selectBaseMonitorInfoList(new BaseMonitorInfo());
|
||||
List<Ztree> ztrees = new ArrayList<Ztree>();
|
||||
for (BaseMonitorInfo baseMonitorInfo : baseMonitorInfoList)
|
||||
{
|
||||
Ztree ztree = new Ztree();
|
||||
ztree.setId(baseMonitorInfo.getMonitorId());
|
||||
ztree.setpId(baseMonitorInfo.getpMonitorId());
|
||||
ztree.setName(baseMonitorInfo.getMonitorName());
|
||||
ztree.setTitle(baseMonitorInfo.getMonitorName());
|
||||
ztrees.add(ztree);
|
||||
}
|
||||
return ztrees;
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
<?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.BaseMonitorInfoMapper">
|
||||
|
||||
<resultMap type="BaseMonitorInfo" id="BaseMonitorInfoResult">
|
||||
<result property="objid" column="objid" />
|
||||
<result property="monitorId" column="monitor_id" />
|
||||
<result property="pMonitorId" column="p_monitor_id" />
|
||||
<result property="monitorName" column="monitor_name" />
|
||||
<result property="monitorType" column="monitor_type" />
|
||||
<result property="monitorAddr" column="monitor_addr" />
|
||||
<result property="monitorStatus" column="monitor_status" />
|
||||
<result property="correctValue" column="correct_value" />
|
||||
<result property="pt" column="pt" />
|
||||
<result property="ct" column="ct" />
|
||||
<result property="grade" column="grade" />
|
||||
<result property="recordTime" column="record_time" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseMonitorInfoVo">
|
||||
select objid, monitor_id, p_monitor_id, monitor_name, monitor_type, monitor_addr, monitor_status, correct_value, pt, ct, grade, record_time from base_monitor_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseMonitorInfoList" parameterType="BaseMonitorInfo" resultMap="BaseMonitorInfoResult">
|
||||
<include refid="selectBaseMonitorInfoVo"/>
|
||||
<where>
|
||||
<if test="monitorId != null and monitorId != ''"> and monitor_id = #{monitorId}</if>
|
||||
<if test="pMonitorId != null and pMonitorId != ''"> and p_monitor_id = #{pMonitorId}</if>
|
||||
<if test="monitorName != null and monitorName != ''"> and monitor_name like concat(concat('%', #{monitorName}), '%')</if>
|
||||
<if test="monitorType != null "> and monitor_type = #{monitorType}</if>
|
||||
<if test="monitorAddr != null and monitorAddr != ''"> and monitor_addr = #{monitorAddr}</if>
|
||||
<if test="monitorStatus != null "> and monitor_status = #{monitorStatus}</if>
|
||||
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''"> and record_time between #{params.beginRecordTime} and #{params.endRecordTime}</if>
|
||||
</where>
|
||||
order by p_monitor_id
|
||||
</select>
|
||||
|
||||
<select id="selectBaseMonitorInfoByObjid" parameterType="Long" resultMap="BaseMonitorInfoResult">
|
||||
select t.objid, t.monitor_id, t.p_monitor_id, t.monitor_name, t.monitor_type, t.monitor_addr, t.monitor_status, t.correct_value, t.pt, t.ct, t.grade, t.record_time, p.monitor_name as parent_name
|
||||
from base_monitor_info t
|
||||
left join base_monitor_info p on p.objid = t.p_monitor_id
|
||||
where t.objid = #{objid}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseMonitorInfo" parameterType="BaseMonitorInfo">
|
||||
insert into base_monitor_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">objid,</if>
|
||||
<if test="monitorId != null">monitor_id,</if>
|
||||
<if test="pMonitorId != null">p_monitor_id,</if>
|
||||
<if test="monitorName != null">monitor_name,</if>
|
||||
<if test="monitorType != null">monitor_type,</if>
|
||||
<if test="monitorAddr != null">monitor_addr,</if>
|
||||
<if test="monitorStatus != null">monitor_status,</if>
|
||||
<if test="correctValue != null">correct_value,</if>
|
||||
<if test="pt != null">pt,</if>
|
||||
<if test="ct != null">ct,</if>
|
||||
<if test="grade != null">grade,</if>
|
||||
<if test="recordTime != null">record_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">#{objid},</if>
|
||||
<if test="monitorId != null">#{monitorId},</if>
|
||||
<if test="pMonitorId != null">#{pMonitorId},</if>
|
||||
<if test="monitorName != null">#{monitorName},</if>
|
||||
<if test="monitorType != null">#{monitorType},</if>
|
||||
<if test="monitorAddr != null">#{monitorAddr},</if>
|
||||
<if test="monitorStatus != null">#{monitorStatus},</if>
|
||||
<if test="correctValue != null">#{correctValue},</if>
|
||||
<if test="pt != null">#{pt},</if>
|
||||
<if test="ct != null">#{ct},</if>
|
||||
<if test="grade != null">#{grade},</if>
|
||||
<if test="recordTime != null">#{recordTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseMonitorInfo" parameterType="BaseMonitorInfo">
|
||||
update base_monitor_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="monitorId != null">monitor_id = #{monitorId},</if>
|
||||
<if test="pMonitorId != null">p_monitor_id = #{pMonitorId},</if>
|
||||
<if test="monitorName != null">monitor_name = #{monitorName},</if>
|
||||
<if test="monitorType != null">monitor_type = #{monitorType},</if>
|
||||
<if test="monitorAddr != null">monitor_addr = #{monitorAddr},</if>
|
||||
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
|
||||
<if test="correctValue != null">correct_value = #{correctValue},</if>
|
||||
<if test="pt != null">pt = #{pt},</if>
|
||||
<if test="ct != null">ct = #{ct},</if>
|
||||
<if test="grade != null">grade = #{grade},</if>
|
||||
<if test="recordTime != null">record_time = #{recordTime},</if>
|
||||
</trim>
|
||||
where objid = #{objid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseMonitorInfoByObjid" parameterType="Long">
|
||||
delete from base_monitor_info where objid = #{objid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseMonitorInfoByObjids" parameterType="String">
|
||||
delete from base_monitor_info where objid in
|
||||
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||
#{objid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue