diff --git a/SolarPower/Repository/Implement/CompanyRepository.cs b/SolarPower/Repository/Implement/CompanyRepository.cs index 054e337..ff22bf6 100644 --- a/SolarPower/Repository/Implement/CompanyRepository.cs +++ b/SolarPower/Repository/Implement/CompanyRepository.cs @@ -460,6 +460,8 @@ namespace SolarPower.Repository.Implement `Type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '類型', `TypeName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '類型名稱', `ControllerId` int(10) unsigned DEFAULT NULL COMMENT '控制器Id', + `SensorTypeId` int(10) DEFAULT NULL, + `SensorTypeDetailId` int(10) DEFAULT NULL, `Brand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '廠牌', `BrandNum` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '廠商序號', `ProductModel` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '型號', @@ -543,7 +545,7 @@ namespace SolarPower.Repository.Implement -- 傾印 資料表 power_station 結構 CREATE TABLE IF NOT EXISTS `power_station` ( - `Id` int(10) unsigned NOT NULL DEFAULT '0', + `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 '電站縣市', @@ -599,7 +601,7 @@ namespace SolarPower.Repository.Implement `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 '總運轉小時', + `SolarHour` decimal(10,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 '今日溫度', @@ -611,7 +613,7 @@ namespace SolarPower.Repository.Implement `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 '修改時間', + `UpdatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間', PRIMARY KEY (`Id`), KEY `IDX_01` (`Deleted`), KEY `IDX_02` (`CompanyId`),