com.baomidou.mybatisplus.mapper.Wrapper.like()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(508)

本文整理了Java中com.baomidou.mybatisplus.mapper.Wrapper.like()方法的一些代码示例,展示了Wrapper.like()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrapper.like()方法的具体详情如下:
包路径:com.baomidou.mybatisplus.mapper.Wrapper
类名称:Wrapper
方法名:like

Wrapper.like介绍

暂无

代码示例

代码示例来源:origin: stylefeng/Guns

@Override
public List<Long> getSubDeptId(Long deptId) {
  Wrapper<Dept> wrapper = new EntityWrapper<>();
  wrapper = wrapper.like("PIDS", "%[" + deptId + "]%");
  List<Dept> depts = this.deptMapper.selectList(wrapper);
  ArrayList<Long> deptids = new ArrayList<>();
  if (depts != null && depts.size() > 0) {
    for (Dept dept : depts) {
      deptids.add(dept.getDeptId());
    }
  }
  return deptids;
}

代码示例来源:origin: stylefeng/Guns

/**
 * 删除菜单包含所有子菜单
 *
 * @author stylefeng
 * @Date 2017/6/13 22:02
 */
@Transactional
public void delMenuContainSubMenus(Long menuId) {
  Menu menu = menuMapper.selectById(menuId);
  //删除当前菜单
  delMenu(menuId);
  //删除所有子菜单
  Wrapper<Menu> wrapper = new EntityWrapper<>();
  wrapper = wrapper.like("PCODES", "%[" + menu.getCode() + "]%");
  List<Menu> menus = menuMapper.selectList(wrapper);
  for (Menu temp : menus) {
    delMenu(temp.getMenuId());
  }
}

代码示例来源:origin: stylefeng/Guns

/**
 * 删除部门
 *
 * @author fengshuonan
 * @Date 2018/12/23 5:16 PM
 */
@Transactional
public void deleteDept(Long deptId) {
  Dept dept = deptMapper.selectById(deptId);
  //根据like查询删除所有级联的部门
  Wrapper<Dept> wrapper = new EntityWrapper<>();
  wrapper = wrapper.like("PIDS", "%[" + dept.getDeptId() + "]%");
  List<Dept> subDepts = deptMapper.selectList(wrapper);
  for (Dept temp : subDepts) {
    this.deleteById(temp.getDeptId());
  }
  this.deleteById(dept.getDeptId());
}

代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot

/**
 * <p>
 * LIKE条件语句,value中无需前后%
 * </p>
 *
 * @param column
 *            字段名称
 * @param value
 *            匹配值
 * @return this
 */
public Wrapper<T> like(String column, String value) {
  return super.like(handleColumn(column), value);
}

代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot

/**
 * <p>
 * LIKE条件语句,value中无需前后%
 * </p>
 *
 * @param column
 *            字段名称
 * @param value
 *            匹配值
 * @param type
 * @return this
 */
public Wrapper<T> like(String column, String value, SqlLike type) {
  return super.like(handleColumn(column), value, type);
}

代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot

/**
 * <p>
 * LIKE条件语句,value中无需前后%
 * </p>
 *
 * @param condition
 *            拼接的前置条件
 * @param column
 *            字段名称
 * @param value
 *            匹配值
 * @return this
 */
public Wrapper<T> like(boolean condition, String column, String value) {
  return super.like(condition, handleColumn(column), value);
}

代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot

/**
 * <p>
 * NOT LIKE条件语句,value中无需前后%
 * </p>
 *
 * @param condition
 *            拼接的前置条件
 * @param column
 *            字段名称
 * @param value
 *            匹配值
 * @return this
 */
public Wrapper<T> notLike(boolean condition, String column, String value) {
  return super.like(condition, handleColumn(column), value);
}

代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot

/**
 * <p>
 * LIKE条件语句,value中无需前后%
 * </p>
 *
 * @param condition
 *            拼接的前置条件
 * @param column
 *            字段名称
 * @param value
 *            匹配值
 * @param type
 * @return this
 */
public Wrapper<T> like(boolean condition, String column, String value, SqlLike type) {
  return super.like(condition, handleColumn(column), value);
}

代码示例来源:origin: qiurunze123/GEEKQ-CM

/**
 * 获取子部门id
 */
@Override
public List<Integer> getSubDeptId(Integer deptid) {
  Wrapper<Dept> wrapper = new EntityWrapper<>();
  wrapper = wrapper.like("pids", "%[" + deptid + "]%");
  List<Dept> depts = this.deptMapper.selectList(wrapper);
  ArrayList<Integer> deptids = new ArrayList<>();
  if(depts != null && depts.size() > 0){
    for (Dept dept : depts) {
      deptids.add(dept.getId());
    }
  }
  return deptids;
}

代码示例来源:origin: qiurunze123/GEEKQ-CM

@Override
public void deleteDept(Integer deptId) {
  Dept dept = deptMapper.selectById(deptId);
  Wrapper<Dept> wrapper = new EntityWrapper<>();
  wrapper = wrapper.like("pids", "%[" + dept.getId() + "]%");
  List<Dept> subDepts = deptMapper.selectList(wrapper);
  for (Dept temp : subDepts) {
    temp.deleteById();
  }
  dept.deleteById();
}

代码示例来源:origin: qiurunze123/GEEKQ-CM

@Override
public void delMenuContainSubMenus(Long menuId) {
  Menu menu = menuMapper.selectById(menuId);
  //删除当前菜单
  delMenu(menuId);
  //删除所有子菜单
  Wrapper<Menu> wrapper = new EntityWrapper<>();
  wrapper = wrapper.like("pcodes", "%[" + menu.getCode() + "]%");
  List<Menu> menus = menuMapper.selectList(wrapper);
  for (Menu temp : menus) {
    delMenu(temp.getId());
  }
}

代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot

wrapper.like(filter.getProperty(), (String) value);

相关文章