zoukankan      html  css  js  c++  java
  • sql 生成javabean实体

    select a.name,c.name,b.name,
    'private String '+lower(c.name)+';'
    from sysobjects a, systypes b, syscolumns c
    where a.xtype = 'u'
    and a.id = c.id
    and b.xtype = c.xtype
    and b.name <> 'SYSNAME'
    and a.name='T_EVALUATION'
    order by c.id;

    select 'private String ' || lower(c.COLUMN_NAME) ||';' from user_tab_columns c where c.table_name='A_JZZ'

    select a.name,c.name,b.name,
    'private String '+lower(c.name)+';'
    from sysobjects a, systypes b, syscolumns c
    where a.xtype = 'u'
    and a.id = c.id
    and b.xtype = c.xtype
    and b.name <> 'SYSNAME'
    and a.name='T_EVALUATION'
    order by c.id;

    select 'private String ' || lower(c.COLUMN_NAME) ||';' from user_tab_columns c where c.table_name='A_JZZ'

    create function PoNumber(@a datetime) returns varchar(50)
    begin
    declare @id varchar(50),@i int
    select top 1 @id=pono from dbo.po where left(pono,8)= convert(varchar(8),@a,112) order by pono desc
    if @@rowcount=0
    return convert(varchar(8),@a,112)+'001'
    set @i= rtrim(right(@id,3)) +1
    set @id=rtrim(@i)
    return convert(varchar(8),@a,112)+right( '000'+@id ,3 )
    end


    select aa.*,
    case when cast(aa.ProduceSize as decimal(9,2)) > 0 then aa.ProduceSize + 'ถึ'
    when cast(aa.ProduceSize2 as decimal(9,2)) > 0 then aa.ProduceSize2 + 'ึป'
    when cast(aa.ProduceSize as decimal(9,2)) = 0 and cast(aa.ProduceSize2 as decimal(9,2)) = 0 then aa.ProduceSize + 'ถึ'
    else aa.ProduceSize end wwwww,
    bb.LICENCEID aaaaa,bb.zhuanyiliang,
    cast((cast(aa.ProduceSize as decimal(9,2))-
    cast(case when bb.zhuanyiliang IS null or bb.zhuanyiliang IS NULL then '0' else bb.zhuanyiliang end as decimal(9,2))
    ) as nvarchar) + 'ถึ' ccc
    from (
    select LicenceID,LicenceName,Address,i.conname,isnull(ProduceSize,0) ProduceSize,isnull(ProduceSize2,0)ProduceSize2,CertificalTime,PeriodTime
    from T_Licence left join T_COMMON_INFO i on T_Licence.RegionCode= i.CONCODE and i.objtype='101') aa
    left join (
    select LicenceID,SUM(cast(DangerCount as int)) as zhuanyiliang from
    T_TranferDetail group by CORPID,LicenceID) bb
    on aa.LICENCEID = bb.LICENCEID;

    select (cast('22.0' as decimal(9,2))- cast('12.00' as decimal(9,2))) ccc;

  • 相关阅读:
    linux常用命令
    PHP 魔术方法浅谈
    PHP常用的设计模式
    浅谈Restful
    进程,线程与协程的区别
    http与https的
    get与post的区别
    php连接数据库的两种方式
    DRF框架基本组件之过滤,搜索,排序
    DRF-JWT用户认证
  • 原文地址:https://www.cnblogs.com/lovelanglangyou/p/9045300.html
Copyright © 2011-2022 走看看