diff --git a/SolarPower/Repository/Implement/CompanyRepository.cs b/SolarPower/Repository/Implement/CompanyRepository.cs index dbce5e7..5889505 100644 --- a/SolarPower/Repository/Implement/CompanyRepository.cs +++ b/SolarPower/Repository/Implement/CompanyRepository.cs @@ -543,79 +543,79 @@ namespace SolarPower.Repository.Implement -- 傾印 資料表 power_station 結構 CREATE TABLE IF NOT EXISTS `power_station` ( - `Id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `Deleted` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是', - `CompanyId` 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 '電站區域', + `Id` int(10) unsigned NOT NULL DEFAULT '0', + `Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是', + `CompanyId` 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 '電站區域', `Status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '是否啟用, 0:否 1:是', - `HealthStatus` TINYINT(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1:設備正常 2:設備斷線 3:設備異常', - `Address` VARCHAR(100) NULL DEFAULT NULL COMMENT '電站詳細地址' COLLATE 'utf8mb4_unicode_ci', - `Name` VARCHAR(50) NULL DEFAULT NULL COMMENT '名稱' COLLATE 'utf8mb4_unicode_ci', - `MainDisplay` VARCHAR(50) NULL DEFAULT NULL COMMENT '主要顯示圖片' COLLATE 'utf8mb4_unicode_ci', - `Code` VARCHAR(50) NULL DEFAULT NULL COMMENT '電站代碼,縣市+區域+四碼流水號' COLLATE 'utf8mb4_unicode_ci', - `SerialNumber` VARCHAR(4) NULL DEFAULT NULL COMMENT '四碼流水號' COLLATE 'utf8mb4_unicode_ci', - `IsEscrow` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '是否為代管,0:否 1:是', - `EscrowName` VARCHAR(50) NULL DEFAULT NULL COMMENT '代管名稱' COLLATE 'utf8mb4_unicode_ci', - `ElectricityMeterAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電掛錶日', - `EstimatedRecoveryTime` VARCHAR(10) NULL DEFAULT NULL COMMENT '預估回收時間' COLLATE 'utf8mb4_unicode_ci', - `GeneratingCapacity` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '電廠發電容量,單位(千瓦)', - `PowerRate` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '受電費率', - `Coordinate` VARCHAR(50) NULL DEFAULT NULL COMMENT '座標' COLLATE 'utf8mb4_unicode_ci', - `InverterBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '逆變器廠牌' COLLATE 'utf8mb4_unicode_ci', - `InverterProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '逆變器型號' COLLATE 'utf8mb4_unicode_ci', - `InverterAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '逆變器數量', - `PhotovoltaicPanelBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '光電板廠牌' COLLATE 'utf8mb4_unicode_ci', - `PhotovoltaicPanelProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '光電板型號' COLLATE 'utf8mb4_unicode_ci', - `PhotovoltaicPanelSpecification` VARCHAR(100) NULL DEFAULT NULL COMMENT '光電板規格' COLLATE 'utf8mb4_unicode_ci', - `PhotovoltaicPanelAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '光電板數量', - `BoEFileName` VARCHAR(255) NULL DEFAULT NULL COMMENT '能源局原檔案名' COLLATE 'utf8mb4_unicode_ci', - `BoEFile` VARCHAR(255) NULL DEFAULT NULL COMMENT '能源局檔案' COLLATE 'utf8mb4_unicode_ci', - `BoEDiscountRate` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '能源局折扣率', - `BoEDeviceRegisterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '能源局設備登記編號' COLLATE 'utf8mb4_unicode_ci', - `BoERentRatio` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '能源局租金比率,單位(%)', - `BoERegisterPostAt` TIMESTAMP NULL DEFAULT NULL COMMENT '能源局登記發文日期', - `GUINumber` VARCHAR(16) NULL DEFAULT NULL COMMENT '統一編號' COLLATE 'utf8mb4_unicode_ci', - `TPCContractNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '台電契約編號' COLLATE 'utf8mb4_unicode_ci', - `TPCInvoiceBuyer` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票買受人' COLLATE 'utf8mb4_unicode_ci', - `TPCInvoiceAddress` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票地址' COLLATE 'utf8mb4_unicode_ci', - `TPCContractAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電簽約日期', - `TPCSellDeadline` INT(10) UNSIGNED NULL DEFAULT '0' COMMENT '台電售電期限,單位(年)', - `TPCMeterReading` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '台電每期抄錶日', - `TPCPurchaseElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電正式購電日', - `TPCSellElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電正式售電日', - `TPCMeterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '台電電號' COLLATE 'utf8mb4_unicode_ci', - `SolarType` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '電站類型', - `kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000', - `Today_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '今日發電量', - `Total_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '總發電量', - `today_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '今日kwhkwp', - `avg_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '30天平均kwhkwp', - `today_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '今日金額', - `total_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '總金額', - `today_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '電站Pr值', - `avg_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '平均Pr值', - `today_carbon` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '今日減碳量', - `total_carbon` DECIMAL(10,2) NOT NULL COMMENT '總減碳量', - `today_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '今日日照度', - `avg_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '平均日照度', - `SolarHour` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '總運轉小時', - `SiteDB` VARCHAR(20) NULL DEFAULT NULL COMMENT '電站 DB name: solar_com' COLLATE 'utf8mb4_unicode_ci', - `TodayWeather` VARCHAR(20) NULL DEFAULT NULL COMMENT '今日天氣' COLLATE 'utf8mb4_unicode_ci', - `TodayWeatherTemp` DECIMAL(5,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '今日溫度', - `WeathersStationId` VARCHAR(50) NULL DEFAULT NULL COMMENT '氣象站編號' COLLATE 'utf8mb4_unicode_ci', - `RateOfRain` VARCHAR(50) NULL DEFAULT NULL COMMENT '今日降雨率' COLLATE 'utf8mb4_unicode_ci', - `line_token` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci', - `Estimate_kwh` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電度數', - `EstimateEfficacy` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電效能', - `CreatedBy` INT(10) UNSIGNED NOT NULL COMMENT '建立者', - `CreatedAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間', - `UpdatedBy` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT '修改者', - `UpdatedAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間', - PRIMARY KEY (`Id`) USING BTREE, - KEY `IDX_01` (`Deleted`) USING BTREE, - KEY `IDX_02` (`CompanyId`) USING BTREE, - KEY `IDX_03` (`CityId`,`AreaId`) USING BTREE + `HealthStatus` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '1:設備正常 2:設備斷線 3:設備異常', + `Address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站詳細地址', + `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱', + `MainDisplay` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '主要顯示圖片', + `Code` varchar(50) CHARACTER SET utf8mb4 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:是', + `EscrowName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '代管名稱', + `ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '台電掛錶日', + `EstimatedRecoveryTime` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '預估回收時間', + `GeneratingCapacity` decimal(10,4) NOT NULL DEFAULT '0.0000' COMMENT '電廠發電容量,單位(千瓦)', + `PowerRate` decimal(10,4) NOT NULL DEFAULT '0.0000' COMMENT '受電費率', + `Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座標', + `InverterBrand` varchar(50) CHARACTER SET utf8mb4 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 '逆變器數量', + `PhotovoltaicPanelBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板廠牌', + `PhotovoltaicPanelProductModel` varchar(50) CHARACTER SET utf8mb4 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 '光電板數量', + `BoEFileName` varchar(255) CHARACTER SET utf8mb4 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 '能源局折扣率', + `BoEDeviceRegisterNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局設備登記編號', + `BoERentRatio` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '能源局租金比率,單位(%)', + `BoERegisterPostAt` timestamp NULL DEFAULT NULL COMMENT '能源局登記發文日期', + `GUINumber` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '統一編號', + `TPCContractNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電契約編號', + `TPCInvoiceBuyer` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電發票買受人', + `TPCInvoiceAddress` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電發票地址', + `TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '台電簽約日期', + `TPCSellDeadline` int(10) unsigned DEFAULT '0' COMMENT '台電售電期限,單位(年)', + `TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '台電每期抄錶日', + `TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式購電日', + `TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式售電日', + `TPCMeterNumber` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電電號', + `SolarType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '電站類型', + `kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000', + `Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '今日發電量', + `Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '總發電量', + `today_kwhkwp` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '今日kwhkwp', + `avg_kwhkwp` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '30天平均kwhkwp', + `today_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '今日金額', + `total_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '總金額', + `today_PR` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '電站Pr值', + `avg_PR` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '平均Pr值', + `today_carbon` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '今日減碳量', + `total_carbon` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '總減碳量', + `today_irradiance` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '今日日照度', + `avg_irradiance` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '平均日照度', + `SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '總運轉小時', + `SiteDB` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站 DB name: solar_com', + `TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '今日天氣', + `TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '今日溫度', + `WeathersStationId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '氣象站編號', + `RateOfRain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '今日降雨率', + `line_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `Estimate_kwh` decimal(10,2) DEFAULT '0.00' COMMENT '預估發電度數', + `EstimateEfficacy` decimal(10,2) DEFAULT '0.00' COMMENT '預估發電效能', + `CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者', + `CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間', + `UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者', + `UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間', + PRIMARY KEY (`Id`), + KEY `IDX_01` (`Deleted`), + KEY `IDX_02` (`CompanyId`), + KEY `IDX_03` (`CityId`,`AreaId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='電站資料';