using SolarPower.Models; using SolarPower.Models.Company; using SolarPower.Models.PowerStation; using SolarPower.Models.User; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SolarPower.Repository.Interface { public interface IPowerStationRepository : IRepositoryBase { /// /// 取得當前使用者可操作電站的縣市 /// /// /// List GetMyCities(MyUser myUser, byte showEnable); /// /// 取得當前使用者可操作的電站 /// /// /// //List GetMyPowerStationSummary(MyUser myUser, string filter = ""); List GetMyPowerStationList(MyUser myUser, byte showEnable, List cityIds = null, List wheres = null, Dictionary where_entities = null, List orderBy = null); /// /// 查詢縣市列表 /// /// /// Task> GetCitySelectOptionListAsync(); /// /// 查詢地區列表 /// /// /// Task> GetAreaSelectOptionListAsync(int cityId); Task> GetOperationPersonnelSelectOptionListAsync(int powerStationId); Task> GetFimlSelectOptionListAsync(int powerStationId, string siteDB); /// /// 取得下拉式公司選單,須為Deleted: 0、Status: 1 /// /// /// Task> GetCompanySelectOptionListAsync(int companyId); /// /// 透過編號取得,縣市資訊 /// /// /// Task GetOneCityByIdAsync(int cityId); /// /// 透過編號取得,地區資訊 /// /// /// Task GetOneAreaByIdAsync(int areaId); /// /// 取得縣市地區代碼 /// /// /// Task GetCityAreaZipcodeAsync(int areaId); /// /// 透過縣市地區編號,取得該縣市地區最後的流水號 /// /// /// /// Task GetLastSerialNumberByCityAreaIdAsync(int cityId, int areaId); /// /// 新增電站資料至 主、子資料庫 /// /// /// /// /// Task AddOnePowerStationAsync(PowerStation entity, List properties, string db_name); /// /// 修改主、子資料庫電站基本資訊 /// /// /// /// /// Task UpdatePowerStationInfo(UpdatePowerStationInfo entity, List properties, string db_name); /// /// 修改主、子資料庫能源局與台電資訊 /// /// /// /// /// Task UpdateBoETPCInfo(UpdateBoETPCInfo entity, List properties, string db_name); /// /// 透過電站編號,取得所有土地房屋資訊 /// /// /// /// Task> GetAllLandBuildingInfoByPowerStationId(int id, string db_name); /// /// 取得 土地房屋資訊 /// /// /// /// Task GetOneLandBuildingInfo(int id, string db_name); /// /// 新增 土地房屋資訊 /// /// /// /// Task AddOneLandBuildingInfo(LandBuilding entity, List properties, string db_name); /// /// 更新 土地房屋資訊 /// /// /// /// /// Task UpdateLandBuildingInfo(UpdateLandBuilding entity, List properties, string db_name); /// /// 軟刪除土地房屋資訊 /// /// /// /// Task DeleteOneLandBuildingInfo(int id, string db_name); /// /// 新增運維 /// /// /// /// /// Task AddOperation(OperationInfo operation, List properties, string db_name); /// /// 運維dataTable /// /// /// /// Task> OperationTable(int stationId, string db_name); /// /// 取一筆運維 /// /// /// /// Task OneOperationInfo(int stationId, string db_name); /// /// 更新運維 /// /// /// /// /// Task UpdateOperation(OperationInfo operation, List properties, string db_name); /// /// 裝置類型下拉式選單 /// /// Task> DeviceType(); /// /// 新增 裝置 /// /// /// Task AddDevice(Device DeviceInfo, List properties, string db_name); /// /// 修改 裝置 /// /// /// /// Task UpdateDevice(Device DeviceInfo, List properties, string db_name); /// /// 設備datatable /// /// /// Task> DeviceTable(int stationId, string db_name); /// /// 異常datatable /// /// /// Task> ExceptionTable(int stationId, string db_name); /// /// 取單一筆DeviceInfo /// /// /// Task OneDeviceInfo(int id, string db_name); /// /// 新增 異常設定 /// /// /// /// Task AddException(ExceptionModal Exception, List properties, string db_name); /// /// 取一筆異常設定 /// /// /// Task OneException(int id, string db_name); /// /// 更新異常設定 /// /// /// /// Task UpdateException(ExceptionModal Exception, List properties, string db_name); /// /// 取最後一個設備流水號 /// /// /// /// Task GetFinalSerialNumber(int PowerStationId, string Type, string db_name); /// /// 透過電站編號,取得該電站的運維人員編號 /// /// /// /// Task> GetOperationPersonnelIdsByPowerStatioinId(int powerStationId); /// /// 新增電站運維人員 /// /// /// /// Task AddOperationPersonnelAsync(List entity, List properties); /// /// 軟刪除電站運維人員 /// /// /// /// Task DeleteOperationPersonnel(List operationPersonnels); /// /// 電站管理 新增電站圖片 /// /// /// /// /// Task AddPowerStationImageAsync(List entity, List properties, string db_name); /// /// 電站管理 取得所有電站圖片的資料 /// /// /// /// Task> GetAllPowerStationImageAsync(int powerStationId, string db_name); /// /// 電站管理 取得單一電站圖片的資料 /// /// /// /// Task GetOnePowerStationImageAsync(int id, string db_name); /// /// 軟刪除 單一電站圖片 /// /// /// /// Task DeleteOnePowerStationImage(int id, string db_name); /// /// 電站管理 取得主要卡片顯示圖 /// /// /// /// Task GetMainDisplayAsync(int powerStationId, string db_name); /// /// 電站管理 更新上傳圖片 /// /// /// /// /// Task UpdatePowerStationImage(UpdataPowerStationImage image, List properties, string db_name); /// /// 電站管理 新增單線圖 /// /// /// /// /// Task AddPowerStationSingleLineAsync(List entity, List properties, string db_name); /// /// 電站管理 取得所有單線圖的資料 /// /// /// /// Task> GetAllPowerStationSingleLineAsync(int powerStationId, string db_name); /// /// 電站管理 取得單一單線圖的資料 /// /// /// /// Task GetOnePowerStationSingleLineAsync(int id, string db_name); /// /// 軟刪除 單一單線圖 /// /// /// /// Task DeleteOnePowerStationSingleLine(int id, string db_name); /// /// 取得電站分佈縣市以及數量 /// /// /// Task> GetSolarCitySummary(MyUser User); /// /// 透過縣市取得電站卡片資訊 /// /// /// /// Task> GetSolarByCity(MyUser User, List CityId); /// /// 新增控制器 /// /// /// /// /// Task AddDeviceController(DeviceController deviceController, List properties, string db_name); /// /// 控制器dataTable /// /// /// /// Task> DeviceControllerTable(int stationId, string db_name); /// /// 新增逆變器 /// /// /// /// /// Task AddInverter(Inverter inverter, List properties, string db_name); /// /// 取得控制器所有id /// Task> GetAllDeviceControllerId(int stationId, string db_name); /// /// 逆變器dataTable /// /// /// /// Task> InverterTable(List controllerid, string db_name); /// /// 電站下拉式選單 /// /// Task> GetPowerstationOptionAsync(string db_name, int stationId); /// /// 設備編號下拉式選單 /// /// /// /// Task> GetDeviceUIDListAsync(string db_name, int stationId); /// /// 新增共享設備 /// /// /// /// /// Task AddShareDevice(Sharedevice sharedevice, List properties, string db_name); /// /// 共享裝置dataTable /// /// /// /// Task> shareDeviceTables(int stationId, string db_name); /// /// 取一筆各型態資料 /// /// /// /// /// /// Task GetoneData(string where, string db_name, string table_name); /// /// 透過電站Id,取得所有控制器編碼 /// /// /// /// Task> GetAllDeviceControllerByPowerStationId(int stationId, string db_name); /// /// 透過當前時間,取得電站歷史資料 /// /// /// /// Task GetPowerStationHistoryPerHour(string dateTime, string table_name); /// /// 透過當前日期,計算往前推算30天的平均值 /// /// /// /// Task CalcAvgPowerStationHistory30day(string nowDay, string table_name); Task AddPowerStationHistory(List entity, List properties); Task UpdateList(List entity, List properties); /// /// 透過日期,取得最後一筆資料 /// /// /// /// Task GetLastOnePowerStationHistoryByDay(string day, string table_name); /// /// 新增資料,至每日的電站歷史記錄 /// /// /// /// Task AddPowerStationHistoryDayList(List entity, List properties); /// /// 透過月份,取得單一筆資料 /// /// /// /// Task GetOnePowerStationHistoryByPowerStationIdAndMonth(int powerStationId, string month); /// /// 透過電站編號、月份,計算該月份資訊 /// /// /// /// Task ClacPowerStationHistoryMonthDataByPowerStationId(int powerStationId, string month); Task AddPowerStationHistoryMonthList(List entity, List properties); Task UpdatePowerStationHistoryMonthList(List entity); /// /// 電站日照計列表 /// /// /// /// Task> GetPowerstationPyrheliometerAsync(string db_name, int stationId); /// /// 取得完整電站資訊:包含維護人員及土地資訊 /// /// /// Task GetStationExtraInfo(int powerStationId); Task> GetListPyrheliometerByPowerStationId(int powerStationId, string db_name); Task> GetListTempByPowerStationId(int powerStationId, string db_name); Task> GetDeviceListByPowerStationIdAndType(int powerStationId, string type, string db_name); Task CalcSensorHistoryPerHour(string dateTime, List deviceInfos, int Type); Task AddTempHistory(List entity, List properties); Task AddSensorHistoryHour(List entity, List properties); Task CalcAvgPyrheliometerHistory30day(string nowDay, int powerStationId); Task CalcPyrheliometerHistoryDayDataByPowerStationId(string nowDay, int powerStationId); Task AddPyrheliometerHistoryDayList(List entity, List properties); Task CalcPyrheliometerHistoryMonthDataByPowerStationId(string month, int powerStationId); Task GetOnePyrheliometerHistoryByMonth(string month, int powerStationId); Task AddPyrheliometerHistoryMonthList(List entity, List properties); Task UpdatePyrheliometerHistoryMonthList(List entity); Task UpdateInverter(Inverter entity, List properties, string db_name); Task Getonediv(string where, string db_name, string table_name); Task> CalcInverterHisyort15minData(string dateTime, string db_name, string table_name, List inverterIds); Task AddInverter15minHistory(List entity, List properties); Task> CalcInverterHisyortHourData(string dateTime, string db_name, string table_name, List inverterIds); Task GetFirstPyrheliometerInfo(int powerStationId, string db_name); Task GetFirstPyrheliometerValue(string dateTime, string db_name, string table_name, string col_name); Task AddInverterHistory(List entity, List properties); Task> CalcInverterHistoryDayDataByPowerStationId(string nowDay, string db_name, int powerStationId); Task AddInverterHistoryDayList(List entity, List properties); Task> GetInverterHistoryByPowerStationIdAndMonth(string month, int powerStationId); Task> CalcInverterHistoryMonthDataByPowerStationId(string month, string db_name, int powerStationId); Task AddInverterHistoryMonthList(List entity, List properties); Task UpdateInverterHistoryMonthList(List entity); Task> GetPowerStationIdsByUserRole(MyUser myUser); Task AddWeatherObservation(List entity, List properties); Task AddWeatherForecast(List entity, List properties); Task SelectNowWeather(int CityId); Task GetMoneyAndCarbonWithHistoryHour(int powerstationId, string dateTime, int type); Task GetLastMoneyAndCarbonInHour(int powerstationId, int type, string time); Task ExistTable(string db_name, string table_name); Task CalcSensorAvgHistory(string dateTime, string table_name); Task AddSensorAvgHistory(List entity, List properties); Task CalcSensorAvgDayDataByPowerStationId(string nowDay, int powerStationId); Task AddSensorAvgHistoryDayList(List entity, List properties); Task GetSensorAvgHistoryByPowerStationIdAndMonth(string month, int powerStationId); Task CalcSensorAvgHistoryMonthDataByPowerStationId(string month, int powerStationId); Task AddSensorAvgHistoryMonthList(List entity, List properties); Task UpdateSensorAvgHistoryMonthList(List entity); Task CalcMeterHistory(string dateTime, string table_name); Task AddMeterHistory(List entity, List properties); Task> CalcMeterDayDataByPowerStationId(string nowDay, int powerStationId); Task AddMeterHistoryDayList(List entity, List properties); Task> GetMeterHistoryByPowerStationIdAndMonth(string month, int powerStationId); Task> CalcMeterHistoryMonthDataByPowerStationId(string month, int powerStationId); Task AddMeterHistoryMonthList(List entity, List properties); Task UpdateMeterHistoryMonthList(List entity); Task> GetPowerStationsByCompanyId(MyUser myUser); Task> GetPowerStationInverter(Dictionary> dic, string filter); Task> GetPowerStationDevice(Dictionary> dic, string filter); Task> GetInverterHistoryRowData(long start_timestamp, long end_timestamp, List entities); Task> GetInverterHistoryByDate(string startDay, string endDay, List entities); Task> GetInverterHistoryByYear(string year, List entities); Task> GetPowerStationsByCompanyIdWithfilter(MyUser myUser, string filter); Task> GetPowerStationsAllWithfilter(string filter); Task> GetDeviceByPowerStationIdAndDeviceIds(string db_name, int powerStationId, List deviceIds); Task GetSensorAvgByDevices(string date, byte searchType, List devices); Task> GetPowerStationHistory(string date, byte searchType, List entities); Task> GetMeterHistory(string date, byte searchType, List entities); Task> GetPowerStationHistoryByDateRange(string startDate, string endDate); Task AddAfterPurgePowerStationHistoryHour(string startDate, string endDate, List entity, List properties); Task AddAfterPurgePowerStationHistoryDay(string startDate, string endDate, List entity, List properties); Task AddAfterPurgePowerStationHistoryMonth(string startDate, string endDate, List entity, List properties); Task AddAfterPurgePyrheliometerHistory(string startDate, string endDate, byte type, List entity, List properties); Task AddAfterPurgeInverterHistory(string startDate, string endDate, byte type, List entity, List properties); Task AddAfterPurgeInverterHistory15min(string startDate, string endDate, List entity, List properties); Task AddAfterPurgeSensorAvgHistory(string startDate, string endDate, byte type, List entity, List properties); Task CheckShowMoney(int userid); Task> GetAllInverterRowData(string date, string table_name); Task> GetAllInverterInfo(List post, string site_table, string site_db); Task GetInverterInfoModal(int Id, string Time, string DB, string Table); Task> GetApicallItemList(int powerStationId, string dbname); Task> GetApicallList(int PowerStationId, string Type); Task> GetShareDevicePowerstationName(int Id, string DBname); Task DropShareDevice(int powerstationId, string DBname); Task DeleteALLPowerStationOperationPersonnel(int stationId); Task> CheckStationStatus(string code, string DBname, string powerStationID); /// /// 電站啟用檢查 /// /// /// /// /// Task> CheckStationStatus_v2(string code, string DBname, string powerStationID); Task StationStatus(int stationId, int status, string subDB = ""); Task UpdateInvStatus(string siteDB, List codes, List inverterIds = null, byte status = 0); Task> GetInvStatusErr(List codes); Task Check4table(string code, string dbname); Task CheckInvTableColumn(string dbname, string code); Task CheckSensorAvgTableColumn(string dbname, string code); Task CheckStationTableColumn(string dbname, string code); Task AlertColInvTableColumn(string dbname, string code); Task AlertColSensoravgTableColumn(string dbname, string code); Task AlertColStationTableColumn(string dbname, string code); Task> GetAllNoStatusAsync(); } }