From 73998f4e5640686b2091bb2292f63decb00ab76e Mon Sep 17 00:00:00 2001 From: yuemian <--list> Date: Mon, 2 Sep 2024 16:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E7=BF=BC=E4=BA=91-=E7=89=A9=E7=90=86?= =?UTF-8?q?=E6=9C=BA=E6=9F=A5=E8=AF=A2=E3=80=81=E7=BC=96=E8=BE=91=E3=80=81?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/database/add.sql | 1 + .../bocloud/cmp/entity/PhysicalServer.java | 3 + .../repository/PhysicalServerRepository.java | 56 ------------------- 3 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 src/main/java/com/bocloud/cmp/repository/PhysicalServerRepository.java diff --git a/src/main/database/add.sql b/src/main/database/add.sql index fd6f88e..f0159cb 100644 --- a/src/main/database/add.sql +++ b/src/main/database/add.sql @@ -39,5 +39,6 @@ CREATE TABLE `physical_server` ( `tenant_id` bigint DEFAULT NULL COMMENT '租户id', `project_id` bigint DEFAULT NULL COMMENT '项目id', `is_deleted` tinyint(1) DEFAULT NULL COMMENT '是否删除', + `display_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '展示名称', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; \ No newline at end of file diff --git a/src/main/java/com/bocloud/cmp/entity/PhysicalServer.java b/src/main/java/com/bocloud/cmp/entity/PhysicalServer.java index 0f508c5..ca8a06b 100644 --- a/src/main/java/com/bocloud/cmp/entity/PhysicalServer.java +++ b/src/main/java/com/bocloud/cmp/entity/PhysicalServer.java @@ -128,6 +128,9 @@ public class PhysicalServer extends Generic { @Column("creator_id") private Long creatorId; + @Column("mender_id") + private Long menderId; + @Column("tenant_id") private Long tenantId; diff --git a/src/main/java/com/bocloud/cmp/repository/PhysicalServerRepository.java b/src/main/java/com/bocloud/cmp/repository/PhysicalServerRepository.java deleted file mode 100644 index 5284ebf..0000000 --- a/src/main/java/com/bocloud/cmp/repository/PhysicalServerRepository.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.bocloud.cmp.repository; - -import com.bocloud.cmp.entity.PhysicalServer; -import com.megatron.common.utils.Common; -import com.megatron.common.utils.MapTools; -import com.megatron.database.core.intf.impl.BasicGenericDao; -import com.megatron.framework.core.CurrentService; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Repository; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 物理服务器数据访问 - * - * @author wangyu - * @version 1.0 - * @since 2020年5月15日 - */ -@Repository("serverRepository") -public class PhysicalServerRepository extends BasicGenericDao { - - - public PhysicalServerRepository(JdbcTemplate jdbcTemplate, NamedParameterJdbcTemplate npJdbcTemplate, CurrentService service) { - super(jdbcTemplate, npJdbcTemplate, service); - } - - public List listByVendor(Long vendorId) { - String sql = "select a.* from physical_server a where a.is_deleted = 0"; - Map params = new HashMap<>(8); - if (null != vendorId) { - sql += " and a.vendor_id = :vendorId"; - params.put(Common.VENDORID, vendorId); - } - return this.list(PhysicalServer.class, sql, params); - } - - public boolean removeByVendor(Long vendorId, Long userId) { - String sql = "update physical_server set is_deleted = true , gmt_modify = :gmtModify where is_deleted = 0 and vendor_id = :vendorId"; - Map params = MapTools.simpleMap(Common.VENDORID, vendorId); - params.put("gmtModify", new Date()); - return this.execute(sql, params) > 0; - } - - public boolean remove(Long id, Long userId) { - String sql = "update physical_server set is_deleted = true,gmt_modify = :gmtModify where is_deleted = 0 and id = :id"; - Map params = MapTools.simpleMap("id", id); - params.put("gmtModify", new Date()); - return this.execute(sql, params) > 0; - } - -}