select a.khm as 客户名称,(select xm from uf_khgl where id=a.khm) as 客户名称显示 ,a.jssr as 结算收入 ,a.ddfwjl as 订单服务经理,(select lastname from dbo.[HrmResource] where id=a.ddfwjl) as 员工显示 ,case when a.dkjedw=1 then a.dkje*a.hl/10000 else a.dkje*a.hl end as 销量 from uf_ddgl a where a.jsfs='1' and a.ddzt in('2','3') and a.jsrq>='${ksrq}' and a.jsrq<='${jsrq}' union all select a.khm as 客户名称,(select xm from uf_khgl where id=a.khm) as 客户名称显示 ,a.ddfwjl as 订单服务经理,(select lastname from dbo.[HrmResource] where id=a.ddfwjl) as 员工显示 ,case when a.dkjedw=1 then a.dkje*a.hl/10000 else a.dkje*a.hl end as 销量 ,b.jssr as 结算收入 ,b.srgx as 收入贡献 from uf_ddgl a left join uf_ddgl_dt1 b on b.mainid=a.id where a.jsfs='0' and a.ddzt in('2','3') and b.jxrq>='${ksrq}' and b.jxrq<='${jsrq}' |
最佳回答 |
||||
0
|
|