修复机房和机柜列表子条件搜索问题
This commit is contained in:
parent
bf1e675967
commit
3756b0a012
|
|
@ -71,7 +71,7 @@
|
|||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 3,
|
||||
min:1,
|
||||
min: 1
|
||||
},
|
||||
cabinetAvailElec: {
|
||||
required: true,
|
||||
|
|
|
|||
|
|
@ -10,14 +10,12 @@
|
|||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
机房:<input type="text" name="machineRoomId"/>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
机柜名称:<input type="text" name="cabinetName"/>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
机房:<input type="text" name="dictCode"/>
|
||||
</li>
|
||||
<li>
|
||||
机柜所在区域:<input type="text" name="cabinetArea"/>
|
||||
</li>
|
||||
|
|
@ -91,7 +89,12 @@
|
|||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'machineRoomId',
|
||||
field: 'cabinetName',
|
||||
title: '机柜名称',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'machineRoom',
|
||||
title: '所属机房',
|
||||
sortable: true,
|
||||
formatter: function (value, row, index) {
|
||||
|
|
@ -102,11 +105,6 @@
|
|||
return value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'cabinetName',
|
||||
title: '机柜名称',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'cabinetArea',
|
||||
title: '机柜所在区域',
|
||||
|
|
|
|||
|
|
@ -15,13 +15,19 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">带宽类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="bandwidthType" name="bandwidthType" class="form-control" type="text">
|
||||
<select id="bandwidthType" name="bandwidthType.dictCode"
|
||||
th:with="type=${@dict.getType('dict_bandwidth_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">
|
||||
<label class="col-sm-3 control-label">带宽大小:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="bandwidthSize" name="bandwidthSize" class="form-control" type="text">
|
||||
<input id="bandwidthSize" name="bandwidthSize" class="form-control" type="number" min="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -76,12 +82,50 @@
|
|||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "assets/assetsMachineRoom"
|
||||
var prefix = ctx + "assets/assetsMachineRoom";
|
||||
$("#form-assetsMachineRoom-add").validate({
|
||||
rules: {
|
||||
xxxx:{
|
||||
required:true,
|
||||
"bandwidthType.dictCode": {
|
||||
required: true
|
||||
},
|
||||
machineRoomName: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
bandwidthSize: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
country: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
province: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
city: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
area: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
email: {
|
||||
required: false,
|
||||
email: true
|
||||
},
|
||||
contactPhone: {
|
||||
required: false,
|
||||
isPhone: true
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</li>
|
||||
|
||||
<li>
|
||||
带宽类型:<input type="text" name="bandwidthType"/>
|
||||
带宽类型:<input type="text" name="dictCode"/>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'bandwidthType',
|
||||
field: 'bandwidthType.dictLabel',
|
||||
title: '带宽类型',
|
||||
sortable: true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -17,8 +17,14 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">带宽类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="bandwidthType" name="bandwidthType" th:field="*{bandwidthType}" class="form-control"
|
||||
type="text">
|
||||
<select id="bandwidthType" name="bandwidthType.dictCode"
|
||||
th:with="type=${@dict.getType('dict_bandwidth_type')}">
|
||||
<option value="">请选择带宽类型</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||
th:value="${dict.dictCode}"
|
||||
th:selected="*{bandwidthType.dictCode} == ${dict.dictCode} ? true :false">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -85,9 +91,47 @@
|
|||
var prefix = ctx + "assets/assetsMachineRoom";
|
||||
$("#form-assetsMachineRoom-edit").validate({
|
||||
rules: {
|
||||
xxxx: {
|
||||
required: true,
|
||||
"bandwidthType.dictCode": {
|
||||
required: true
|
||||
},
|
||||
machineRoomName: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
bandwidthSize: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
country: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
province: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
city: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
area: {
|
||||
required: true,
|
||||
minlength: 1,
|
||||
maxlength: 10
|
||||
},
|
||||
email: {
|
||||
required: false,
|
||||
email: true
|
||||
},
|
||||
contactPhone: {
|
||||
required: false,
|
||||
isPhone: true
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,7 +20,12 @@ public class AssetsCabinet extends BaseEntity {
|
|||
/**
|
||||
* 机房编号
|
||||
*/
|
||||
private Integer dictCode;
|
||||
/**
|
||||
* 机房对象
|
||||
*/
|
||||
private AssetsMachineRoom machineRoom;
|
||||
|
||||
/**
|
||||
* 机柜名称
|
||||
*/
|
||||
|
|
@ -46,6 +51,14 @@ public class AssetsCabinet extends BaseEntity {
|
|||
this.cabinetId = cabinetId;
|
||||
}
|
||||
|
||||
public Integer getDictCode() {
|
||||
return dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(Integer dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public AssetsMachineRoom getMachineRoom() {
|
||||
return machineRoom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.ruoyi.assets.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;
|
||||
|
||||
import java.beans.Transient;
|
||||
|
||||
/**
|
||||
* 机房表 assets_machine_room
|
||||
*
|
||||
|
|
@ -24,7 +27,11 @@ public class AssetsMachineRoom extends BaseEntity {
|
|||
/**
|
||||
* 带宽类型
|
||||
*/
|
||||
private Long bandwidthType;
|
||||
private Integer dictCode;
|
||||
/**
|
||||
* 带宽类型 实体关联
|
||||
*/
|
||||
private SysDictData bandwidthType;
|
||||
/**
|
||||
* 带宽大小
|
||||
*/
|
||||
|
|
@ -78,11 +85,20 @@ public class AssetsMachineRoom extends BaseEntity {
|
|||
this.machineRoomName = machineRoomName;
|
||||
}
|
||||
|
||||
public Long getBandwidthType() {
|
||||
@Transient
|
||||
public Integer getDictCode() {
|
||||
return dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(Integer dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public SysDictData getBandwidthType() {
|
||||
return bandwidthType;
|
||||
}
|
||||
|
||||
public void setBandwidthType(Long bandwidthType) {
|
||||
public void setBandwidthType(SysDictData bandwidthType) {
|
||||
this.bandwidthType = bandwidthType;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
<resultMap type="AssetsCabinet" id="AssetsCabinetResult">
|
||||
<result property="cabinetId" column="cabinet_id"/>
|
||||
<!-- <result property="machineRoom" column="machine_room_id"/>-->
|
||||
<result property="cabinetName" column="cabinet_name"/>
|
||||
<result property="cabinetArea" column="cabinet_area"/>
|
||||
<result property="cabinetAvailU" column="cabinet_avail_u"/>
|
||||
|
|
@ -25,7 +24,7 @@
|
|||
<include refid="selectAssetsCabinetVo"/>
|
||||
<where>
|
||||
<if test="cabinetId != null ">and cabinet_id = #{cabinetId}</if>
|
||||
<if test="machineRoom != null ">and machine_room_id = #{machineRoom.machineRoomId}</if>
|
||||
<if test="dictCode != null ">and machine_room_id = #{dictCode}</if>
|
||||
<if test="cabinetName != null and cabinetName != '' ">and cabinet_name = #{cabinetName}</if>
|
||||
<if test="cabinetArea != null ">and cabinet_area = #{cabinetArea}</if>
|
||||
<if test="cabinetAvailU != null ">and cabinet_avail_u = #{cabinetAvailU}</if>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="AssetsMachineRoom" id="AssetsMachineRoomResult">
|
||||
<result property="machineRoomId" column="machine_room_id"/>
|
||||
<result property="machineRoomName" column="machine_room_name"/>
|
||||
<result property="bandwidthType" column="bandwidth_type" />
|
||||
<result property="bandwidthSize" column="bandwidth_size"/>
|
||||
<result property="country" column="country"/>
|
||||
<result property="province" column="province"/>
|
||||
|
|
@ -17,6 +16,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="contactPerson" column="contact_person"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="email" column="email"/>
|
||||
<association property="bandwidthType" column="bandwidth_type"
|
||||
select="com.ruoyi.system.mapper.SysDictDataMapper.selectDictDataById">
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAssetsMachineRoomVo">
|
||||
|
|
@ -27,8 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectAssetsMachineRoomVo"/>
|
||||
<where>
|
||||
<if test="machineRoomId != null ">and machine_room_id = #{machineRoomId}</if>
|
||||
<if test="machineRoomName != null and machineRoomName != '' "> and machine_room_name = #{machineRoomName}</if>
|
||||
<if test="bandwidthType != null "> and bandwidth_type = #{bandwidthType}</if>
|
||||
<if test="machineRoomName != null and machineRoomName != '' ">and machine_room_name = #{machineRoomName}
|
||||
</if>
|
||||
<if test="dictCode != null ">and bandwidth_type = #{dictCode}</if>
|
||||
<if test="bandwidthSize != null ">and bandwidth_size = #{bandwidthSize}</if>
|
||||
<if test="country != null and country != '' ">and country = #{country}</if>
|
||||
<if test="province != null and province != '' ">and province = #{province}</if>
|
||||
|
|
@ -46,7 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where machine_room_id = #{machineRoomId}
|
||||
</select>
|
||||
|
||||
<insert id="insertAssetsMachineRoom" parameterType="AssetsMachineRoom" useGeneratedKeys="true" keyProperty="machineRoomId">
|
||||
<insert id="insertAssetsMachineRoom" parameterType="AssetsMachineRoom" useGeneratedKeys="true"
|
||||
keyProperty="machineRoomId">
|
||||
insert into assets_machine_room
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="machineRoomName != null and machineRoomName != '' ">machine_room_name,</if>
|
||||
|
|
@ -63,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="machineRoomName != null and machineRoomName != '' ">#{machineRoomName},</if>
|
||||
<if test="bandwidthType != null ">#{bandwidthType},</if>
|
||||
<if test="bandwidthType != null ">#{bandwidthType.dictCode},</if>
|
||||
<if test="bandwidthSize != null ">#{bandwidthSize},</if>
|
||||
<if test="country != null and country != '' ">#{country},</if>
|
||||
<if test="province != null and province != '' ">#{province},</if>
|
||||
|
|
@ -80,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update assets_machine_room
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="machineRoomName != null and machineRoomName != '' ">machine_room_name = #{machineRoomName},</if>
|
||||
<if test="bandwidthType != null ">bandwidth_type = #{bandwidthType},</if>
|
||||
<if test="bandwidthType != null ">bandwidth_type = #{bandwidthType.dictCode},</if>
|
||||
<if test="bandwidthSize != null ">bandwidth_size = #{bandwidthSize},</if>
|
||||
<if test="country != null and country != '' ">country = #{country},</if>
|
||||
<if test="province != null and province != '' ">province = #{province},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue