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

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