[後端] 調整數據趨勢獲取東別程序

This commit is contained in:
dev02 2024-01-29 17:07:23 +08:00
parent 0ec125e0e0
commit aad4e8e0f4

View File

@ -352,11 +352,12 @@ namespace FrontendWebApi.ApiControllers
where c.account = @account where c.account = @account
order by v1.system_priority, v2.system_priority", new { @account = myUser.account, @sub_system_type = sub_system_type, @main_system_type = main_system_type }); order by v1.system_priority, v2.system_priority", new { @account = myUser.account, @sub_system_type = sub_system_type, @main_system_type = main_system_type });
var dbbuilding = await frontendRepository.GetAllAsync<History_Build>( var dbbuilding = await frontendRepository.GetAllAsync<History_Build>(
@$"select distinct d.building_tag,d.full_name,d.priority from role_auth a @$"select distinct d.building_tag, d.full_name, d.priority
from role_auth a
join auth_page b on a.AuthCode = b.AuthCode join auth_page b on a.AuthCode = b.AuthCode
join userinfo c on c.role_guid = a.role_guid join userinfo c on c.role_guid = a.role_guid
join building d on d.building_tag = b.building_tag join building d on d.building_tag = b.building_tag
where c.account = @account and d.building_tag = @building_tag where c.account = @account and b.ShowView = 'DataAnalyst'
order by d.priority order by d.priority
", new { @account = myUser.account, @building_tag = hf.building_tag }); ", new { @account = myUser.account, @building_tag = hf.building_tag });
var mains = dbsub.GroupBy(a => a.main_system_tag).ToList(); var mains = dbsub.GroupBy(a => a.main_system_tag).ToList();
@ -967,23 +968,19 @@ namespace FrontendWebApi.ApiControllers
try try
{ {
#region #region
var sqlBuildingFloor = $@"SELECT var sqlBuildingFloor = $@"select distinct d.building_tag,
b.building_tag, d.full_name AS building_name,
b.full_name AS building_name, d.priority,
b.priority,
f.floor_guid, f.floor_guid,
f.full_name AS floor_name, f.full_name AS floor_name,
f.priority f.priority
FROM building b from role_auth a
JOIN floor f ON f.deleted = 0 AND f.building_tag = b.building_tag join auth_page b on a.AuthCode = b.AuthCode
WHERE b.building_tag IN ( join userinfo c on c.role_guid = a.role_guid
SELECT join building d on d.building_tag = b.building_tag
ap.building_tag JOIN floor f ON f.deleted = 0 AND f.building_tag = b.building_tag
FROM role_auth ra where c.account = @account and b.ShowView = 'HistorySearch'
JOIN auth_page ap ON ra.AuthCode = ap.AuthCode order by d.priority, f.priority;";
JOIN userinfo u ON u.role_guid = ra.role_guid WHERE u.account = @Account
)
ORDER BY b.priority, f.priority";
var buildingFloorRawDatas = await frontendRepository.GetAllAsync<BuildingFloorRawData>(sqlBuildingFloor, post); var buildingFloorRawDatas = await frontendRepository.GetAllAsync<BuildingFloorRawData>(sqlBuildingFloor, post);