@Select("<script>"+"select * from user where id in("+"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>"+"#{id}"+"</foreach>"+")"+"</script>")
List<User>getUserList(@Param("ids") List<String> ids)
第一种在Dao接口中自定义SQL查询,拼接xml字符串UserDaoMapper.java @Select("<script>" +"select * from user where id in(" + "<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>" + "#{id}"