sqlid in(1,2,3)对个id查询
我现在想传入参数写比如id in #={id}我传入{1,2,3}查询的出来嘛?
收起
那肯定不行啊,in可以查询多个条件,等号只能查出结果相等的,不能in后边接等号,可以传进来一个list ,mybaits的话可以foreach去遍历,类似于这样
where id in <foreach item="item" index="index" collection="list" open="(" separator="," close=")"> #{item} </foreach>
报告相同问题?