今天用Dapper更新是用到了IN写法,园子里找了篇文章这样写到
传统sql in (1,2,3) 用dapper就这样写
conn.Query<Users>("SELECT * FROM Users s WHERE s.id IN (@ids) ",new { ids = new int[]{1,2,3}}) conn.Query<Users>("SELECT * FROM Users s WHERE s.id IN (@ids) ",new { ids = IDs.ToArray()})