<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    沉睡森林@漂在北京

    本處文章除注明“轉(zhuǎn)載”外均為原創(chuàng),轉(zhuǎn)載請注明出處。

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      152 隨筆 :: 4 文章 :: 114 評論 :: 0 Trackbacks
    drop package COMMON_FUNCTION
    /

    /*==============================================================*/
    /* Database package: COMMON_FUNCTION                            */
    /*==============================================================*/
    create or replace package COMMON_FUNCTION as
       
    function GETORIGINCODEBYID (ORIGINID In Numberreturn number;
       
    function GETCOUNTYDEGREE (COUNTYID in Numberreturn Number;
       
    function GETVILLAGENAMEBYID (VILLAGEID In Numberreturn Varchar2;
       
    function GETTOWNNAMEBYID (TOWNID In Numberreturn Varchar2;
       
    function GETCOUNTYNAMEBYID (COUNTYID In Numberreturn Varchar2;
       
    function GETCOUNTYIDBYUSERID (USERID In Numberreturn NUMBER;
       
    function GETWORKSTATIONIDBYUSERID (USERID In Numberreturn NUMBER;
       
    function GETVILLAGECODEBYID (VILLAGEID In Numberreturn Varchar2;
       
    function GETTOWNCODEBYID (TOWNID In Numberreturn Varchar2;
       
    function GETCOUNTYCODEBYID (COUNTYID In Numberreturn Varchar2;
       
    function GETWORKSTATIONNAMEBYID (WORKSTATIONID In Numberreturn Varchar2;
       
    function GETCITYIDBYCOUNTYID (COUNTYID In Numberreturn Number;
       
    function GETCOUNTYIDBYTOWNID (TOWNID In Numberreturn Number;
       
    function GETHUBEIID return number;
       
    function GETCUTTYPECODEBYID (CUTTYPEID In Numberreturn number;
       
    function GETTREECODEBYID (TREEID In Numberreturn Varchar2;
       
    function GETFORESTCODEBYID (FID In Numberreturn number;
    end COMMON_FUNCTION;
    /

    create or replace package body COMMON_FUNCTION as
       
    function GETORIGINCODEBYID (ORIGINID In Numberreturn number as
       lastNum 
    number;
         
    begin
                
    select origin.ORIG_QYDM into lastNum from GG_ORIGIN origin where origin.ORIG_ID = originId;
              
    return lastNum;
         
    end;
       
    function GETCOUNTYDEGREE (COUNTYID in Numberreturn Number as
       DegreeNum 
    number;
         CountyCode 
    varchar(50);
         
    Begin
                
                
    select ct.COUN_DM
              
    into CountyCode 
              
    from GG_County ct 
              
    where ct.coun_id = CountyId;
              
              
    --province  county
              if trim( Substr(trim(CountyCode),3) ) = '0000' then
                    
    --degreeNum := 0;
                 return 0;
              
    end if;
              
              
    --city county
              if trim( Substr(trim(CountyCode),3) ) != '0000' and trim(Substr(trim(CountyCode),5)) = '00' then
                    
    --degreeNum := 1;
                 return 1;
              
    end if;
              
              
    --county county
              if trim( Substr(trim(CountyCode),3) ) != '0000' and trim(Substr(trim(CountyCode),5)) != '00'then
                    
    --degreeNum := 2;
                 return 2;
              
    end if;
              
                
    --return DegreeNum;
         ENd;
       
    function GETVILLAGENAMEBYID (VILLAGEID In Numberreturn Varchar2 as
       villageName 
    varchar2(50);
         
    Begin
                
    Select VILL_CM  
              
    Into VillageName 
              
    from GG_VILLAGE 
              
    where VILL_ID = VillageId;
              
              
    return VillageName;
         
    End;
       
    function GETTOWNNAMEBYID (TOWNID In Numberreturn Varchar2 as
       villageName 
    varchar2(50);
         
    Begin
                
    Select TOWN_XZM  
              
    Into VillageName 
              
    from GG_Town 
              
    where TOWN_ID = TownId;
              
              
    return VillageName;
         
    End;
       
    function GETCOUNTYNAMEBYID (COUNTYID In Numberreturn Varchar2 as
       villageName 
    varchar2(50);
         
    Begin
                
    Select COUN_MC  
              
    Into VillageName 
              
    from GG_County 
              
    where COUN_ID = CountyId;
              
              
    return VillageName;
         
    End;
       
    function GETCOUNTYIDBYUSERID (USERID In Numberreturn NUMBER as
       countyId 
    NUMBER;
       
        
    BEGIN
          
    select  workstation.WORK_ID 
          
    into countyId 
          
    from  GG_COUNTY county,GG_USER u,GG_PERSON person,GG_WORKSTATION workstation
          
    where u.USER_ID = userId
          
    And  u.USER_RYID = person.PERS_ID
          
    And  person.PERS_WORKID = workstation.WORK_ID
          
    And workstation.WORK_XDMID = county.COUN_ID    ;
       
               
          
    return countyId;
          
         
    END;
       
    function GETWORKSTATIONIDBYUSERID (USERID In Numberreturn NUMBER as
       workstationId 
    NUMBER;
       
         
    BEGIN
          
    select  workstation.WORK_ID 
          
    into workstationId 
          
    from  GG_USER u,GG_PERSON person,GG_WORKSTATION workstation
          
    where u.USER_ID = userId
          
    And  u.USER_RYID = person.PERS_ID
          
    And   person.PERS_WORKID = workstation.WORK_ID;
               
          
    return workstationId;
          
          
    END;
       
    function GETVILLAGECODEBYID (VILLAGEID In Numberreturn Varchar2 as
       VillageCode 
    varchar2(50);
         TownCode 
    varchar2(50);
         CountyCode 
    varchar2(50);
         
    Begin 
                 
    select VILL_CDM Into VillageCode 
               
    From  GG_VILLAGE 
               
    where VILL_ID = VillageId;
                      
               
    select town.TOWN_XZDM 
               
    Into TownCode 
               
    From  GG_Town town,GG_Village village  
               
    Where   town.TOWN_ID = village.VILL_XZDMID 
               
    And   village.VILL_ID = VillageId;
                            
                            
               
    select county.COUN_DM 
               
    Into CountyCode 
               
    From   GG_County county,GG_town town,GG_village village 
               
    Where village.VILL_ID = VillageId
               
    And  town.TOWN_XDMID = county.COUN_ID
               
    And   village.VILL_XZDMID = town.TOWN_ID;        
               
               
    return CountyCode || TownCode || VillageCode;
               
         
    End;
       
    function GETTOWNCODEBYID (TOWNID In Numberreturn Varchar2 as
       TownCode 
    varchar2(50);
         CountyCode 
    varchar2(50);
         
    Begin        
               
    select town.TOWN_XZDM Into TownCode 
               
    From  GG_Town town   
               
    Where   town.TOWN_ID = TownId; 
                     
               
    select county.COUN_DM Into CountyCode 
               
    From  GG_County county,GG_town town  
               
    Where   town.TOWN_ID = TownId
               
    And  town.TOWN_XDMID = county.COUN_ID;        
                
               
    return CountyCode  || TownCode || '000';
         
    End;
       
    function GETCOUNTYCODEBYID (COUNTYID In Numberreturn Varchar2 as
       CountyCode 
    varchar2(50);
         
    Begin 
                 
    --return 'hello';
               select county.COUN_DM Into CountyCode 
               
    From  GG_County county
               
    Where   county.COUN_ID = CountyId;
               
               
    return CountyCode || '000'  || '000';
         
    End;
       
    function GETWORKSTATIONNAMEBYID (WORKSTATIONID In Numberreturn Varchar2 as
       workName 
    varchar(80);
         
    Begin
                
    select workstation.WORK_DWM 
              
    into workname 
              
    from gg_workstation workstation 
              
    where workstation.WORK_ID = WorkstationId;
              
                
    return workName;
         
    End;
       
    function GETCITYIDBYCOUNTYID (COUNTYID In Numberreturn Number as
       CityId  
    Number;
         
    Begin
             
    select   county.COUN_SJID  Into CityId 
           
    From  GG_County county
           
    Where  county.COUN_ID = CountyId; 
           
    return cityId; 
         
    End;
       
    function GETCOUNTYIDBYTOWNID (TOWNID In Numberreturn Number as
       countyId 
    Number;
         
    Begin
                
    select   town.TOWN_XDMID  Into  countyId 
              
    From  GG_town town
              
    where town.TOWN_ID = TownId;
              
              
    return countyId;
         
    End;
       
    function GETHUBEIID return number as
       countyId 
    number;
         
    Begin
                
    select   county.COUN_ID into countyId
              
    from  gg_county county
              
    where county.COUN_DM = '420000';
              
    return countyId;
         
    End;
       
    function GETCUTTYPECODEBYID (CUTTYPEID In Numberreturn number as
       cutcode 
    number;
         
    Begin
               
    select cuttype.CLAS_LXDM 
             
    into cutcode  
             
    from CF_CLASS cuttype 
             
    where cuttype.CLAS_ID = cuttypeId;
             
             
    return cutcode; 
         
    End;
       
    function GETTREECODEBYID (TREEID In Numberreturn Varchar2 as
       treeCode 
    varchar2(50);
         
    Begin
                
    select tr.TRSP_SZDM 
              
    into treeCode
              
    from GG_TREESPECIES tr
              
    where tr.TRSP_ID = treeId;
              
              
    return treeCode;
         
    End;
       
    function GETFORESTCODEBYID (FID In Numberreturn number as
       lastNum 
    number;
        
    begin
            
    select f.SOFO_LZDM into lastNum from GG_SORTSOFFOREST f where f.SOFO_ID = fId;
           
    return lastNum;
        
    end;
    end COMMON_FUNCTION;
    /
    posted on 2009-05-21 14:35 王總兵 閱讀(414) 評論(0)  編輯  收藏 所屬分類: DataBase
    主站蜘蛛池模板: 亚洲日韩国产AV无码无码精品| 免费乱理伦在线播放| 亚洲成人午夜在线| 中国videos性高清免费| 久久亚洲色一区二区三区| 污污视频网站免费观看| 亚洲精品成人片在线观看| 国产精品hd免费观看| 久久亚洲AV无码精品色午夜麻| 国产一区二区三区免费视频| 中文字幕在线免费看| 黄色片网站在线免费观看| 亚洲人成人网站色www| 99免费在线观看视频| 亚洲沟沟美女亚洲沟沟| 成年女人色毛片免费看| 国产精品亚洲va在线观看| 亚洲午夜av影院| 成人免费在线看片| 日日狠狠久久偷偷色综合免费 | 亚洲综合一区二区国产精品| 免费看污成人午夜网站| 一级毛片免费观看不收费| 亚洲六月丁香六月婷婷色伊人| 国产乱色精品成人免费视频 | 亚洲日韩一区二区三区| 亚洲国产精品综合久久久| 成人伊人亚洲人综合网站222| 国产一区二区免费| 亚洲一日韩欧美中文字幕在线| 亚洲中文字幕无码爆乳av中文| 亚洲av无码国产精品色在线看不卡 | 国产永久免费高清在线| 亚洲午夜无码久久| 四虎必出精品亚洲高清| 亚洲人成在线播放网站| 日韩一卡2卡3卡4卡新区亚洲 | 亚洲国产一区二区三区青草影视| 日本免费的一级v一片| 久久爰www免费人成| 高潮毛片无遮挡高清免费视频|