网络IP地址类型外键
This commit is contained in:
parent
ff080bc307
commit
ffe45a27b6
|
|
@ -24,8 +24,7 @@ import java.util.List;
|
|||
*/
|
||||
@Controller
|
||||
@RequestMapping("/network/netIpAddress")
|
||||
public class NetIpAddressController extends BaseController
|
||||
{
|
||||
public class NetIpAddressController extends BaseController {
|
||||
private String prefix = "network/netIpAddress";
|
||||
|
||||
@Autowired
|
||||
|
|
@ -33,8 +32,7 @@ public class NetIpAddressController extends BaseController
|
|||
|
||||
@RequiresPermissions("network:netIpAddress:view")
|
||||
@GetMapping()
|
||||
public String netIpAddress()
|
||||
{
|
||||
public String netIpAddress() {
|
||||
return prefix + "/netIpAddress";
|
||||
}
|
||||
|
||||
|
|
@ -44,8 +42,7 @@ public class NetIpAddressController extends BaseController
|
|||
@RequiresPermissions("network:netIpAddress:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(NetIpAddress netIpAddress)
|
||||
{
|
||||
public TableDataInfo list(NetIpAddress netIpAddress) {
|
||||
startPage();
|
||||
List<NetIpAddress> list = netIpAddressService.selectNetIpAddressList(netIpAddress);
|
||||
return getDataTable(list);
|
||||
|
|
@ -58,8 +55,7 @@ public class NetIpAddressController extends BaseController
|
|||
@RequiresPermissions("network:netIpAddress:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(NetIpAddress 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");
|
||||
|
|
@ -69,8 +65,7 @@ public class NetIpAddressController extends BaseController
|
|||
* 新增网络IP
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
public String add() {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
|
|
@ -81,8 +76,7 @@ public class NetIpAddressController extends BaseController
|
|||
@Log(title = "网络IP", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(NetIpAddress netIpAddress)
|
||||
{
|
||||
public AjaxResult addSave(NetIpAddress netIpAddress) {
|
||||
return toAjax(netIpAddressService.insertNetIpAddress(netIpAddress));
|
||||
}
|
||||
|
||||
|
|
@ -90,8 +84,7 @@ public class NetIpAddressController extends BaseController
|
|||
* 修改网络IP
|
||||
*/
|
||||
@GetMapping("/edit/{ipAddressId}")
|
||||
public String edit(@PathVariable("ipAddressId") Integer ipAddressId, ModelMap mmap)
|
||||
{
|
||||
public String edit(@PathVariable("ipAddressId") Integer ipAddressId, ModelMap mmap) {
|
||||
NetIpAddress netIpAddress = netIpAddressService.selectNetIpAddressById(ipAddressId);
|
||||
mmap.put("netIpAddress", netIpAddress);
|
||||
return prefix + "/edit";
|
||||
|
|
@ -104,8 +97,7 @@ public class NetIpAddressController extends BaseController
|
|||
@Log(title = "网络IP", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(NetIpAddress netIpAddress)
|
||||
{
|
||||
public AjaxResult editSave(NetIpAddress netIpAddress) {
|
||||
return toAjax(netIpAddressService.updateNetIpAddress(netIpAddress));
|
||||
}
|
||||
|
||||
|
|
@ -116,8 +108,7 @@ public class NetIpAddressController extends BaseController
|
|||
@Log(title = "网络IP", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(netIpAddressService.deleteNetIpAddressByIds(ids));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,8 +158,32 @@
|
|||
field: 'email',
|
||||
title: '邮箱',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
}]
|
||||
};
|
||||
$.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) {
|
||||
|
|
@ -183,8 +192,7 @@
|
|||
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>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,19 +10,28 @@
|
|||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<input id="machineRoomId" name="machineRoomId" th:field="*{machineRoomId}" class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -44,9 +53,21 @@
|
|||
var prefix = ctx + "network/netIpAddress";
|
||||
$("#form-netIpAddress-edit").validate({
|
||||
rules: {
|
||||
xxxx:{
|
||||
machineRoomId: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 2
|
||||
},
|
||||
ipAddressType: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 20
|
||||
},
|
||||
ipAddressSection: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 20
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
IP地址类型:<input type="text" name="ipAddressType"/>
|
||||
IP地址类型:<input type="text" name="dictCode"/>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
</li>
|
||||
|
||||
<li>
|
||||
所属机房编号:<input type="text" name="machingRoomId"/>
|
||||
所属机房编号:<input type="text" name="machineRoomId"/>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
|
@ -31,8 +31,10 @@
|
|||
</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>
|
||||
<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>
|
||||
|
|
@ -43,13 +45,16 @@
|
|||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()"
|
||||
shiro:hasPermission="network:netIpAddress:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -82,7 +87,7 @@
|
|||
visible: false
|
||||
},
|
||||
{
|
||||
field : 'ipAddressType',
|
||||
field: 'ipAddressType.dictLabel',
|
||||
title: 'IP地址类型',
|
||||
sortable: true
|
||||
},
|
||||
|
|
@ -92,7 +97,7 @@
|
|||
sortable: true
|
||||
},
|
||||
{
|
||||
field : 'machingRoomId',
|
||||
field: 'machineRoomId',
|
||||
title: '所属机房',
|
||||
sortable: true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
@ -20,7 +21,11 @@ public class NetIpAddress extends BaseEntity {
|
|||
/**
|
||||
* IP地址类型
|
||||
*/
|
||||
private String ipAddressType;
|
||||
private Integer dictCode;
|
||||
/**
|
||||
* IP地址类型 实体关联
|
||||
*/
|
||||
private SysDictData ipAddressType;
|
||||
/**
|
||||
* IP地址段
|
||||
*/
|
||||
|
|
@ -28,7 +33,7 @@ public class NetIpAddress extends BaseEntity {
|
|||
/**
|
||||
* 所属机房编号
|
||||
*/
|
||||
private String machingRoomId;
|
||||
private Integer machineRoomId;
|
||||
/**
|
||||
* IP使用规则
|
||||
*/
|
||||
|
|
@ -46,11 +51,19 @@ public class NetIpAddress extends BaseEntity {
|
|||
this.ipAddressId = ipAddressId;
|
||||
}
|
||||
|
||||
public String getIpAddressType() {
|
||||
public Integer getDictCode() {
|
||||
return dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(Integer dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public SysDictData getIpAddressType() {
|
||||
return ipAddressType;
|
||||
}
|
||||
|
||||
public void setIpAddressType(String ipAddressType) {
|
||||
public void setIpAddressType(SysDictData ipAddressType) {
|
||||
this.ipAddressType = ipAddressType;
|
||||
}
|
||||
|
||||
|
|
@ -62,12 +75,12 @@ public class NetIpAddress extends BaseEntity {
|
|||
this.ipAddressSection = ipAddressSection;
|
||||
}
|
||||
|
||||
public String getMachingRoomId() {
|
||||
return machingRoomId;
|
||||
public Integer getMachineRoomId() {
|
||||
return machineRoomId;
|
||||
}
|
||||
|
||||
public void setMachingRoomId(String machingRoomId) {
|
||||
this.machingRoomId = machingRoomId;
|
||||
public void setMachineRoomId(Integer machineRoomId) {
|
||||
this.machineRoomId = machineRoomId;
|
||||
}
|
||||
|
||||
public String getIpUseRule() {
|
||||
|
|
@ -90,7 +103,7 @@ public class NetIpAddress extends BaseEntity {
|
|||
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("machineRoomId", getMachineRoomId()).append("ipUseRule", getIpUseRule())
|
||||
.append("ipAllocRule", getIpAllocRule()).toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
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 {
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -6,49 +6,58 @@
|
|||
|
||||
<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
|
||||
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 ipAllocRule != '' ">#{ipAllocRule},</if>
|
||||
</trim>
|
||||
|
|
@ -57,11 +66,11 @@
|
|||
<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 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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue