view.sql 1.4 KB

12345678910111213141516171819202122
  1. --等擂勤桽桶
  2. if exists (select * from sysobjects where id = object_id('dbo.usp_datamaps') )
  3. drop view dbo.usp_datamaps
  4. go
  5. Create view usp_datamaps
  6. as
  7. select '[坻⻌踱等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from rdrecord08
  8. union
  9. select '[坻堤踱等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from rdrecord09
  10. union
  11. select '粒劃⻌踱等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from rdrecord01
  12. union
  13. select '粒劃豖億等' as vouchertype,ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from PU_ArrivalVouch
  14. union
  15. select '种忮豖億等' as vouchertype,cdlcode as ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from dispatchlist
  16. union
  17. select '种忮隆等' as vouchertype,csocode as ccode,newcode,ddate,importdate,processdate, case when direction=1 then '咺虛籵善U8' else 'U8善咺虛籵' end as transtype from so_somain
  18. union
  19. 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
  20. go