Merge branch 'master' of https://gitea.mjm-staging.developers-homelab.net/BIMS/BIMS
This commit is contained in:
		
						commit
						27e8019b8f
					
				@ -910,7 +910,7 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 樓層列表
 | 
			
		||||
        /// input user 所選樓層,回傳樓上那層,如果是頂樓 則回自己
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="account"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
@ -934,8 +934,28 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                //              AND building_tag = (SELECT building_tag FROM floor WHERE floor_guid = @floor_guid)) 
 | 
			
		||||
                //                    AND building_tag = (SELECT building_tag FROM floor WHERE floor_guid = @floor_guid)";
 | 
			
		||||
 | 
			
		||||
                var sqlString = $@"	SELECT * FROM floor WHERE floor_guid = @floor_guid;";
 | 
			
		||||
                var param = new { @floor_guid = f.floor_guid };
 | 
			
		||||
                //找出同一棟 User 所選的上一樓(要拿掉天花板),如已經是頂樓則回傳自己
 | 
			
		||||
                var sqlString = $@"select * from 
 | 
			
		||||
                                    (
 | 
			
		||||
                                       SELECT * FROM floor -- 下一樓
 | 
			
		||||
	                                     where building_tag = @building_tag and priority > (					
 | 
			
		||||
						                                     select priority from floor
 | 
			
		||||
						                                     where  building_tag =  @building_tag and floor_guid = @floor_guid
 | 
			
		||||
				                                     ) 
 | 
			
		||||
	                                     order by priority limit 1
 | 
			
		||||
                                     )a
 | 
			
		||||
	                                     union 
 | 
			
		||||
                                    select * from 
 | 
			
		||||
                                    (	 
 | 
			
		||||
	                                     SELECT * FROM floor -- 如果是頂樓則回傳自己
 | 
			
		||||
	                                     where building_tag = @building_tag and priority >= (					
 | 
			
		||||
						                                     select priority from floor
 | 
			
		||||
						                                     where  building_tag =  @building_tag and floor_guid = @floor_guid
 | 
			
		||||
				                                     ) 
 | 
			
		||||
	                                      order by priority limit 1
 | 
			
		||||
                                     )b
 | 
			
		||||
                                     order by priority desc limit 1 ";
 | 
			
		||||
                var param = new { @building_tag = f.building_tag, @floor_guid = f.floor_guid };
 | 
			
		||||
                var fr = await backendRepository.GetOneAsync<Floor>(sqlString, param);
 | 
			
		||||
 | 
			
		||||
                apiResult.Code = "0000";
 | 
			
		||||
 | 
			
		||||
@ -115,6 +115,8 @@ namespace FrontendWebApi.Models
 | 
			
		||||
    public class Floor
 | 
			
		||||
    {
 | 
			
		||||
        public string floor_guid { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string building_tag { get; set; }
 | 
			
		||||
        public string full_name { get; set; }
 | 
			
		||||
        public string InitMapName { get; set; }
 | 
			
		||||
        public string Floor_map_name { get; set; }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user