更新Company生成子資料庫
This commit is contained in:
parent
faf77371a7
commit
cbb5afd9be
@ -773,5 +773,6 @@ namespace SolarPower.Controllers
|
|||||||
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||||
return apiResult;
|
return apiResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2064,14 +2064,14 @@ namespace SolarPower.Controllers
|
|||||||
|
|
||||||
if (inverter != null)
|
if (inverter != null)
|
||||||
{
|
{
|
||||||
apiResult.Code = "0099";
|
apiResult.Code = "0002";
|
||||||
apiResult.Msg = "請先刪除相關逆變器";
|
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||||
return apiResult;
|
return apiResult;
|
||||||
}
|
}
|
||||||
if (device != null)
|
if (device != null)
|
||||||
{
|
{
|
||||||
apiResult.Code = "0099";
|
apiResult.Code = "0003";
|
||||||
apiResult.Msg = "請先刪除相關設備";
|
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||||
return apiResult;
|
return apiResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@ namespace SolarPower.Models
|
|||||||
{
|
{
|
||||||
{ "0000", "OK" },
|
{ "0000", "OK" },
|
||||||
{ "0001", "傳入參數錯誤。" },
|
{ "0001", "傳入參數錯誤。" },
|
||||||
|
{ "0002","請先刪除相關逆變器"},
|
||||||
|
{ "0003","請先刪除相關設備"},
|
||||||
{ "9986", "該帳號已被註冊,請重新輸入"},
|
{ "9986", "該帳號已被註冊,請重新輸入"},
|
||||||
{ "9987", "查無該運維作業記錄檔案"},
|
{ "9987", "查無該運維作業記錄檔案"},
|
||||||
{ "9988", "查無該資料紀錄"},
|
{ "9988", "查無該資料紀錄"},
|
||||||
|
|||||||
@ -520,13 +520,17 @@ namespace SolarPower.Models.PowerStation
|
|||||||
public string CreatedName { get; set; }
|
public string CreatedName { get; set; }
|
||||||
public string Function { get; set; }
|
public string Function { get; set; }
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 下拉式選單用
|
||||||
|
/// </summary>
|
||||||
public class PowerstationOption
|
public class PowerstationOption
|
||||||
{
|
{
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 共享設備
|
||||||
|
/// </summary>
|
||||||
public class Sharedevice : Created
|
public class Sharedevice : Created
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|||||||
@ -428,46 +428,76 @@ namespace SolarPower.Repository.Implement
|
|||||||
CREATE DATABASE IF NOT EXISTS `{db_name}`;
|
CREATE DATABASE IF NOT EXISTS `{db_name}`;
|
||||||
USE `{db_name}`;
|
USE `{db_name}`;
|
||||||
|
|
||||||
|
-- 傾印 資料表 controller 結構
|
||||||
|
CREATE TABLE IF NOT EXISTS `controller` (
|
||||||
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
|
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所屬電站編號',
|
||||||
|
`ControllerId` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '控制器編號',
|
||||||
|
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '控制器各電站流水號',
|
||||||
|
`CreatedBy` int(10) unsigned NOT NULL,
|
||||||
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`UpdatedBy` int(10) unsigned DEFAULT NULL,
|
||||||
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`Id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='控制器';
|
||||||
|
|
||||||
-- 傾印 資料表 device 結構
|
-- 傾印 資料表 device 結構
|
||||||
CREATE TABLE IF NOT EXISTS `device` (
|
CREATE TABLE IF NOT EXISTS `device` (
|
||||||
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`Deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否刪除, 0:否 1:是',
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
`UID` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '設備編號,縣市 +區域+電廠流水號(0001~9999)+設備類別(字母:3碼) + SN(設備流水號;3碼)',
|
`UID` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '設備編號,縣市 +區域+電廠流水號(0001~9999)+設備類別(字母:3碼) + SN(設備流水號;3碼)',
|
||||||
`PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '所屬電站編號',
|
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所屬電站編號',
|
||||||
`Name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱',
|
`SerialNumber` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT '0' COMMENT '設備流水號',
|
||||||
`Type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '類型',
|
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱',
|
||||||
`TypeName` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '類型名稱',
|
`Type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '類型',
|
||||||
`Brand` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '廠牌',
|
`TypeName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '類型名稱',
|
||||||
`ProductModel` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '型號',
|
`ControllerId` int(10) unsigned DEFAULT NULL COMMENT '控制器Id',
|
||||||
`DBName` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
`Brand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '廠牌',
|
||||||
`TableName` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
`ProductModel` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '型號',
|
||||||
`ColName` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
`DBName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`Remark` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
`TableName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`ColName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`Remark` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '備註',
|
||||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||||
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '建立時間',
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||||
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
||||||
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '修改時間',
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||||
PRIMARY KEY (`Id`) USING BTREE,
|
PRIMARY KEY (`Id`) USING BTREE,
|
||||||
KEY `IDX_01` (`Deleted`) USING BTREE,
|
KEY `IDX_01` (`Deleted`) USING BTREE,
|
||||||
KEY `IDX_02` (`UID`,`PowerStationId`)
|
KEY `IDX_02` (`UID`,`PowerStationId`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='裝置列表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='裝置列表';
|
||||||
|
|
||||||
|
-- 傾印 資料表 inverter 結構
|
||||||
|
CREATE TABLE IF NOT EXISTS `inverter` (
|
||||||
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '流水號',
|
||||||
|
`Deleted` tinyint(4) DEFAULT '0' COMMENT '是否刪除',
|
||||||
|
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '逆變器流水號(用控制器排序)',
|
||||||
|
`InverterId` varchar(50) DEFAULT NULL COMMENT '逆變器UID',
|
||||||
|
`ControllerId` int(10) DEFAULT NULL COMMENT '所屬控制器',
|
||||||
|
`CreatedBy` int(10) unsigned NOT NULL,
|
||||||
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`UpdatedBy` int(10) DEFAULT NULL,
|
||||||
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`Id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='逆變器';
|
||||||
|
|
||||||
-- 傾印 資料表 land_building 結構
|
-- 傾印 資料表 land_building 結構
|
||||||
CREATE TABLE IF NOT EXISTS `land_building` (
|
CREATE TABLE IF NOT EXISTS `land_building` (
|
||||||
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`Deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否刪除, 0:否 1:是',
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
`PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '所屬電站編號',
|
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所屬電站編號',
|
||||||
`Address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地址',
|
`Address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地址',
|
||||||
`LeaseNotarizationAt` timestamp NULL DEFAULT NULL COMMENT '租約公證日期',
|
`LeaseNotarizationAt` timestamp NULL DEFAULT NULL COMMENT '租約公證日期',
|
||||||
`Landowner` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地主姓名',
|
`Landowner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地主姓名',
|
||||||
`Purpose` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '房屋用途',
|
`Purpose` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '房屋用途',
|
||||||
`LeaseRate` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '租金比例(%)',
|
`LeaseRate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '租金比例(%)',
|
||||||
`Coordinate` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座標',
|
`Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座標',
|
||||||
`Phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電話',
|
`Phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電話',
|
||||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||||
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '建立時間',
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||||
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
||||||
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '修改時間',
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||||
PRIMARY KEY (`Id`),
|
PRIMARY KEY (`Id`),
|
||||||
KEY `IDX_01` (`Deleted`,`PowerStationId`)
|
KEY `IDX_01` (`Deleted`,`PowerStationId`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='土地與房屋';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='土地與房屋';
|
||||||
@ -475,71 +505,71 @@ namespace SolarPower.Repository.Implement
|
|||||||
-- 傾印 資料表 operation_firm 結構
|
-- 傾印 資料表 operation_firm 結構
|
||||||
CREATE TABLE IF NOT EXISTS `operation_firm` (
|
CREATE TABLE IF NOT EXISTS `operation_firm` (
|
||||||
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`Deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否刪除, 0:否 1:是',
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
`PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '所屬電站編號',
|
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所屬電站編號',
|
||||||
`Name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱',
|
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱',
|
||||||
`Type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '廠商類別,0:施工 1:清洗 2:運維',
|
`Type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '廠商類別,0:施工 1:清洗 2:運維',
|
||||||
`ContactPerson` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '聯絡人',
|
`ContactPerson` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '聯絡人',
|
||||||
`Phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電話',
|
`Phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電話',
|
||||||
`Email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Email',
|
`Email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Email',
|
||||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||||
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '建立時間',
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||||
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
||||||
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '修改時間',
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||||
PRIMARY KEY (`Id`),
|
PRIMARY KEY (`Id`),
|
||||||
KEY `IDX_01` (`Deleted`,`PowerStationId`)
|
KEY `IDX_01` (`Deleted`,`PowerStationId`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='運維廠商';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='運維廠商';
|
||||||
|
|
||||||
-- 傾印 資料表 power_station 結構
|
-- 傾印 資料表 power_station 結構
|
||||||
CREATE TABLE IF NOT EXISTS `power_station` (
|
CREATE TABLE IF NOT EXISTS `power_station` (
|
||||||
`Id` int(10) unsigned NOT NULL DEFAULT 0,
|
`Id` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`Deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否刪除, 0:否 1:是',
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
`CompanyId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '公司編號',
|
`CompanyId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公司編號',
|
||||||
`CityId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '電站縣市',
|
`CityId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '電站縣市',
|
||||||
`AreaId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '電站區域',
|
`AreaId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '電站區域',
|
||||||
`Address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站詳細地址',
|
`Address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站詳細地址',
|
||||||
`Name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱',
|
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱',
|
||||||
`Code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站代碼,縣市+區域+四碼流水號',
|
`Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站代碼,縣市+區域+四碼流水號',
|
||||||
`SerialNumber` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '四碼流水號',
|
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '四碼流水號',
|
||||||
`IsEscrow` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否為代管,0:否 1:是',
|
`IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否為代管,0:否 1:是',
|
||||||
`EscrowName` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '代管名稱',
|
`EscrowName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '代管名稱',
|
||||||
`ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '台電掛錶日',
|
`ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '台電掛錶日',
|
||||||
`EstimatedRecoveryTime` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '預估回收時間',
|
`EstimatedRecoveryTime` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '預估回收時間',
|
||||||
`GeneratingCapacity` decimal(10,1) NOT NULL DEFAULT 0.0 COMMENT '電廠發電容量,單位(千瓦)',
|
`GeneratingCapacity` decimal(10,1) NOT NULL DEFAULT '0.0' COMMENT '電廠發電容量,單位(千瓦)',
|
||||||
`PowerRate` decimal(10,3) NOT NULL DEFAULT 0.000 COMMENT '受電費率',
|
`PowerRate` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '受電費率',
|
||||||
`Coordinate` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座標',
|
`Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座標',
|
||||||
`InverterBrand` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '逆變器廠牌',
|
`InverterBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '逆變器廠牌',
|
||||||
`InverterProductModel` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '逆變器型號',
|
`InverterProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '逆變器型號',
|
||||||
`InverterAmount` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '逆變器數量',
|
`InverterAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '逆變器數量',
|
||||||
`PhotovoltaicPanelBrand` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板廠牌',
|
`PhotovoltaicPanelBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板廠牌',
|
||||||
`PhotovoltaicPanelProductModel` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板型號',
|
`PhotovoltaicPanelProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板型號',
|
||||||
`PhotovoltaicPanelSpecification` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板規格',
|
`PhotovoltaicPanelSpecification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板規格',
|
||||||
`PhotovoltaicPanelAmount` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '光電板數量',
|
`PhotovoltaicPanelAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '光電板數量',
|
||||||
`BoEFileName` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局原檔案名',
|
`BoEFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局原檔案名',
|
||||||
`BoEFile` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局檔案',
|
`BoEFile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局檔案',
|
||||||
`BoEDiscountRate` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '能源局折扣率',
|
`BoEDiscountRate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '能源局折扣率',
|
||||||
`BoEDeviceRegisterNumber` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局設備登記編號',
|
`BoEDeviceRegisterNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局設備登記編號',
|
||||||
`BoERentRatio` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '能源局租金比率,單位(%)',
|
`BoERentRatio` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '能源局租金比率,單位(%)',
|
||||||
`TPCContractNumber` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電契約編號',
|
`TPCContractNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電契約編號',
|
||||||
`TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '台電簽約日期',
|
`TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '台電簽約日期',
|
||||||
`TPCSellDeadline` int(10) unsigned DEFAULT 0 COMMENT '台電售電期限,單位(年)',
|
`TPCSellDeadline` int(10) unsigned DEFAULT '0' COMMENT '台電售電期限,單位(年)',
|
||||||
`TPCMeterReading` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '台電每期抄錶日',
|
`TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '台電每期抄錶日',
|
||||||
`TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式購電日',
|
`TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式購電日',
|
||||||
`TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式售電日',
|
`TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式售電日',
|
||||||
`kwh` decimal(10,3) unsigned NOT NULL DEFAULT 0.000,
|
`kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
|
||||||
`Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT 0.000 COMMENT '今日發電量',
|
`Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '今日發電量',
|
||||||
`Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT 0.000 COMMENT '總發電量',
|
`Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '總發電量',
|
||||||
`kwhkwp` decimal(10,3) unsigned NOT NULL DEFAULT 0.000,
|
`kwhkwp` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
|
||||||
`PR` decimal(5,2) unsigned NOT NULL DEFAULT 0.00 COMMENT '電站Pr值',
|
`PR` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '電站Pr值',
|
||||||
`MP` decimal(5,2) unsigned NOT NULL DEFAULT 0.00,
|
`MP` decimal(5,2) unsigned NOT NULL DEFAULT '0.00',
|
||||||
`SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT 0.00 COMMENT '總運轉小時',
|
`SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '總運轉小時',
|
||||||
`SiteDB` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.000' COMMENT '電站 DB name: solar_com',
|
`SiteDB` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.000' COMMENT '電站 DB name: solar_com',
|
||||||
`TodayWeather` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.000' COMMENT '今日天氣',
|
`TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.000' COMMENT '今日天氣',
|
||||||
`TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT 0.00 COMMENT '今日溫度',
|
`TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '今日溫度',
|
||||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||||
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '建立時間',
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||||
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
||||||
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '修改時間',
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||||
PRIMARY KEY (`Id`),
|
PRIMARY KEY (`Id`),
|
||||||
KEY `IDX_01` (`Deleted`),
|
KEY `IDX_01` (`Deleted`),
|
||||||
KEY `IDX_02` (`CompanyId`),
|
KEY `IDX_02` (`CompanyId`),
|
||||||
@ -549,16 +579,16 @@ namespace SolarPower.Repository.Implement
|
|||||||
-- 傾印 資料表 power_station_exception 結構
|
-- 傾印 資料表 power_station_exception 結構
|
||||||
CREATE TABLE IF NOT EXISTS `power_station_exception` (
|
CREATE TABLE IF NOT EXISTS `power_station_exception` (
|
||||||
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`Deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否刪除, 0:否 1:是',
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
`PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '電站編號',
|
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '電站編號',
|
||||||
`Type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '類型,0:PR值',
|
`Type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '類型,0:PR值',
|
||||||
`UpperLimit` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '上限值',
|
`UpperLimit` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '上限值',
|
||||||
`LowerLimit` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '下限值',
|
`LowerLimit` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '下限值',
|
||||||
`Alarm` tinyint(4) NOT NULL DEFAULT 0 COMMENT '警報方式,0:email通知',
|
`Alarm` tinyint(4) NOT NULL DEFAULT '0' COMMENT '警報方式,0:email通知',
|
||||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||||
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '建立時間',
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||||
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
||||||
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '修改時間',
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||||
PRIMARY KEY (`Id`),
|
PRIMARY KEY (`Id`),
|
||||||
KEY `IDX_01` (`Deleted`,`PowerStationId`)
|
KEY `IDX_01` (`Deleted`,`PowerStationId`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='電站異常值設定';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='電站異常值設定';
|
||||||
@ -566,14 +596,14 @@ namespace SolarPower.Repository.Implement
|
|||||||
-- 傾印 資料表 power_station_image 結構
|
-- 傾印 資料表 power_station_image 結構
|
||||||
CREATE TABLE IF NOT EXISTS `power_station_image` (
|
CREATE TABLE IF NOT EXISTS `power_station_image` (
|
||||||
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`Deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否刪除, 0:否 1:是',
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
`PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '電站編號',
|
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '電站編號',
|
||||||
`IsMainDisplay` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否主要顯示圖片, 0:否 1:是',
|
`IsMainDisplay` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否主要顯示圖片, 0:否 1:是',
|
||||||
`Image` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '圖片檔名',
|
`Image` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '圖片檔名',
|
||||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||||
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '建立時間',
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||||
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
||||||
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '修改時間',
|
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||||
PRIMARY KEY (`Id`),
|
PRIMARY KEY (`Id`),
|
||||||
KEY `IDX_01` (`Deleted`,`IsMainDisplay`,`PowerStationId`) USING BTREE
|
KEY `IDX_01` (`Deleted`,`IsMainDisplay`,`PowerStationId`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='電站資料';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='電站資料';
|
||||||
@ -581,14 +611,24 @@ namespace SolarPower.Repository.Implement
|
|||||||
-- 傾印 資料表 power_station_single_line_diagram 結構
|
-- 傾印 資料表 power_station_single_line_diagram 結構
|
||||||
CREATE TABLE IF NOT EXISTS `power_station_single_line_diagram` (
|
CREATE TABLE IF NOT EXISTS `power_station_single_line_diagram` (
|
||||||
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`Deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否刪除, 0:否 1:是',
|
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||||
`PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '電站編號',
|
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '電站編號',
|
||||||
`Image` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '圖片檔名',
|
`Image` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '圖片檔名',
|
||||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||||
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '建立時間',
|
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||||
PRIMARY KEY (`Id`),
|
PRIMARY KEY (`Id`),
|
||||||
KEY `IDX_01` (`Deleted`,`PowerStationId`) USING BTREE
|
KEY `IDX_01` (`Deleted`,`PowerStationId`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='電站單線圖';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='電站單線圖';
|
||||||
|
|
||||||
|
-- 傾印 資料表 sharedevice 結構
|
||||||
|
CREATE TABLE IF NOT EXISTS `sharedevice` (
|
||||||
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`PowerStationId` int(10) DEFAULT NULL COMMENT '自己的電站編號',
|
||||||
|
`DeviceId` int(10) DEFAULT NULL COMMENT '共用其他電站的設備',
|
||||||
|
`CreatedBy` int(10) unsigned NOT NULL,
|
||||||
|
`CreatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`Id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='共享設備';
|
||||||
";
|
";
|
||||||
|
|
||||||
await conn.ExecuteAsync(sql, trans);
|
await conn.ExecuteAsync(sql, trans);
|
||||||
|
|||||||
@ -493,5 +493,6 @@ namespace SolarPower.Repository.Implement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1371,7 +1371,6 @@ namespace SolarPower.Repository.Implement
|
|||||||
return powerstation;
|
return powerstation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<OperationPersonnelSelectItemList>> GetOperationPersonnelSelectOptionListAsync(int powerStationId)
|
public async Task<List<OperationPersonnelSelectItemList>> GetOperationPersonnelSelectOptionListAsync(int powerStationId)
|
||||||
{
|
{
|
||||||
List<OperationPersonnelSelectItemList> result;
|
List<OperationPersonnelSelectItemList> result;
|
||||||
@ -1393,7 +1392,13 @@ namespace SolarPower.Repository.Implement
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 新增控制器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="deviceController"></param>
|
||||||
|
/// <param name="properties"></param>
|
||||||
|
/// <param name="db_name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task AddDeviceController(DeviceController deviceController, List<string> properties, string db_name)
|
public async Task AddDeviceController(DeviceController deviceController, List<string> properties, string db_name)
|
||||||
{
|
{
|
||||||
using (IDbConnection conn = _databaseHelper.GetConnection())
|
using (IDbConnection conn = _databaseHelper.GetConnection())
|
||||||
@ -1417,7 +1422,12 @@ namespace SolarPower.Repository.Implement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 控制器dataTable
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="stationId"></param>
|
||||||
|
/// <param name="db_name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<List<DeviceControllerTable>> DeviceControllerTable(int stationId, string db_name)
|
public async Task<List<DeviceControllerTable>> DeviceControllerTable(int stationId, string db_name)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1643,7 +1653,14 @@ namespace SolarPower.Repository.Implement
|
|||||||
return Device;
|
return Device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 取一筆各型態資料
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="A"></typeparam>
|
||||||
|
/// <param name="where"></param>
|
||||||
|
/// <param name="db_name"></param>
|
||||||
|
/// <param name="table_name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<A> GetoneData<A>(string where, string db_name, string table_name)
|
public async Task<A> GetoneData<A>(string where, string db_name, string table_name)
|
||||||
{
|
{
|
||||||
A result;
|
A result;
|
||||||
|
|||||||
@ -407,7 +407,14 @@ namespace SolarPower.Repository.Interface
|
|||||||
/// <param name="db_name"></param>
|
/// <param name="db_name"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<DeviceTable>> shareDeviceTables(int stationId, string db_name);
|
Task<List<DeviceTable>> shareDeviceTables(int stationId, string db_name);
|
||||||
|
/// <summary>
|
||||||
|
/// 取一筆各型態資料
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="A"></typeparam>
|
||||||
|
/// <param name="where"></param>
|
||||||
|
/// <param name="db_name"></param>
|
||||||
|
/// <param name="table_name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<A> GetoneData<A>(string where, string db_name, string table_name);
|
Task<A> GetoneData<A>(string where, string db_name, string table_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user