where 1=1 ${if(lev==2," and n_level in (2,3,31,4) ",if(lev==3," and n_level in (3,31,4) ",if(lev==31," and n_level in (31,4) ","and n_level=4)))}
如果lev=2就in(2,3,31,4);如果lev=3,就in(3,31,4);如果lev=31,就in(31,4),否则就n_level=4
删了and
where 1=1 ${if(lev==2," and n_level in ('2','3','31','4') ",if(lev==3," and n_level in ('3','31','4') ",if(lev==31," and n_level in ('31','4') ","and n_level=4)))}
where 1=1 ${if(lev='2'," and n_level in (2,3,31,4) ",if(lev='3'," and n_level in (3,31,4) ",if(lev='31'," and n_level in (31,4) ","and n_level=4)))}
参数等于的数 加单引号
少了双引号
您好,我是社区管理员兔子酱,您的该采纳属于违规采纳,现予撤回。
自己采纳自己的前提:回答中没有正确的答案,可自己回答后采纳自己,并且需要详述答案,不能只是简单的“已解决”“自己解决了”,且回答不能与已有回答相同/相似;
若回答内容相同/相似,需按照回答时间先后的顺序进行采纳哦,否则就是违规哦~
另外,自己采纳自己不会有任何实质性的奖励,也就是说不会获得F币和贡献值的的奖励。
所以,还是建议楼主尽量按规定采纳认真回答的用户~