网络IP地址类型外键

This commit is contained in:
tangpeng 2019-06-18 21:11:11 +08:00
parent ff080bc307
commit ffe45a27b6
10 changed files with 451 additions and 396 deletions

View File

@ -18,107 +18,98 @@ import java.util.List;
/**
* 网络IP 信息操作处理
*
*
* @author TP
* @date 2019-06-15
*/
@Controller
@RequestMapping("/network/netIpAddress")
public class NetIpAddressController extends BaseController
{
public class NetIpAddressController extends BaseController {
private String prefix = "network/netIpAddress";
@Autowired
private INetIpAddressService netIpAddressService;
@RequiresPermissions("network:netIpAddress:view")
@GetMapping()
public String netIpAddress()
{
return prefix + "/netIpAddress";
}
/**
* 查询网络IP列表
*/
@RequiresPermissions("network:netIpAddress:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(NetIpAddress netIpAddress)
{
startPage();
@Autowired
private INetIpAddressService netIpAddressService;
@RequiresPermissions("network:netIpAddress:view")
@GetMapping()
public String netIpAddress() {
return prefix + "/netIpAddress";
}
/**
* 查询网络IP列表
*/
@RequiresPermissions("network:netIpAddress:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(NetIpAddress netIpAddress) {
startPage();
List<NetIpAddress> list = netIpAddressService.selectNetIpAddressList(netIpAddress);
return getDataTable(list);
}
/**
* 导出网络IP列表
*/
@RequiresPermissions("network:netIpAddress:export")
return getDataTable(list);
}
/**
* 导出网络IP列表
*/
@RequiresPermissions("network:netIpAddress:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(NetIpAddress netIpAddress)
{
List<NetIpAddress> list = netIpAddressService.selectNetIpAddressList(netIpAddress);
public AjaxResult export(NetIpAddress netIpAddress) {
List<NetIpAddress> list = netIpAddressService.selectNetIpAddressList(netIpAddress);
ExcelUtil<NetIpAddress> util = new ExcelUtil<NetIpAddress>(NetIpAddress.class);
return util.exportExcel(list, "netIpAddress");
}
/**
* 新增网络IP
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存网络IP
*/
@RequiresPermissions("network:netIpAddress:add")
@Log(title = "网络IP", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(NetIpAddress netIpAddress)
{
return toAjax(netIpAddressService.insertNetIpAddress(netIpAddress));
}
/**
* 修改网络IP
*/
@GetMapping("/edit/{ipAddressId}")
public String edit(@PathVariable("ipAddressId") Integer ipAddressId, ModelMap mmap)
{
NetIpAddress netIpAddress = netIpAddressService.selectNetIpAddressById(ipAddressId);
mmap.put("netIpAddress", netIpAddress);
return prefix + "/edit";
}
/**
* 修改保存网络IP
*/
@RequiresPermissions("network:netIpAddress:edit")
@Log(title = "网络IP", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(NetIpAddress netIpAddress)
{
return toAjax(netIpAddressService.updateNetIpAddress(netIpAddress));
}
/**
* 删除网络IP
*/
@RequiresPermissions("network:netIpAddress:remove")
@Log(title = "网络IP", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(netIpAddressService.deleteNetIpAddressByIds(ids));
}
/**
* 新增网络IP
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存网络IP
*/
@RequiresPermissions("network:netIpAddress:add")
@Log(title = "网络IP", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(NetIpAddress netIpAddress) {
return toAjax(netIpAddressService.insertNetIpAddress(netIpAddress));
}
/**
* 修改网络IP
*/
@GetMapping("/edit/{ipAddressId}")
public String edit(@PathVariable("ipAddressId") Integer ipAddressId, ModelMap mmap) {
NetIpAddress netIpAddress = netIpAddressService.selectNetIpAddressById(ipAddressId);
mmap.put("netIpAddress", netIpAddress);
return prefix + "/edit";
}
/**
* 修改保存网络IP
*/
@RequiresPermissions("network:netIpAddress:edit")
@Log(title = "网络IP", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(NetIpAddress netIpAddress) {
return toAjax(netIpAddressService.updateNetIpAddress(netIpAddress));
}
/**
* 删除网络IP
*/
@RequiresPermissions("network:netIpAddress:remove")
@Log(title = "网络IP", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(netIpAddressService.deleteNetIpAddressByIds(ids));
}
}

View File

@ -122,29 +122,14 @@
},
{
field: 'bandwidthSize',
title: '带宽大小',
title: '带宽(M)',
sortable: true
},
{
field: 'country',
title: '所在国家',
title: '国家',
sortable: true
},
// {
// field: 'province',
// title: '所在省',
// sortable: true
// },
// {
// field: 'city',
// title: '所在市',
// sortable: true
// },
// {
// field: 'area',
// title: '所在区',
// sortable: true
// },
{
title: '省市区',
formatter: function (value, row, index) {
@ -173,18 +158,41 @@
field: 'email',
title: '邮箱',
sortable: true
},
{
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.machineRoomId + '\')"><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.machineRoomId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.each([[${@dict.getType('dict_net_ip_type')}]], function (index, dict) {
options.columns.push({
field: dict.dictCode,
title: dict.dictLabel,
align: 'center',
formatter: function (value, row, index) {
if (row.switchPorts) {
$.each(row.switchPorts, function (index, switchPort) {
if (switchPort.switchPortType == dict.dictCode) {
value = switchPort.switchPortNum;
} else {
}
});
}
var title = "'新增" + dict.dictLabel + "IP'";
var url = "/network/netIpAddress/add?";
value = "<a class=\"btn btn-primary btn-xs \" href=\"javascript:void(0)\" " +
"onclick=\"$.modal.open(" + title + ",'" + url + "');\"><i class=\"fa fa-create\"></i>新增</a>";
return value;
}
});
});
options.columns.push({
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.machineRoomId + '\')"><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.machineRoomId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
});
$.table.init(options);
});
</script>

View File

@ -28,7 +28,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">带宽大小:</label>
<label class="col-sm-3 control-label">带宽大小(M)</label>
<div class="col-sm-8">
<input id="bandwidthSize" name="bandwidthSize" th:field="*{bandwidthSize}" class="form-control"
type="text">

View File

@ -9,7 +9,13 @@
<div class="form-group">
<label class="col-sm-3 control-label">IP地址类型</label>
<div class="col-sm-8">
<input id="ipAddressType" name="ipAddressType" class="form-control" type="text">
<select id="ipAddressType" name="ipAddressType.dictCode"
th:with="type=${@dict.getType('dict_net_ip_type')}">
<option value="">请选择带宽类型</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}">
</option>
</select>
</div>
</div>
<div class="form-group">
@ -21,7 +27,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">所属机房:</label>
<div class="col-sm-8">
<input id="machingRoomId" name="machingRoomId" class="form-control" type="text">
<input id="machineRoomId" name="machineRoomId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -44,7 +50,12 @@
$("#form-netIpAddress-add").validate({
onkeyup: false,
rules: {
ipAddressType: {
machineRoomId: {
required: true,
minlength: 1,
maxlength: 2
},
"ipAddressType.dictCode": {
required: true,
minlength: 1,
maxlength: 20
@ -53,12 +64,7 @@
required: true,
minlength: 1,
maxlength: 20
},
machingRoomId: {
required: true,
minlength: 1,
maxlength: 2
},
}
},
focusCleanup: true
});

View File

@ -1,61 +1,82 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改网络IP')" />
<th:block th:include="include :: header('修改网络IP')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-netIpAddress-edit" th:object="${netIpAddress}">
<input id="ipAddressId" name="ipAddressId" th:field="*{ipAddressId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">IP地址类型</label>
<div class="col-sm-8">
<input id="ipAddressType" name="ipAddressType" th:field="*{ipAddressType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址段</label>
<div class="col-sm-8">
<input id="ipAddressSection" name="ipAddressSection" th:field="*{ipAddressSection}" 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 id="machingRoomId" name="machingRoomId" th:field="*{machingRoomId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP使用规则</label>
<div class="col-sm-8">
<input id="ipUseRule" name="ipUseRule" th:field="*{ipUseRule}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址分配规则</label>
<div class="col-sm-8">
<input id="ipAllocRule" name="ipAllocRule" th:field="*{ipAllocRule}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "network/netIpAddress";
$("#form-netIpAddress-edit").validate({
rules:{
xxxx:{
required:true,
},
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-netIpAddress-edit').serialize());
}
}
</script>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-netIpAddress-edit" th:object="${netIpAddress}">
<input id="ipAddressId" name="ipAddressId" th:field="*{ipAddressId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">IP地址类型</label>
<div class="col-sm-8">
<select id="ipAddressType" name="ipAddressType.dictCode"
th:with="type=${@dict.getType('dict_net_ip_type')}">
<option value="">请选择IP地址类型</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}"
th:selected="*{ipAddressType.dictCode} == ${dict.dictCode} ? true :false">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址段</label>
<div class="col-sm-8">
<input id="ipAddressSection" name="ipAddressSection" th:field="*{ipAddressSection}" 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 id="machineRoomId" name="machineRoomId" th:field="*{machineRoomId}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP使用规则</label>
<div class="col-sm-8">
<input id="ipUseRule" name="ipUseRule" th:field="*{ipUseRule}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址分配规则</label>
<div class="col-sm-8">
<input id="ipAllocRule" name="ipAllocRule" th:field="*{ipAllocRule}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "network/netIpAddress";
$("#form-netIpAddress-edit").validate({
rules: {
machineRoomId: {
required: true,
minlength: 1,
maxlength: 2
},
ipAddressType: {
required: true,
minlength: 1,
maxlength: 20
},
ipAddressSection: {
required: true,
minlength: 1,
maxlength: 20
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-netIpAddress-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -1,124 +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('网络IP列表')" />
<th:block th:include="include :: header('网络IP列表')"/>
</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>
IP地址类型<input type="text" name="ipAddressType"/>
</li>
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
IP地址类型<input type="text" name="dictCode"/>
</li>
<li>
IP地址段<input type="text" name="ipAddressSection"/>
</li>
<li>
IP地址段<input type="text" name="ipAddressSection"/>
</li>
<li>
所属机房编号:<input type="text" name="machingRoomId"/>
</li>
<li>
所属机房编号:<input type="text" name="machineRoomId"/>
</li>
<li>
IP使用规则<input type="text" name="ipUseRule"/>
</li>
<li>
IP使用规则<input type="text" name="ipUseRule"/>
</li>
<li>
IP地址分配规则<input type="text" name="ipAllocRule"/>
</li>
<li>
IP地址分配规则<input type="text" name="ipAllocRule"/>
</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="network:netIpAddress:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="network:netIpAddress:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="network:netIpAddress:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="network:netIpAddress:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('network:netIpAddress:edit')}]];
var removeFlag = [[${@permission.hasPermi('network:netIpAddress:remove')}]];
var prefix = ctx + "network/netIpAddress";
<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>
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "网络IP",
showExport: true,
columns: [{
checkbox: true
},
{
field : 'ipAddressId',
title : 'IP地址编号',
visible: false
},
{
field : 'ipAddressType',
title : 'IP地址类型',
sortable: true
},
{
field : 'ipAddressSection',
title : 'IP地址段',
sortable: true
},
{
field : 'machingRoomId',
title : '所属机房',
sortable: true
},
{
field : 'ipUseRule',
title : 'IP使用规则',
sortable: true
},
{
field : 'ipAllocRule',
title : 'IP地址分配规则',
sortable: true
},
{
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.ipAddressId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="network:netIpAddress:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"
shiro:hasPermission="network:netIpAddress:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="network:netIpAddress:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="network:netIpAddress:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('network:netIpAddress:edit')}]];
var removeFlag = [[${@permission.hasPermi('network:netIpAddress:remove')}]];
var prefix = ctx + "network/netIpAddress";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "网络IP",
showExport: true,
columns: [{
checkbox: true
},
{
field: 'ipAddressId',
title: 'IP地址编号',
visible: false
},
{
field: 'ipAddressType.dictLabel',
title: 'IP地址类型',
sortable: true
},
{
field: 'ipAddressSection',
title: 'IP地址段',
sortable: true
},
{
field: 'machineRoomId',
title: '所属机房',
sortable: true
},
{
field: 'ipUseRule',
title: 'IP使用规则',
sortable: true
},
{
field: 'ipAllocRule',
title: 'IP地址分配规则',
sortable: true
},
{
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.ipAddressId + '\')"><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.ipAddressId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -123,7 +123,7 @@
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.switchId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
})
});
$.table.init(options);
});
</script>

View File

@ -1,6 +1,7 @@
package com.ruoyi.network.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.SysDictData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -11,86 +12,98 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @date 2019-06-15
*/
public class NetIpAddress extends BaseEntity {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* IP地址编号
*/
private Integer ipAddressId;
/**
* IP地址类型
*/
private String ipAddressType;
/**
* IP地址段
*/
private String ipAddressSection;
/**
* 所属机房编号
*/
private String machingRoomId;
/**
* IP使用规则
*/
private String ipUseRule;
/**
* IP地址分配规则
*/
private String ipAllocRule;
/**
* IP地址编号
*/
private Integer ipAddressId;
/**
* IP地址类型
*/
private Integer dictCode;
/**
* IP地址类型 实体关联
*/
private SysDictData ipAddressType;
/**
* IP地址段
*/
private String ipAddressSection;
/**
* 所属机房编号
*/
private Integer machineRoomId;
/**
* IP使用规则
*/
private String ipUseRule;
/**
* IP地址分配规则
*/
private String ipAllocRule;
public Integer getIpAddressId() {
return ipAddressId;
}
public Integer getIpAddressId() {
return ipAddressId;
}
public void setIpAddressId(Integer ipAddressId) {
this.ipAddressId = ipAddressId;
}
public void setIpAddressId(Integer ipAddressId) {
this.ipAddressId = ipAddressId;
}
public String getIpAddressType() {
return ipAddressType;
}
public Integer getDictCode() {
return dictCode;
}
public void setIpAddressType(String ipAddressType) {
this.ipAddressType = ipAddressType;
}
public void setDictCode(Integer dictCode) {
this.dictCode = dictCode;
}
public String getIpAddressSection() {
return ipAddressSection;
}
public SysDictData getIpAddressType() {
return ipAddressType;
}
public void setIpAddressSection(String ipAddressSection) {
this.ipAddressSection = ipAddressSection;
}
public void setIpAddressType(SysDictData ipAddressType) {
this.ipAddressType = ipAddressType;
}
public String getMachingRoomId() {
return machingRoomId;
}
public String getIpAddressSection() {
return ipAddressSection;
}
public void setMachingRoomId(String machingRoomId) {
this.machingRoomId = machingRoomId;
}
public void setIpAddressSection(String ipAddressSection) {
this.ipAddressSection = ipAddressSection;
}
public String getIpUseRule() {
return ipUseRule;
}
public Integer getMachineRoomId() {
return machineRoomId;
}
public void setIpUseRule(String ipUseRule) {
this.ipUseRule = ipUseRule;
}
public void setMachineRoomId(Integer machineRoomId) {
this.machineRoomId = machineRoomId;
}
public String getIpAllocRule() {
return ipAllocRule;
}
public String getIpUseRule() {
return ipUseRule;
}
public void setIpAllocRule(String ipAllocRule) {
this.ipAllocRule = ipAllocRule;
}
public void setIpUseRule(String ipUseRule) {
this.ipUseRule = ipUseRule;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("ipAddressId", getIpAddressId())
.append("ipAddressType", getIpAddressType()).append("ipAddressSection", getIpAddressSection())
.append("machingRoomId", getMachingRoomId()).append("ipUseRule", getIpUseRule())
.append("ipAllocRule", getIpAllocRule()).toString();
}
public String getIpAllocRule() {
return ipAllocRule;
}
public void setIpAllocRule(String ipAllocRule) {
this.ipAllocRule = ipAllocRule;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("ipAddressId", getIpAddressId())
.append("ipAddressType", getIpAddressType()).append("ipAddressSection", getIpAddressSection())
.append("machineRoomId", getMachineRoomId()).append("ipUseRule", getIpUseRule())
.append("ipAllocRule", getIpAllocRule()).toString();
}
}

View File

@ -1,19 +1,19 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysDictData;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 字典表 数据层
*
*
* @author ruoyi
*/
public interface SysDictDataMapper
{
public interface SysDictDataMapper {
/**
* 根据条件分页查询字典数据
*
*
* @param dictData 字典数据信息
* @return 字典数据集合信息
*/
@ -21,7 +21,7 @@ public interface SysDictDataMapper
/**
* 根据字典类型查询字典数据
*
*
* @param dictType 字典类型
* @return 字典数据集合信息
*/
@ -29,8 +29,8 @@ public interface SysDictDataMapper
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
@ -38,7 +38,7 @@ public interface SysDictDataMapper
/**
* 根据字典数据ID查询信息
*
*
* @param dictCode 字典数据ID
* @return 字典数据
*/
@ -46,7 +46,7 @@ public interface SysDictDataMapper
/**
* 查询字典数据
*
*
* @param dictType 字典类型
* @return 字典数据
*/
@ -54,7 +54,7 @@ public interface SysDictDataMapper
/**
* 通过字典ID删除字典数据信息
*
*
* @param dictCode 字典数据ID
* @return 结果
*/
@ -62,7 +62,7 @@ public interface SysDictDataMapper
/**
* 批量删除字典数据
*
*
* @param ids 需要删除的数据
* @return 结果
*/
@ -70,7 +70,7 @@ public interface SysDictDataMapper
/**
* 新增字典数据信息
*
*
* @param dictData 字典数据信息
* @return 结果
*/
@ -78,7 +78,7 @@ public interface SysDictDataMapper
/**
* 修改字典数据信息
*
*
* @param dictData 字典数据信息
* @return 结果
*/
@ -86,7 +86,7 @@ public interface SysDictDataMapper
/**
* 同步修改字典类型
*
*
* @param oldDictType 旧字典类型
* @param newDictType 新旧字典类型
* @return 结果

View File

@ -6,62 +6,71 @@
<resultMap type="NetIpAddress" id="NetIpAddressResult">
<result property="ipAddressId" column="ip_address_id"/>
<result property="ipAddressType" column="ip_address_type"/>
<!-- <result property="ipAddressType" column="ip_address_type"/>-->
<result property="ipAddressSection" column="ip_address_section"/>
<result property="machingRoomId" column="maching_room_id"/>
<result property="machineRoomId" column="machine_room_id"/>
<result property="ipUseRule" column="ip_use_rule"/>
<result property="ipAllocRule" column="ip_alloc_rule"/>
<association property="ipAddressType"
column="ip_address_type"
select="com.ruoyi.system.mapper.SysDictDataMapper.selectDictDataById">
</association>
</resultMap>
<sql id="selectNetIpAddressVo">
select ip_address_id, ip_address_type, ip_address_section, maching_room_id, ip_use_rule, ip_alloc_rule from net_ip_address
</sql>
select ip_address_id, ip_address_type, ip_address_section,
machine_room_id,
ip_use_rule, ip_alloc_rule from net_ip_address
</sql>
<select id="selectNetIpAddressList" parameterType="NetIpAddress" resultMap="NetIpAddressResult">
<select id="selectNetIpAddressList" parameterType="NetIpAddress"
resultMap="NetIpAddressResult">
<include refid="selectNetIpAddressVo"/>
<where>
<if test="ipAddressId != null ">and ip_address_id = #{ipAddressId}</if>
<if test="ipAddressType != null and ipAddressType != '' ">and ip_address_type = #{ipAddressType}</if>
<if test="dictCode != null ">and ip_address_type = #{dictCode}</if>
<if test="ipAddressSection != null and ipAddressSection != '' ">and ip_address_section =
#{ipAddressSection}
</if>
<if test="machingRoomId != null and machingRoomId != '' ">and maching_room_id = #{machingRoomId}</if>
<if test="machineRoomId != null ">and machine_room_id = #{machineRoomId}</if>
<if test="ipUseRule != null and ipUseRule != '' ">and ip_use_rule = #{ipUseRule}</if>
<if test="ipAllocRule != null and ipAllocRule != '' ">and ip_alloc_rule = #{ipAllocRule}</if>
</where>
</select>
<select id="selectNetIpAddressById" parameterType="Integer" resultMap="NetIpAddressResult">
<select id="selectNetIpAddressById" parameterType="Integer"
resultMap="NetIpAddressResult">
<include refid="selectNetIpAddressVo"/>
where ip_address_id = #{ipAddressId}
</select>
<insert id="insertNetIpAddress" parameterType="NetIpAddress" useGeneratedKeys="true" keyProperty="ipAddressId">
<insert id="insertNetIpAddress" parameterType="NetIpAddress"
useGeneratedKeys="true" keyProperty="ipAddressId">
insert into net_ip_address
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ipAddressType != null and ipAddressType != '' ">ip_address_type,</if>
<if test="ipAddressType != null ">ip_address_type,</if>
<if test="ipAddressSection != null and ipAddressSection != '' ">ip_address_section,</if>
<if test="machingRoomId != null and machingRoomId != '' ">maching_room_id,</if>
<if test="machineRoomId != null ">machine_room_id,</if>
<if test="ipUseRule != null and ipUseRule != '' ">ip_use_rule,</if>
<if test="ipAllocRule != null and ipAllocRule != '' ">ip_alloc_rule,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ipAddressType != null and ipAddressType != '' ">#{ipAddressType},</if>
<if test="ipAddressType != null ">#{ipAddressType.dictCode},</if>
<if test="ipAddressSection != null and ipAddressSection != '' ">#{ipAddressSection},</if>
<if test="machingRoomId != null and machingRoomId != '' ">#{machingRoomId},</if>
<if test="machineRoomId != null ">#{machineRoomId},</if>
<if test="ipUseRule != null and ipUseRule != '' ">#{ipUseRule},</if>
<if test="ipAllocRule != null and ip AllocRule != '' ">#{ipAllocRule},</if>
<if test="ipAllocRule != null and ipAllocRule != '' ">#{ipAllocRule},</if>
</trim>
</insert>
<update id="updateNetIpAddress" parameterType="NetIpAddress">
update net_ip_address
<trim prefix="SET" suffixOverrides=",">
<if test="ipAddressType != null and ipAddressType != '' ">ip_address_type = #{ipAddressType},</if>
<if test="ipAddressType != null ">ip_address_type = #{ipAddressType.dictCode},</if>
<if test="ipAddressSection != null and ipAddressSection != '' ">ip_address_section =
#{ipAddressSection},
</if>
<if test="machingRoomId != null and machingRoomId != '' ">maching_room_id = #{machingRoomId},</if>
<if test="machineRoomId != null ">machine_room_id = #{machineRoomId},</if>
<if test="ipUseRule != null and ipUseRule != '' ">ip_use_rule = #{ipUseRule},</if>
<if test="ipAllocRule != null and ipAllocRule != '' ">ip_alloc_rule = #{ipAllocRule},</if>
</trim>
@ -69,12 +78,14 @@
</update>
<delete id="deleteNetIpAddressById" parameterType="Integer">
delete from net_ip_address where ip_address_id = #{ipAddressId}
</delete>
delete from
net_ip_address where ip_address_id = #{ipAddressId}
</delete>
<delete id="deleteNetIpAddressByIds" parameterType="String">
delete from net_ip_address where ip_address_id in
<foreach item="ipAddressId" collection="array" open="(" separator="," close=")">
<foreach item="ipAddressId" collection="array" open="("
separator="," close=")">
#{ipAddressId}
</foreach>
</delete>