资源注册模块java代码
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.system.domain.RmResourceRegistration;
|
||||
import com.ruoyi.system.service.IRmResourceRegistrationService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 资源注册Controller
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-08-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/registration")
|
||||
public class RmResourceRegistrationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRmResourceRegistrationService rmResourceRegistrationService;
|
||||
|
||||
/**
|
||||
* 查询资源注册列表
|
||||
*/
|
||||
@RequiresPermissions("system:registration:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RmResourceRegistration rmResourceRegistration)
|
||||
{
|
||||
startPage();
|
||||
List<RmResourceRegistration> list = rmResourceRegistrationService.selectRmResourceRegistrationList(rmResourceRegistration);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资源注册列表
|
||||
*/
|
||||
@RequiresPermissions("system:registration:export")
|
||||
@Log(title = "资源注册", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RmResourceRegistration rmResourceRegistration)
|
||||
{
|
||||
List<RmResourceRegistration> list = rmResourceRegistrationService.selectRmResourceRegistrationList(rmResourceRegistration);
|
||||
ExcelUtil<RmResourceRegistration> util = new ExcelUtil<RmResourceRegistration>(RmResourceRegistration.class);
|
||||
util.exportExcel(response, list, "资源注册数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源注册详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:registration:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rmResourceRegistrationService.selectRmResourceRegistrationById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资源注册
|
||||
*/
|
||||
@RequiresPermissions("system:registration:add")
|
||||
@Log(title = "资源注册", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RmResourceRegistration rmResourceRegistration)
|
||||
{
|
||||
return toAjax(rmResourceRegistrationService.insertRmResourceRegistration(rmResourceRegistration));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资源注册
|
||||
*/
|
||||
@RequiresPermissions("system:registration:edit")
|
||||
@Log(title = "资源注册", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RmResourceRegistration rmResourceRegistration)
|
||||
{
|
||||
return toAjax(rmResourceRegistrationService.updateRmResourceRegistration(rmResourceRegistration));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资源注册
|
||||
*/
|
||||
@RequiresPermissions("system:registration:remove")
|
||||
@Log(title = "资源注册", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rmResourceRegistrationService.deleteRmResourceRegistrationByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,354 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 资源注册对象 rm_resource_registration
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-08-12
|
||||
*/
|
||||
public class RmResourceRegistration extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 硬件SN */
|
||||
@Excel(name = "硬件SN")
|
||||
private String hardwareSn;
|
||||
|
||||
/** 资源类型
|
||||
* 1 服务器,2 交换机*/
|
||||
@Excel(name = "资源类型")
|
||||
private String resourceType;
|
||||
|
||||
/** 资源名称 */
|
||||
@Excel(name = "资源名称")
|
||||
private String resourceName;
|
||||
|
||||
/** IP地址 */
|
||||
@Excel(name = "IP地址")
|
||||
private String ipAddress;
|
||||
|
||||
/** 端口1.162(SNMP),2.其他 */
|
||||
@Excel(name = "端口")
|
||||
private String resourcePort;
|
||||
|
||||
|
||||
/** 协议 1.TCP,2.UDP */
|
||||
@Excel(name = "协议")
|
||||
private String protocol;
|
||||
|
||||
|
||||
/** 版本(1.SNMPv2,2.SNMPv3) */
|
||||
@Excel(name = "版本")
|
||||
private String resourceVersion;
|
||||
|
||||
/** 读写权限(1.RW,2.ReadOnly) */
|
||||
@Excel(name = "读写权限")
|
||||
private String rwPermission;
|
||||
|
||||
/** 安全级别(1.authPriv、2.authNoPriv,3.noAuthNoPriv) */
|
||||
@Excel(name = "安全级别")
|
||||
private String securityLevel;
|
||||
|
||||
/** 加密方式 1.md5,2.SHA */
|
||||
@Excel(name = "加密方式")
|
||||
private String encryption;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String resourcePwd;
|
||||
|
||||
/** 注册状态 0-未注册,1-未注册 */
|
||||
@Excel(name = "注册状态")
|
||||
private String registrationStatus;
|
||||
|
||||
/** 在线状态 0-离线,1-在线 */
|
||||
@Excel(name = "在线状态")
|
||||
private String onlineStatus;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
|
||||
/** 设备业务客户id */
|
||||
private Long customerId;
|
||||
|
||||
/** 设备业务客户名称 */
|
||||
@Excel(name = "设备业务客户")
|
||||
private String customerName;
|
||||
|
||||
/** 业务号 */
|
||||
@Excel(name = "业务号")
|
||||
private String serviceNumber;
|
||||
|
||||
/** 创建人id */
|
||||
private Long creatorId;
|
||||
|
||||
/** 创建人名称 */
|
||||
private String creatorName;
|
||||
|
||||
/** 修改人id */
|
||||
private Long updaterId;
|
||||
|
||||
/** 修改人名称 */
|
||||
private String updaterName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setHardwareSn(String hardwareSn)
|
||||
{
|
||||
this.hardwareSn = hardwareSn;
|
||||
}
|
||||
|
||||
public String getHardwareSn()
|
||||
{
|
||||
return hardwareSn;
|
||||
}
|
||||
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
|
||||
public void setResourceName(String resourceName)
|
||||
{
|
||||
this.resourceName = resourceName;
|
||||
}
|
||||
|
||||
public String getResourceName()
|
||||
{
|
||||
return resourceName;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress)
|
||||
{
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public String getIpAddress()
|
||||
{
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setResourcePort(String resourcePort)
|
||||
{
|
||||
this.resourcePort = resourcePort;
|
||||
}
|
||||
|
||||
public String getResourcePort()
|
||||
{
|
||||
return resourcePort;
|
||||
}
|
||||
|
||||
public void setProtocol(String protocol)
|
||||
{
|
||||
this.protocol = protocol;
|
||||
}
|
||||
|
||||
public String getProtocol()
|
||||
{
|
||||
return protocol;
|
||||
}
|
||||
|
||||
public void setResourceVersion(String resourceVersion)
|
||||
{
|
||||
this.resourceVersion = resourceVersion;
|
||||
}
|
||||
|
||||
public String getResourceVersion()
|
||||
{
|
||||
return resourceVersion;
|
||||
}
|
||||
|
||||
public void setRwPermission(String rwPermission)
|
||||
{
|
||||
this.rwPermission = rwPermission;
|
||||
}
|
||||
|
||||
public String getRwPermission()
|
||||
{
|
||||
return rwPermission;
|
||||
}
|
||||
|
||||
public void setSecurityLevel(String securityLevel)
|
||||
{
|
||||
this.securityLevel = securityLevel;
|
||||
}
|
||||
|
||||
public String getSecurityLevel()
|
||||
{
|
||||
return securityLevel;
|
||||
}
|
||||
|
||||
public void setEncryption(String encryption)
|
||||
{
|
||||
this.encryption = encryption;
|
||||
}
|
||||
|
||||
public String getEncryption()
|
||||
{
|
||||
return encryption;
|
||||
}
|
||||
|
||||
public void setResourcePwd(String resourcePwd)
|
||||
{
|
||||
this.resourcePwd = resourcePwd;
|
||||
}
|
||||
|
||||
public String getResourcePwd()
|
||||
{
|
||||
return resourcePwd;
|
||||
}
|
||||
|
||||
public void setRegistrationStatus(String registrationStatus)
|
||||
{
|
||||
this.registrationStatus = registrationStatus;
|
||||
}
|
||||
|
||||
public String getRegistrationStatus()
|
||||
{
|
||||
return registrationStatus;
|
||||
}
|
||||
|
||||
public void setOnlineStatus(String onlineStatus)
|
||||
{
|
||||
this.onlineStatus = onlineStatus;
|
||||
}
|
||||
|
||||
public String getOnlineStatus()
|
||||
{
|
||||
return onlineStatus;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setCustomerId(Long customerId)
|
||||
{
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public Long getCustomerId()
|
||||
{
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public void setCustomerName(String customerName)
|
||||
{
|
||||
this.customerName = customerName;
|
||||
}
|
||||
|
||||
public String getCustomerName()
|
||||
{
|
||||
return customerName;
|
||||
}
|
||||
|
||||
public void setServiceNumber(String serviceNumber)
|
||||
{
|
||||
this.serviceNumber = serviceNumber;
|
||||
}
|
||||
|
||||
public String getServiceNumber()
|
||||
{
|
||||
return serviceNumber;
|
||||
}
|
||||
|
||||
public void setCreatorId(Long creatorId)
|
||||
{
|
||||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public Long getCreatorId()
|
||||
{
|
||||
return creatorId;
|
||||
}
|
||||
|
||||
public void setCreatorName(String creatorName)
|
||||
{
|
||||
this.creatorName = creatorName;
|
||||
}
|
||||
|
||||
public String getCreatorName()
|
||||
{
|
||||
return creatorName;
|
||||
}
|
||||
|
||||
public void setUpdaterId(Long updaterId)
|
||||
{
|
||||
this.updaterId = updaterId;
|
||||
}
|
||||
|
||||
public Long getUpdaterId()
|
||||
{
|
||||
return updaterId;
|
||||
}
|
||||
|
||||
public void setUpdaterName(String updaterName)
|
||||
{
|
||||
this.updaterName = updaterName;
|
||||
}
|
||||
|
||||
public String getUpdaterName()
|
||||
{
|
||||
return updaterName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("hardwareSn", getHardwareSn())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("resourceName", getResourceName())
|
||||
.append("ipAddress", getIpAddress())
|
||||
.append("resourcePort", getResourcePort())
|
||||
.append("protocol", getProtocol())
|
||||
.append("resourceVersion", getResourceVersion())
|
||||
.append("rwPermission", getRwPermission())
|
||||
.append("securityLevel", getSecurityLevel())
|
||||
.append("encryption", getEncryption())
|
||||
.append("resourcePwd", getResourcePwd())
|
||||
.append("registrationStatus", getRegistrationStatus())
|
||||
.append("onlineStatus", getOnlineStatus())
|
||||
.append("description", getDescription())
|
||||
.append("customerId", getCustomerId())
|
||||
.append("customerName", getCustomerName())
|
||||
.append("serviceNumber", getServiceNumber())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("creatorId", getCreatorId())
|
||||
.append("creatorName", getCreatorName())
|
||||
.append("updaterId", getUpdaterId())
|
||||
.append("updaterName", getUpdaterName())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.RmResourceRegistration;
|
||||
|
||||
/**
|
||||
* 资源注册Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-08-12
|
||||
*/
|
||||
public interface RmResourceRegistrationMapper
|
||||
{
|
||||
/**
|
||||
* 查询资源注册
|
||||
*
|
||||
* @param id 资源注册主键
|
||||
* @return 资源注册
|
||||
*/
|
||||
public RmResourceRegistration selectRmResourceRegistrationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资源注册列表
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 资源注册集合
|
||||
*/
|
||||
public List<RmResourceRegistration> selectRmResourceRegistrationList(RmResourceRegistration rmResourceRegistration);
|
||||
|
||||
/**
|
||||
* 新增资源注册
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmResourceRegistration(RmResourceRegistration rmResourceRegistration);
|
||||
|
||||
/**
|
||||
* 修改资源注册
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmResourceRegistration(RmResourceRegistration rmResourceRegistration);
|
||||
|
||||
/**
|
||||
* 删除资源注册
|
||||
*
|
||||
* @param id 资源注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmResourceRegistrationById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除资源注册
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmResourceRegistrationByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.RmResourceRegistration;
|
||||
|
||||
/**
|
||||
* 资源注册Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-08-12
|
||||
*/
|
||||
public interface IRmResourceRegistrationService
|
||||
{
|
||||
/**
|
||||
* 查询资源注册
|
||||
*
|
||||
* @param id 资源注册主键
|
||||
* @return 资源注册
|
||||
*/
|
||||
public RmResourceRegistration selectRmResourceRegistrationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资源注册列表
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 资源注册集合
|
||||
*/
|
||||
public List<RmResourceRegistration> selectRmResourceRegistrationList(RmResourceRegistration rmResourceRegistration);
|
||||
|
||||
/**
|
||||
* 新增资源注册
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmResourceRegistration(RmResourceRegistration rmResourceRegistration);
|
||||
|
||||
/**
|
||||
* 修改资源注册
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmResourceRegistration(RmResourceRegistration rmResourceRegistration);
|
||||
|
||||
/**
|
||||
* 批量删除资源注册
|
||||
*
|
||||
* @param ids 需要删除的资源注册主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmResourceRegistrationByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除资源注册信息
|
||||
*
|
||||
* @param id 资源注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmResourceRegistrationById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.RmResourceRegistrationMapper;
|
||||
import com.ruoyi.system.domain.RmResourceRegistration;
|
||||
import com.ruoyi.system.service.IRmResourceRegistrationService;
|
||||
|
||||
/**
|
||||
* 资源注册Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-08-12
|
||||
*/
|
||||
@Service
|
||||
public class RmResourceRegistrationServiceImpl implements IRmResourceRegistrationService
|
||||
{
|
||||
@Autowired
|
||||
private RmResourceRegistrationMapper rmResourceRegistrationMapper;
|
||||
@Autowired
|
||||
private SysDictDataMapper sysDictDataMapper;
|
||||
|
||||
/**
|
||||
* 查询资源注册
|
||||
*
|
||||
* @param id 资源注册主键
|
||||
* @return 资源注册
|
||||
*/
|
||||
@Override
|
||||
public RmResourceRegistration selectRmResourceRegistrationById(Long id)
|
||||
{
|
||||
return rmResourceRegistrationMapper.selectRmResourceRegistrationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资源注册列表
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 资源注册
|
||||
*/
|
||||
@Override
|
||||
public List<RmResourceRegistration> selectRmResourceRegistrationList(RmResourceRegistration rmResourceRegistration)
|
||||
{
|
||||
List<RmResourceRegistration> rmResourceRegistrationList = rmResourceRegistrationMapper.selectRmResourceRegistrationList(rmResourceRegistration);
|
||||
return rmResourceRegistrationList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资源注册
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRmResourceRegistration(RmResourceRegistration rmResourceRegistration)
|
||||
{
|
||||
rmResourceRegistration.setCreatorId(SecurityUtils.getUserId());
|
||||
rmResourceRegistration.setCreatorName(SecurityUtils.getUsername());
|
||||
rmResourceRegistration.setCreateTime(DateUtils.getNowDate());
|
||||
return rmResourceRegistrationMapper.insertRmResourceRegistration(rmResourceRegistration);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资源注册
|
||||
*
|
||||
* @param rmResourceRegistration 资源注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRmResourceRegistration(RmResourceRegistration rmResourceRegistration)
|
||||
{
|
||||
rmResourceRegistration.setUpdateTime(DateUtils.getNowDate());
|
||||
rmResourceRegistration.setUpdaterId(SecurityUtils.getUserId());
|
||||
rmResourceRegistration.setUpdaterName(SecurityUtils.getUsername());
|
||||
return rmResourceRegistrationMapper.updateRmResourceRegistration(rmResourceRegistration);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资源注册
|
||||
*
|
||||
* @param ids 需要删除的资源注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmResourceRegistrationByIds(Long[] ids)
|
||||
{
|
||||
return rmResourceRegistrationMapper.deleteRmResourceRegistrationByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资源注册信息
|
||||
*
|
||||
* @param id 资源注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmResourceRegistrationById(Long id)
|
||||
{
|
||||
return rmResourceRegistrationMapper.deleteRmResourceRegistrationById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RmResourceRegistrationMapper">
|
||||
|
||||
<resultMap type="RmResourceRegistration" id="RmResourceRegistrationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="hardwareSn" column="hardware_sn" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="resourceName" column="resource_name" />
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="resourcePort" column="resource_port" />
|
||||
<result property="protocol" column="protocol" />
|
||||
<result property="resourceVersion" column="resource_version" />
|
||||
<result property="rwPermission" column="rw_permission" />
|
||||
<result property="securityLevel" column="security_level" />
|
||||
<result property="encryption" column="encryption" />
|
||||
<result property="resourcePwd" column="resource_pwd" />
|
||||
<result property="registrationStatus" column="registration_status" />
|
||||
<result property="onlineStatus" column="online_status" />
|
||||
<result property="description" column="description" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="serviceNumber" column="service_number" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="creatorId" column="creator_id" />
|
||||
<result property="creatorName" column="creator_name" />
|
||||
<result property="updaterId" column="updater_id" />
|
||||
<result property="updaterName" column="updater_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmResourceRegistrationVo">
|
||||
select id, hardware_sn, resource_type, resource_name, ip_address, resource_port, protocol, resource_version, rw_permission, security_level, encryption, resource_pwd, registration_status, online_status, description, customer_id, customer_name, service_number, create_time, update_time, creator_id, creator_name, updater_id, updater_name from rm_resource_registration
|
||||
</sql>
|
||||
|
||||
<select id="selectRmResourceRegistrationList" parameterType="RmResourceRegistration" resultMap="RmResourceRegistrationResult">
|
||||
<include refid="selectRmResourceRegistrationVo"/>
|
||||
<where>
|
||||
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
||||
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
|
||||
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
|
||||
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
|
||||
<if test="resourcePort != null and resourcePort != ''"> and resource_port = #{resourcePort}</if>
|
||||
<if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
|
||||
<if test="resourceVersion != null and resourceVersion != ''"> and resource_version = #{resourceVersion}</if>
|
||||
<if test="rwPermission != null and rwPermission != ''"> and rw_permission = #{rwPermission}</if>
|
||||
<if test="securityLevel != null and securityLevel != ''"> and security_level = #{securityLevel}</if>
|
||||
<if test="encryption != null and encryption != ''"> and encryption = #{encryption}</if>
|
||||
<if test="resourcePwd != null and resourcePwd != ''"> and resource_pwd = #{resourcePwd}</if>
|
||||
<if test="registrationStatus != null and registrationStatus != ''"> and registration_status = #{registrationStatus}</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="customerId != null "> and customer_id = #{customerId}</if>
|
||||
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
||||
<if test="serviceNumber != null and serviceNumber != ''"> and service_number = #{serviceNumber}</if>
|
||||
<if test="creatorId != null "> and creator_id = #{creatorId}</if>
|
||||
<if test="creatorName != null and creatorName != ''"> and creator_name like concat('%', #{creatorName}, '%')</if>
|
||||
<if test="updaterId != null "> and updater_id = #{updaterId}</if>
|
||||
<if test="updaterName != null and updaterName != ''"> and updater_name like concat('%', #{updaterName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmResourceRegistrationById" parameterType="Long" resultMap="RmResourceRegistrationResult">
|
||||
<include refid="selectRmResourceRegistrationVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmResourceRegistration" parameterType="RmResourceRegistration" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_resource_registration
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hardwareSn != null">hardware_sn,</if>
|
||||
<if test="resourceType != null">resource_type,</if>
|
||||
<if test="resourceName != null">resource_name,</if>
|
||||
<if test="ipAddress != null">ip_address,</if>
|
||||
<if test="resourcePort != null">resource_port,</if>
|
||||
<if test="protocol != null">protocol,</if>
|
||||
<if test="resourceVersion != null">resource_version,</if>
|
||||
<if test="rwPermission != null">rw_permission,</if>
|
||||
<if test="securityLevel != null">security_level,</if>
|
||||
<if test="encryption != null">encryption,</if>
|
||||
<if test="resourcePwd != null">resource_pwd,</if>
|
||||
<if test="registrationStatus != null">registration_status,</if>
|
||||
<if test="onlineStatus != null">online_status,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="customerName != null">customer_name,</if>
|
||||
<if test="serviceNumber != null">service_number,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="creatorId != null">creator_id,</if>
|
||||
<if test="creatorName != null">creator_name,</if>
|
||||
<if test="updaterId != null">updater_id,</if>
|
||||
<if test="updaterName != null">updater_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hardwareSn != null">#{hardwareSn},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
<if test="resourceName != null">#{resourceName},</if>
|
||||
<if test="ipAddress != null">#{ipAddress},</if>
|
||||
<if test="resourcePort != null">#{resourcePort},</if>
|
||||
<if test="protocol != null">#{protocol},</if>
|
||||
<if test="resourceVersion != null">#{resourceVersion},</if>
|
||||
<if test="rwPermission != null">#{rwPermission},</if>
|
||||
<if test="securityLevel != null">#{securityLevel},</if>
|
||||
<if test="encryption != null">#{encryption},</if>
|
||||
<if test="resourcePwd != null">#{resourcePwd},</if>
|
||||
<if test="registrationStatus != null">#{registrationStatus},</if>
|
||||
<if test="onlineStatus != null">#{onlineStatus},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="customerName != null">#{customerName},</if>
|
||||
<if test="serviceNumber != null">#{serviceNumber},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="creatorId != null">#{creatorId},</if>
|
||||
<if test="creatorName != null">#{creatorName},</if>
|
||||
<if test="updaterId != null">#{updaterId},</if>
|
||||
<if test="updaterName != null">#{updaterName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmResourceRegistration" parameterType="RmResourceRegistration">
|
||||
update rm_resource_registration
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hardwareSn != null">hardware_sn = #{hardwareSn},</if>
|
||||
<if test="resourceType != null">resource_type = #{resourceType},</if>
|
||||
<if test="resourceName != null">resource_name = #{resourceName},</if>
|
||||
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
|
||||
<if test="resourcePort != null">resource_port = #{resourcePort},</if>
|
||||
<if test="protocol != null">protocol = #{protocol},</if>
|
||||
<if test="resourceVersion != null">resource_version = #{resourceVersion},</if>
|
||||
<if test="rwPermission != null">rw_permission = #{rwPermission},</if>
|
||||
<if test="securityLevel != null">security_level = #{securityLevel},</if>
|
||||
<if test="encryption != null">encryption = #{encryption},</if>
|
||||
<if test="resourcePwd != null">resource_pwd = #{resourcePwd},</if>
|
||||
<if test="registrationStatus != null">registration_status = #{registrationStatus},</if>
|
||||
<if test="onlineStatus != null">online_status = #{onlineStatus},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="customerName != null">customer_name = #{customerName},</if>
|
||||
<if test="serviceNumber != null">service_number = #{serviceNumber},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="creatorId != null">creator_id = #{creatorId},</if>
|
||||
<if test="creatorName != null">creator_name = #{creatorName},</if>
|
||||
<if test="updaterId != null">updater_id = #{updaterId},</if>
|
||||
<if test="updaterName != null">updater_name = #{updaterName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmResourceRegistrationById" parameterType="Long">
|
||||
delete from rm_resource_registration where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmResourceRegistrationByIds" parameterType="String">
|
||||
delete from rm_resource_registration where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user