sm:标识符无效

 部分代码如下,然后想把它做成复选框组合的形式,但是报错了

(case when  g.vbdef15 is  not  null then '经过云采招标/寻源'

  when  a.vmemo='来自云采系统的订单' then '经过云采招标/寻源'

  else '无'

  end) as sm

----------------------

${if(len(说明)>0,"AND sm in('"+说明+"')","")}

image.png

image.png

FineReport Scyalcire 发布于 2019-12-17 09:23
1min目标场景问卷 立即参与
回答问题
悬赏:4 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
黄源Lv6中级互助
发布于2019-12-17 09:25(编辑于 2019-12-17 09:38)

 select * from (select distinct d.vbillcode 请购单号,

e.name 采购组织,

f.user_name 请购制单人,

d.dmakedate 请购制单时间,

d.vdef1 请购总金额,

h.vbillcode 采购合同号,

g.vbdef15 合同Code云采,

a.vbillcode 采购订单号,

a.vmemo 采购订单备注,

(case

when g.vbdef15 is not null then

'经过云采招标/寻源'

when a.vmemo = '来自云采系统的订单' then

'经过云采招标/寻源'

else

'无'

end) as sm

from po_order a

left join po_order_b b

on a.pk_order = b.pk_order

and nvl(b.dr, 0) = 0

left join po_praybill_b c

on c.pk_praybill_b = b.cpraybillbid

and nvl(c.dr, 0) = 0

left join po_praybill d

on d.pk_praybill = c.pk_praybill

and nvl(d.dr, 0) = 0

left join org_purchaseorg e

on e.pk_purchaseorg = a.pk_org

and nvl(e.dr, 0) = 0

left join sm_user f

on f.cuserid = d.creator

and nvl(f.dr, 0) = 0

left join ct_pu_b g

on g.csrcbid = c.pk_praybill_b

and nvl(g.dr, 0) = 0

left join ct_pu h

on h.pk_ct_pu = g.pk_ct_pu

and nvl(h.dr, 0) = 0

where d.vbillcode is not null

${if(len(制单开始日期) > 0 &&len(制单结束日期) > 0,

" and d.dmakedate BETWEEN '" + 制单开始日期 + "' AND '" + 制单结束日期 + "'",

"") }

${if(len(请购单号) > 0, "AND d.vbillcode ='" + 请购单号 + "'", "") }

${if(len(采购组织) > 0, "AND e.name ='" + 采购组织 + "'", "") }

${if(len(制单人) > 0, "AND f.user_name ='" + 制单人 + "'", "") }

${if(len(采购合同号) > 0,

"AND h.vbillcode ='" + 采购合同号 + "'",

"") } ${if(len(采购订单号) > 0,

"AND a.vbillcode ='" + 采购订单号 + "'",

"") }

order by d.vbillcode)

where 1=1 ${if(len(说明) > 0, "AND sm in('" + 说明 + "')", "") }

这种情况才可以用sm



  • Scyalcire Scyalcire(提问者) 我知道 但是我代码不止这么多 这个是全的: select distinct d.vbillcode 请购单号, e.name 采购组织, f.user_name 请购制单人, d.dmakedate 请购制单时间, d.vdef1 请购总金额, h.vbillcode 采购合同号, g.vbdef15 合同Code云采, a.vbillcode 采购订单号, a.vmemo 采购订单备注, (case when g.vbdef15 is not null then \'经过云采招标/寻源\' when a.vmemo=\'来自云采系统的订单\' then \'经过云采招标/寻源\' else \'无\' end) as sm from po_order a left join po_order_b b on a.pk_order = b.pk_order and nvl(b.dr,0)=0 left join po_praybill_b c on c.pk_praybill_b= b.cpraybillbid and nvl(c.dr,0)=0 left join po_praybill d on d.pk_praybill = c.pk_praybill and nvl(d.dr,0)=0 left join org_purchaseorg e on e.pk_purchaseorg= a.pk_org and nvl(e.dr,0)=0 left join sm_user f on f.cuserid = d.creator and nvl(f.dr,0)=0 left join ct_pu_b g on g.csrcbid = c.pk_praybill_b and nvl(g.dr,0)=0 left join ct_pu h on h.pk_ct_pu = g.pk_ct_pu and nvl(h.dr,0)=0 where d.vbillcode is not null ${if(len(制单开始日期)>0&&len(制单结束日期)>0,\" and d.dmakedate BETWEEN \'\"+制单开始日期+\"\' AND \'\"+制单结束日期+\"\'\",\"\")} ${if(len(请购单号)>0,\"AND d.vbillcode =\'\"+请购单号+\"\'\",\"\")} ${if(len(采购组织)>0,\"AND e.name =\'\"+采购组织+\"\'\",\"\")} ${if(len(制单人)>0,\"AND f.user_name =\'\"+制单人+\"\'\",\"\")} ${if(len(采购合同号)>0,\"AND h.vbillcode =\'\"+采购合同号+\"\'\",\"\")} ${if(len(采购订单号)>0,\"AND a.vbillcode =\'\"+采购订单号+\"\'\",\"\")} ${if(len(说明)>0,\"AND sm in(\'\"+说明+\"\')\",\"\")} order by d.vbillcode
    2019-12-17 09:29 
  • 黄源 黄源 回复 Scyalcire(提问者) 看修改
    2019-12-17 09:38 
  • 2关注人数
  • 460浏览人数
  • 最后回答于:2019-12-17 09:38
    请选择关闭问题的原因
    确定 取消
    返回顶部