mybatisplus 模糊查询like

 

1、mybatisPlus_eq 实现类似

  1. <if test="a!=null">

  2.     AND a = #{a}

  3. </if>

Wrapper wrapper= Condition.create().eq(VerifyUtil.isNNull(sysOffice.getParentId()),"PARENT_ID",sysOffice.getParentId());VerifyUtiisNNull(sysOffice.getParentId()),"PARENT_ID",sysOffice.getParentId());

2、like

like(boolean condition, String column, String value)
like(String column, String value)
like(boolean condition, String column, String value, SqlLike type)
like(String column, String value, SqlLike type)

condition 是一些条件,符合才可加上你的sql
column 为 数据库属性
value 为 你传入的值
type 为 % 拼在那边:    
    SqlLike 为枚举类
    LEFT("left", "左边%"),
    RIGHT("right", "右边%"),
    CUSTOM("custom", "定制"),
    DEFAULT("default", "两边%");

猜你喜欢

转载自blog.csdn.net/It_BeeCoder/article/details/90641959