传参的时候显示行政等级是无效列?
select '国道' 行政等级,code,name from 表名
${if(len(XZDJ)==0,""," AND 行政等级 = '"+XZDJ+"'")}
再套一层呀,还有你没有写where 1=1后面就直接用and。语法也不对。。
select t.* from (
) t
where 1=1
${if(len(XZDJ)==0,""," AND t.行政等级 = '"+XZDJ+"'")}
改成国道就行了 重命名以后的不能做参数