diff --git a/ruoyi-system/src/main/java/com/ruoyi/template/mapper/TmplSwitchPortMapper.java b/ruoyi-system/src/main/java/com/ruoyi/template/mapper/TmplSwitchPortMapper.java index c7e2efbbb..6fa32b530 100755 --- a/ruoyi-system/src/main/java/com/ruoyi/template/mapper/TmplSwitchPortMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/template/mapper/TmplSwitchPortMapper.java @@ -1,6 +1,7 @@ package com.ruoyi.template.mapper; import com.ruoyi.template.domain.TmplSwitchPort; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -28,6 +29,8 @@ public interface TmplSwitchPortMapper { */ public TmplSwitchPort selectBySwitchIdAndPortType(Integer switchId, Integer switchPortType); + public TmplSwitchPort selectBySwitchId(@Param("switchId") Integer switchId); + /** * 查询交换机端口类型列表 * diff --git a/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml index f11e067b4..a3e0a0b6d 100644 --- a/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml @@ -4,40 +4,26 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - + - - - - select - s.switch_id, - s.switch_brand, - s.switch_type, - s.power_num, - p.switch_port_id as pid, - p.switch_port_type as ptype, - p.switch_port_num as pnum - from - tmpl_switch s - left join - tmpl_switch_port p - on - s.switch_id = p.switch_id - + select switch_id, switch_brand, switch_type, power_num from + tmpl_switch + - and switch_id = #{switchId} @@ -46,18 +32,16 @@ and power_num = #{powerNum} - - - - - - where s.switch_id = #{switchId} + where switch_id = #{switchId} - + insert into tmpl_switch switch_brand, @@ -71,7 +55,8 @@ - + update tmpl_switch switch_brand = #{switchBrand}, @@ -82,12 +67,14 @@ - delete from tmpl_switch where switch_id = #{switchId} - + delete from + tmpl_switch where switch_id = #{switchId} + delete from tmpl_switch where switch_id in - + #{switchId} diff --git a/ruoyi-system/src/main/resources/mapper/template/TmplSwitchPortMapper.xml b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchPortMapper.xml index 909e2150c..037259d61 100755 --- a/ruoyi-system/src/main/resources/mapper/template/TmplSwitchPortMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchPortMapper.xml @@ -2,88 +2,113 @@ - + - - - - - - + + + + + + - - select switch_port_id, switch_id, switch_port_type, switch_port_num from tmpl_switch_port - + + select switch_port_id, switch_id, switch_port_type, + switch_port_num from + tmpl_switch_port + - + - + - + + + - - insert into tmpl_switch_port - - switch_port_id, - switch_id, - switch_port_type, - switch_port_num, - - - #{switchPortId}, - #{switchId}, - #{switchPortType}, - #{switchPortNum}, - - + + insert into tmpl_switch_port + + switch_port_id, + switch_id, + switch_port_type, + switch_port_num, + + + #{switchPortId}, + #{switchId}, + #{switchPortType}, + #{switchPortNum}, + + - - insert into tmpl_switch_port(switch_id, switch_port_type,switch_port_num) values - - (#{item.switchId},#{item.switchPortType},#{item.switchPortNum}) - - + + insert into tmpl_switch_port(switch_id, + switch_port_type,switch_port_num) values + + (#{item.switchId},#{item.switchPortType},#{item.switchPortNum}) + + - - update tmpl_switch_port - - switch_id = #{switchId}, - switch_port_type = #{switchPortType}, - switch_port_num = #{switchPortNum}, - - where switch_port_id = #{switchPortId} - + + update tmpl_switch_port + + switch_id = #{switchId}, + switch_port_type = #{switchPortType}, + switch_port_num = #{switchPortNum}, + + where switch_port_id = #{switchPortId} + - - delete from tmpl_switch_port where switch_port_id = #{switchPortId} - + + delete from + tmpl_switch_port where switch_port_id = #{switchPortId} + - - delete from tmpl_switch_port where switch_id = #{switchId} - + + delete from tmpl_switch_port where switch_id = + #{switchId} + - - delete from tmpl_switch_port where switch_port_id in - - #{switchPortId} - - + + delete from tmpl_switch_port where switch_port_id in + + #{switchPortId} + + \ No newline at end of file