diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/template/TmplSwitchController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/template/TmplSwitchController.java index fd09547f0..3d213e315 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/template/TmplSwitchController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/template/TmplSwitchController.java @@ -1,127 +1,115 @@ package com.ruoyi.web.controller.template; -import java.util.List; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.template.domain.TmplSwitch; +import com.ruoyi.template.service.ITmplSwitchService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.template.domain.TmplSwitch; -import com.ruoyi.template.service.ITmplSwitchService; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 交换机模板 信息操作处理 - * + * * @author TP * @date 2019-06-12 */ @Controller @RequestMapping("/template/tmplSwitch") -public class TmplSwitchController extends BaseController -{ +public class TmplSwitchController extends BaseController { private String prefix = "template/tmplSwitch"; - - @Autowired - private ITmplSwitchService tmplSwitchService; - - @RequiresPermissions("template:tmplSwitch:view") - @GetMapping() - public String tmplSwitch() - { - return prefix + "/tmplSwitch"; - } - - /** - * 查询交换机模板列表 - */ - @RequiresPermissions("template:tmplSwitch:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(TmplSwitch tmplSwitch) - { - startPage(); + + @Autowired + private ITmplSwitchService tmplSwitchService; + + @RequiresPermissions("template:tmplSwitch:view") + @GetMapping() + public String tmplSwitch() { + return prefix + "/tmplSwitch"; + } + + /** + * 查询交换机模板列表 + */ + @RequiresPermissions("template:tmplSwitch:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(TmplSwitch tmplSwitch) { + startPage(); List list = tmplSwitchService.selectTmplSwitchList(tmplSwitch); - return getDataTable(list); - } - - - /** - * 导出交换机模板列表 - */ - @RequiresPermissions("template:tmplSwitch:export") + return getDataTable(list); + } + + + /** + * 导出交换机模板列表 + */ + @RequiresPermissions("template:tmplSwitch:export") @PostMapping("/export") @ResponseBody - public AjaxResult export(TmplSwitch tmplSwitch) - { - List list = tmplSwitchService.selectTmplSwitchList(tmplSwitch); + public AjaxResult export(TmplSwitch tmplSwitch) { + List list = tmplSwitchService.selectTmplSwitchList(tmplSwitch); ExcelUtil util = new ExcelUtil(TmplSwitch.class); return util.exportExcel(list, "tmplSwitch"); } - - /** - * 新增交换机模板 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/add"; - } - - /** - * 新增保存交换机模板 - */ - @RequiresPermissions("template:tmplSwitch:add") - @Log(title = "交换机模板", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(TmplSwitch tmplSwitch) - { - return toAjax(tmplSwitchService.insertTmplSwitch(tmplSwitch)); - } - /** - * 修改交换机模板 - */ - @GetMapping("/edit/{switchId}") - public String edit(@PathVariable("switchId") Integer switchId, ModelMap mmap) - { - TmplSwitch tmplSwitch = tmplSwitchService.selectTmplSwitchById(switchId); - mmap.put("tmplSwitch", tmplSwitch); - return prefix + "/edit"; - } - - /** - * 修改保存交换机模板 - */ - @RequiresPermissions("template:tmplSwitch:edit") - @Log(title = "交换机模板", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(TmplSwitch tmplSwitch) - { - return toAjax(tmplSwitchService.updateTmplSwitch(tmplSwitch)); - } - - /** - * 删除交换机模板 - */ - @RequiresPermissions("template:tmplSwitch:remove") - @Log(title = "交换机模板", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(tmplSwitchService.deleteTmplSwitchByIds(ids)); - } - + /** + * 新增交换机模板 + */ + @GetMapping("/add") + public String add() { + return prefix + "/add"; + } + + /** + * 新增保存交换机模板 + */ + @RequiresPermissions("template:tmplSwitch:add") + @Log(title = "交换机模板", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(TmplSwitch tmplSwitch) { + return toAjax(tmplSwitchService.insertTmplSwitch(tmplSwitch)); + } + + /** + * 修改交换机模板 + */ + @GetMapping("/edit/{switchId}") + public String edit(@PathVariable("switchId") Integer switchId, ModelMap mmap) { + TmplSwitch tmplSwitch = tmplSwitchService.selectTmplSwitchById(switchId); + mmap.put("tmplSwitch", tmplSwitch); + return prefix + "/edit"; + } + + /** + * 修改保存交换机模板 + */ + @RequiresPermissions("template:tmplSwitch:edit") + @Log(title = "交换机模板", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(TmplSwitch tmplSwitch) { + return toAjax(tmplSwitchService.updateTmplSwitch(tmplSwitch)); + } + + /** + * 删除交换机模板 + */ + @RequiresPermissions("template:tmplSwitch:remove") + @Log(title = "交换机模板", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(tmplSwitchService.deleteTmplSwitchByIds(ids)); + } + } diff --git a/ruoyi-admin/src/main/resources/templates/template/tmplSwitch/add.html b/ruoyi-admin/src/main/resources/templates/template/tmplSwitch/add.html index 0d43dc2d8..bbabf9338 100644 --- a/ruoyi-admin/src/main/resources/templates/template/tmplSwitch/add.html +++ b/ruoyi-admin/src/main/resources/templates/template/tmplSwitch/add.html @@ -1,48 +1,72 @@ - + - + -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index 0fc68beb5..7da3f70f2 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -11,104 +11,100 @@ import com.fasterxml.jackson.annotation.JsonFormat; * * @author ruoyi */ -public class BaseEntity implements Serializable -{ - private static final long serialVersionUID = 1L; +public class BaseEntity implements Serializable { + private static final long serialVersionUID = 1L; - /** 搜索值 */ - private String searchValue; + /** 搜索值 */ + private String searchValue; - /** 创建者 */ - private String createBy; + /** 创建者 */ + private String createBy; - /** 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; - /** 更新者 */ - private String updateBy; + /** 更新者 */ + private String updateBy; - /** 更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date updateTime; + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; - /** 备注 */ - private String remark; + /** 备注 */ + private String remark; - /** 请求参数 */ - private Map params; + /** 请求参数 */ + private Map params; - public String getSearchValue() - { - return searchValue; - } + /** 外键关联额外信息 */ + private String foreignKeyInfo; - public void setSearchValue(String searchValue) - { - this.searchValue = searchValue; - } + public String getSearchValue() { + return searchValue; + } - public String getCreateBy() - { - return createBy; - } + public void setSearchValue(String searchValue) { + this.searchValue = searchValue; + } - public void setCreateBy(String createBy) - { - this.createBy = createBy; - } + public String getCreateBy() { + return createBy; + } - public Date getCreateTime() - { - return createTime; - } + public void setCreateBy(String createBy) { + this.createBy = createBy; + } - public void setCreateTime(Date createTime) - { - this.createTime = createTime; - } + public Date getCreateTime() { + return createTime; + } - public String getUpdateBy() - { - return updateBy; - } + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } - public void setUpdateBy(String updateBy) - { - this.updateBy = updateBy; - } + public String getUpdateBy() { + return updateBy; + } - public Date getUpdateTime() - { - return updateTime; - } + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } - public void setUpdateTime(Date updateTime) - { - this.updateTime = updateTime; - } + public Date getUpdateTime() { + return updateTime; + } - public String getRemark() - { - return remark; - } + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } - public void setRemark(String remark) - { - this.remark = remark; - } + public String getRemark() { + return remark; + } - public Map getParams() - { - if (params == null) - { - params = new HashMap<>(); - } - return params; - } + public void setRemark(String remark) { + this.remark = remark; + } + + public Map getParams() { + if (params == null) { + params = new HashMap<>(); + } + return params; + } + + public void setParams(Map params) { + this.params = params; + } + + public String getForeignKeyInfo() { + return foreignKeyInfo; + } + + public void setForeignKeyInfo(String foreignKeyInfo) { + this.foreignKeyInfo = foreignKeyInfo; + } - public void setParams(Map params) - { - this.params = params; - } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/template/domain/SwitchPort.java b/ruoyi-system/src/main/java/com/ruoyi/template/domain/SwitchPort.java deleted file mode 100755 index 4b89de82b..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/template/domain/SwitchPort.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.ruoyi.template.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 交换机端口类型(不用代码生成工具)表 tmpl_switch_port - * - * @author TP - * @date 2019-06-12 - */ -public class SwitchPort extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 交换机端口编号 */ - private Integer switchPortId; - /** 交换机模板编号 */ - private Integer switchId; - /** 交换机端口类型 */ - private Integer switchPortType; - /** 交换机端口数量 */ - private Integer switchPortNum; - - public void setSwitchPortId(Integer switchPortId) - { - this.switchPortId = switchPortId; - } - - public Integer getSwitchPortId() - { - return switchPortId; - } - public void setSwitchId(Integer switchId) - { - this.switchId = switchId; - } - - public Integer getSwitchId() - { - return switchId; - } - public void setSwitchPortType(Integer switchPortType) - { - this.switchPortType = switchPortType; - } - - public Integer getSwitchPortType() - { - return switchPortType; - } - public void setSwitchPortNum(Integer switchPortNum) - { - this.switchPortNum = switchPortNum; - } - - public Integer getSwitchPortNum() - { - return switchPortNum; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("switchPortId", getSwitchPortId()) - .append("switchId", getSwitchId()) - .append("switchPortType", getSwitchPortType()) - .append("switchPortNum", getSwitchPortNum()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplServer.java b/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplServer.java index 5b6fa3f42..03beed456 100755 --- a/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplServer.java +++ b/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplServer.java @@ -6,114 +6,121 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 服务器模板表 tmpl_server - * + * * @author TP * @date 2019-06-12 */ -public class TmplServer extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 服务器模板编号 */ - private Integer serverId; - /** 服务器品牌 */ - private String serverBrand; - /** 服务器型号 */ - private String serverType; - /** CPU主频 */ - private String cpuFreq; - /** CPU数量 */ - private Integer cpuNum; - /** IPMI端口 */ - private Integer ipmiPort; - /** 服务器电源数量 */ - private Integer powerNum; - /** 服务器raid卡 */ - private String raidCard; +public class TmplServer extends BaseEntity { + private static final long serialVersionUID = 1L; - public void setServerId(Integer serverId) - { - this.serverId = serverId; - } + /** + * 服务器模板编号 + */ + private Integer serverId; + /** + * 服务器品牌 + */ + private String serverBrand; + /** + * 服务器型号 + */ + private String serverType; + /** + * CPU主频 + */ + private String cpuFreq; + /** + * CPU数量 + */ + private Integer cpuNum; + /** + * IPMI端口 + */ + private Integer ipmiPort; + /** + * 服务器电源数量 + */ + private Integer powerNum; + /** + * 服务器raid卡 + */ + private String raidCard; - public Integer getServerId() - { - return serverId; - } - public void setServerBrand(String serverBrand) - { - this.serverBrand = serverBrand; - } + public void setServerId(Integer serverId) { + this.serverId = serverId; + } - public String getServerBrand() - { - return serverBrand; - } - public void setServerType(String serverType) - { - this.serverType = serverType; - } + public Integer getServerId() { + return serverId; + } - public String getServerType() - { - return serverType; - } - public void setCpuFreq(String cpuFreq) - { - this.cpuFreq = cpuFreq; - } + public void setServerBrand(String serverBrand) { + this.serverBrand = serverBrand; + } - public String getCpuFreq() - { - return cpuFreq; - } - public void setCpuNum(Integer cpuNum) - { - this.cpuNum = cpuNum; - } + public String getServerBrand() { + return serverBrand; + } - public Integer getCpuNum() - { - return cpuNum; - } - public void setIpmiPort(Integer ipmiPort) - { - this.ipmiPort = ipmiPort; - } + public void setServerType(String serverType) { + this.serverType = serverType; + } - public Integer getIpmiPort() - { - return ipmiPort; - } - public void setPowerNum(Integer powerNum) - { - this.powerNum = powerNum; - } + public String getServerType() { + return serverType; + } - public Integer getPowerNum() - { - return powerNum; - } - public void setRaidCard(String raidCard) - { - this.raidCard = raidCard; - } + public void setCpuFreq(String cpuFreq) { + this.cpuFreq = cpuFreq; + } - public String getRaidCard() - { - return raidCard; - } + public String getCpuFreq() { + return cpuFreq; + } + public void setCpuNum(Integer cpuNum) { + this.cpuNum = cpuNum; + } + + public Integer getCpuNum() { + return cpuNum; + } + + public void setIpmiPort(Integer ipmiPort) { + this.ipmiPort = ipmiPort; + } + + public Integer getIpmiPort() { + return ipmiPort; + } + + public void setPowerNum(Integer powerNum) { + this.powerNum = powerNum; + } + + public Integer getPowerNum() { + return powerNum; + } + + public void setRaidCard(String raidCard) { + this.raidCard = raidCard; + } + + public String getRaidCard() { + return raidCard; + } + + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("serverId", getServerId()) - .append("serverBrand", getServerBrand()) - .append("serverType", getServerType()) - .append("cpuFreq", getCpuFreq()) - .append("cpuNum", getCpuNum()) - .append("ipmiPort", getIpmiPort()) - .append("powerNum", getPowerNum()) - .append("raidCard", getRaidCard()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("serverId", getServerId()) + .append("serverBrand", getServerBrand()) + .append("serverType", getServerType()) + .append("cpuFreq", getCpuFreq()) + .append("cpuNum", getCpuNum()) + .append("ipmiPort", getIpmiPort()) + .append("powerNum", getPowerNum()) + .append("raidCard", getRaidCard()) + .toString(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplSwitch.java b/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplSwitch.java index dcfe46288..309e6e5ca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplSwitch.java +++ b/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplSwitch.java @@ -1,71 +1,89 @@ package com.ruoyi.template.domain; +import com.ruoyi.common.core.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.List; /** * 交换机模板表 tmpl_switch - * + * * @author TP * @date 2019-06-12 */ -public class TmplSwitch extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 交换机模板编号 */ - private Integer switchId; - /** 交换机品牌 */ - private String switchBrand; - /** 交换机型号 */ - private String switchType; - /** 交换机电源数量 */ - private Integer powerNum; +public class TmplSwitch extends BaseEntity { + private static final long serialVersionUID = 1L; - public void setSwitchId(Integer switchId) - { - this.switchId = switchId; - } + /** + * 交换机模板编号 + */ + private Integer switchId; + /** + * 交换机品牌 + */ + private String switchBrand; + /** + * 交换机型号 + */ + private String switchType; + /** + * 交换机电源数量 + */ + private Integer powerNum; + /** + * 交换机端口类型 + */ + private List switchPorts; - public Integer getSwitchId() - { - return switchId; - } - public void setSwitchBrand(String switchBrand) - { - this.switchBrand = switchBrand; - } + public void setSwitchId(Integer switchId) { + this.switchId = switchId; + } - public String getSwitchBrand() - { - return switchBrand; - } - public void setSwitchType(String switchType) - { - this.switchType = switchType; - } + public Integer getSwitchId() { + return switchId; + } - public String getSwitchType() - { - return switchType; - } - public void setPowerNum(Integer powerNum) - { - this.powerNum = powerNum; - } + public void setSwitchBrand(String switchBrand) { + this.switchBrand = switchBrand; + } - public Integer getPowerNum() - { - return powerNum; - } + public String getSwitchBrand() { + return switchBrand; + } + public void setSwitchType(String switchType) { + this.switchType = switchType; + } + + public String getSwitchType() { + return switchType; + } + + public void setPowerNum(Integer powerNum) { + this.powerNum = powerNum; + } + + public Integer getPowerNum() { + return powerNum; + } + + public List getSwitchPorts() { + return switchPorts; + } + + public void setSwitchPorts(List switchPorts) { + this.switchPorts = switchPorts; + } + + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("switchId", getSwitchId()) - .append("switchBrand", getSwitchBrand()) - .append("switchType", getSwitchType()) - .append("powerNum", getPowerNum()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("switchId", getSwitchId()) + .append("switchBrand", getSwitchBrand()) + .append("switchType", getSwitchType()) + .append("powerNum", getPowerNum()) + .append("switchPorts", getSwitchPorts()) + .toString(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplSwitchPort.java b/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplSwitchPort.java new file mode 100755 index 000000000..95199a3da --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/template/domain/TmplSwitchPort.java @@ -0,0 +1,74 @@ +package com.ruoyi.template.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 交换机端口类型(不用代码生成工具)表 tmpl_switch_port + * + * @author TP + * @date 2019-06-12 + */ +public class TmplSwitchPort extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 交换机端口编号 + */ + private Integer switchPortId; + /** + * 交换机模板编号 + */ + private Integer switchId; + /** + * 交换机端口类型 + */ + private Integer switchPortType; + /** + * 交换机端口数量 + */ + private Integer switchPortNum; + + public void setSwitchPortId(Integer switchPortId) { + this.switchPortId = switchPortId; + } + + public Integer getSwitchPortId() { + return switchPortId; + } + + public void setSwitchId(Integer switchId) { + this.switchId = switchId; + } + + public Integer getSwitchId() { + return switchId; + } + + public void setSwitchPortType(Integer switchPortType) { + this.switchPortType = switchPortType; + } + + public Integer getSwitchPortType() { + return switchPortType; + } + + public void setSwitchPortNum(Integer switchPortNum) { + this.switchPortNum = switchPortNum; + } + + public Integer getSwitchPortNum() { + return switchPortNum; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("switchPortId", getSwitchPortId()) + .append("switchId", getSwitchId()) + .append("switchPortType", getSwitchPortType()) + .append("switchPortNum", getSwitchPortNum()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml index 2b0e6857f..5228ce3d3 100644 --- a/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchMapper.xml @@ -1,49 +1,71 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - + + + + + + + + + + - - - select switch_id, switch_brand, switch_type, power_num from tmpl_switch + + + + + + 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 - + - + - + insert into tmpl_switch - - switch_brand, - switch_type, - power_num, - + + switch_brand, + switch_type, + power_num, + - #{switchBrand}, - #{switchType}, - #{powerNum}, - + #{switchBrand}, + #{switchType}, + #{powerNum}, + - + update tmpl_switch @@ -54,15 +76,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where switch_id = #{switchId} - + delete from tmpl_switch where switch_id = #{switchId} - + - delete from tmpl_switch where switch_id in + delete from tmpl_switch where switch_id in #{switchId} - + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/template/TmplSwitchPortMapper.xml b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchPortMapper.xml new file mode 100755 index 000000000..33a6cb83a --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/template/TmplSwitchPortMapper.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + 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}, + + + + + 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 in + + #{switchPortId} + + + + \ No newline at end of file