现在要做参数联动 SELECT 货主省份 FROM 订单 where 货主地区 in ('${area}') (这个是帆软模板里参数联动的SQL) SELECT DISTINCT kostl FROM AA where LEFT(kostl,2) in (LEFT('${工厂}',2)) (这个是我的SQL,没问题,但是实现不了工厂为空选择全部) 现在希望拼成这样 SELECT DISTINCT kostl FROM AA where 1=1 ${if(len('${工厂}')==0,"","and LEFT(kostl,2) in (LEFT('${工厂}',2))")} (报空指针) 求SQL |
最佳回答 |
||||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|