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;

 

posted @ 2018-05-16 12:13  love郎朗you  阅读(866)  评论(0编辑  收藏  举报