Oracle中table数据数据类型

function F_ReturnDescription(varID in varchar2) return varchar2 is
  
    numDataCount number(12);
    mytable      ly_familyproperty%rowtype;
  begin
  
    select count(1)
      into numDataCount
      from ly_familyproperty t
     where t.id = varID;
    if numDataCount = 0 then
      return '';
    end if;
    select * into mytable from ly_familyproperty where id = varID;
    /*
    1:公积金;2:社保;3:企业所得税缴纳情况;4:工商登记情况;5:个人所得税缴纳情况;
    6:非居住类房屋情况;7:机动车辆登记情况;8:其他财产
    */
    if mytable.propertype = '1' then
      return '月缴存额:' || mytable.MONEY || '';
    elsif mytable.propertype = '2' then
      return '月缴存额:' || mytable.MONEY || '';
    elsif mytable.propertype = '3' then
      return '月缴纳基数:' || mytable.MONEY || '';
    elsif mytable.propertype = '4' then
      return '工商主体名称:' || mytable.BUSINESS_TITLE || ';' || '登记时间:' || to_char(mytable.CHECK_TIME,
                                                                              'yyyy-mm-dd') || ';' || '出资额:' || mytable.MONEY || '万元';
    elsif mytable.propertype = '5' then
      return '月缴纳基数:' || mytable.MONEY || '';
    elsif mytable.propertype = '6' then
      return '房屋地址:' || mytable.ADDRESS || ';建筑面积:' || mytable.BUILDAREA || ';发证时间:' || to_char(mytable.CHECK_TIME,
                                                                                                'yyyy-mm-dd') || ';产权证号:' || mytable.PRONUM;
    elsif mytable.propertype = '7' then
      return '品牌:' || mytable.brand || ';排量:' || mytable.EXHAUST_VOLUME || ';车辆使用性质:' || mytable.USE_NATURE || ';登记时间:' || to_char(mytable.CHECK_TIME,
                                                                                                                                   'yyyy-mm-dd');
    elsif mytable.propertype = '8' then
      return mytable.business_title;
    else
      return '';
    end if;
  
  end F_ReturnDescription;

 

posted @ 2019-03-17 21:24  王小鹏  阅读(3068)  评论(0编辑  收藏  举报