数据源:
select gsid as namex,nd ,isnull(je,0) as jex,isnull(je_ys,0) as ye_ysx,isnull(a.je_js,0) as je_s from View_gshz
left join (select gsid as gs,nd as ndx,je_js from View_gshz_js) a on View_gshz.gsid=a.gs and View_gshz.nd=a.ndx
where gsid is not null and nd is not null
union
select gsid ,nd ,isnull(a.a_je,0) as jex, isnull(a.a_jeys,0) as je_ys,isnull(je_js,0) as je_s from View_gshz_js
left join (select gsid as gs,nd as ndx,je as a_je,je_ys as a_jeys from View_gshz) a on View_gshz_js.gsid=a.gs and View_gshz_js.nd=a.ndx
where gsid is not null and nd is not null