我想实现sql语句where后面的条件拼接,就是通过if判断去拼接,这个怎么写?mysql数据库。
where 1=1
${if(len(参数1)=0,""," AND 字段1 IN ('"+参数1+"')")}
${if(len(参数2)=0,""," AND 字段2 IN ('"+参数2+"')")}
一般是这样