zoukankan      html  css  js  c++  java
  • MybatisPuls中QueryWrapper的select、update的用法

    地址:https://blog.csdn.net/u014635374/article/details/107311227

    切记:引入MybatisPlus后,禁止引入Mybatis,避免没必要的冲突

    1. /**
    2.  
      * <p>
    3.  
      * 根据根据 entity 条件,删除记录,QueryWrapper实体对象封装操作类(可以为 null)
    4.  
      * 下方获取到queryWrapper后删除的查询条件为name字段为null的and年龄大于等于12的and email字段不为null的
    5.  
      * 同理写法条件添加的方式就不做过多介绍了。
    6.  
      * </p>
    7.  
      */
    8.  
      @Test
    9.  
      public void delete() {
    10.  
      QueryWrapper<User> queryWrapper = new QueryWrapper<>();
    11.  
      queryWrapper
    12.  
      .isNull("name")
    13.  
      .ge("age", 12)
    14.  
      .isNotNull("email");
    15.  
      int delete = mapper.delete(queryWrapper);
    16.  
      System.out.println("delete return count = " + delete);
    17.  
      }

     

  • 相关阅读:
    Java基本数据类型之间转换
    python 元组tuple
    python 列表List
    python 字符串
    python for循环
    python break/continue
    python while循环
    python条件判断if/else
    python运算符
    python变量
  • 原文地址:https://www.cnblogs.com/mark5/p/14107058.html
Copyright © 2011-2022 走看看