From c147cfd71ac875c7ac16e8ad8a213eb1ab3e4869 Mon Sep 17 00:00:00 2001 From: tangpeng Date: Sun, 16 Jun 2019 17:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPageHelper=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8CMapper=E8=BF=9E=E6=8E=A5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=94=B9=E4=B8=BA=E5=AD=90=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/mapper/TmplSwitchPortMapper.java | 3 + .../mapper/template/TmplSwitchMapper.xml | 59 +++---- .../mapper/template/TmplSwitchPortMapper.xml | 167 ++++++++++-------- 3 files changed, 122 insertions(+), 107 deletions(-) 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