官网给的demo

exists(String existsSql)
exists(boolean condition, String existsSql)
 

exists("select id from table where age = 1")--->exists (select id from table where age = 1)

新版本mybatis-plus 有三个参数

Children exists(String existsSql, Object... values);
Children exists(boolean condition, String existsSql, Object... values);

用法要有改变,原来那么用也可以,但是不严谨

exists("select 1 from TABLE where id = {0} and name = {1}", "123", "456");

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐