12345678910111213141516171819202122 |
- --等擂勤桽桶
- if exists (select * from sysobjects where id = object_id('dbo.usp_datamaps') )
- drop view dbo.usp_datamaps
- go
- Create view usp_datamaps
- as
- select '[坻⻌踱等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from rdrecord08
- union
- select '[坻堤踱等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from rdrecord09
- union
- select '粒劃⻌踱等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from rdrecord01
- union
- select '粒劃豖億等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from PU_ArrivalVouch
- union
- select '种忮豖億等' as vouchertype,cdlcode as ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from dispatchlist
- union
- select '种忮隆等' as vouchertype,csocode as ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from so_somain
- union
- select '粒劃隆等' as vouchertype,cpoid as ccode,newcode,dpodate as ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from po_pomain
- go
|