在线观看www成人影院-在线观看www日本免费网站-在线观看www视频-在线观看操-欧美18在线-欧美1级

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

mybatis plus的常規用法

科技綠洲 ? 來源:Java技術指北 ? 作者:Java技術指北 ? 2023-09-25 15:06 ? 次閱讀

上篇文章我們介紹過通過 Mybatis Plus 進行增刪改查,如下這段代碼:

/**
 * 根據id修改
 * UPDATE user SET user_name=?, user_age=? WHERE (id = ?)
 */
@Test
public void testudpateById(){
    User user = new User();
    user.setUserAge("25");
    user.setUserName("test update");
    UpdateWrapper updateWrapper = new UpdateWrapper();
    updateWrapper.eq("id","3");
    int num = userMapper.update(user, updateWrapper);
    System.out.println("修改的記錄數為:"+num);
}
     
/**
 * 查詢指定記錄
 * SELECT id,user_name,user_age FROM user WHERE (user_name = ?)
 */
@Test
public void testSelectWrapper(){
    QueryWrapper wrapper = new QueryWrapper();
    wrapper.eq("user_name","IT可樂");
    List< User > users = userMapper.selectList(wrapper);
    users.forEach(x- > System.out.println(x.getId()+"-"+x.getUserName()+"-"+x.getUserAge()));
}

上面兩個方法分別是根據id修改表記錄,和根據user_name查詢記錄。構造的條件使用了 UpdateWrapper 和 QueryWrapper ,那么這是什么呢?其實 mybatis plus 通過條件構造器可以組成復雜的SQL語句。本篇博客我們將詳細介紹。

1、Wrapper

Mybatis Plus 提供的幾種條件構造器,關系如下:

圖片

我們主要通過 QueryWrapper 和 UpdateWrapper 進行條件構造,這兩個和 LambdaQueryWrapper、LambdaUpdateWrapper 差不多是等價的,只不過后者采用了 JDK1.8 提供的lambda 語法,使用起來更簡潔。

2、語法詳情總結

關于條件構造器的各個用法介紹,可以參考官網:https://mp.baomidou.com/guide/wrapper.html#abstractwrapper

這里我們做一下總結:

方法名說明用法實例等價SQL
官網地址https://mp.baomidou.com/guide/wrapper.html#abstractwrapper----::----:
allEq(Map params)全部等于map.put("id","3");map.put("user_name","IT可樂");allEq(map)user_name = "IT可樂" AND id = 3
eq(R column, Object val)等于 =eq("id","3")id = 3
ne(R column, Object val)不等于 <>ne("id", "3")id <> 3
gt(R column, Object val)大于 >gt("user_age","18")user_age > 18
ge(R column, Object val)大于等于 >=ge("user_age","18")user_age >= 18
lt(R column, Object val)小于 <lt("user_age","18")user_age < 18
le(R column, Object val)小于等于 <=le("user_age","18")user_age <= 18
between(R column, Object val1, Object val2)BETWEEN 值1 AND 值2between("user_age","18","25")user_age BETWEEN 18 AND 25
notBetween(R column, Object val1, Object val2)NOT BETWEEN 值1 AND 值2notBetween("user_age","18","25")user_age NOT BETWEEN 18 AND 25
like(R column, Object val)LIKE '%值%'like("user_name","可樂")like ‘%可樂%’
notLike(R column, Object val)NOT LIKE '%值%'notLike("user_name","可樂")not like ‘%可樂%’
likeLeft(R column, Object val)LIKE '%值'likeLeft("user_name","可樂")like ‘%可樂’
likeRight(R column, Object val)LIKE '值%'likeRight("user_name","可樂")like ‘可樂%’
isNull(R column)字段 IS NULLisNull("user_name")user_name IS NULL
isNotNull(R column)字段 IS NOT NULLisNotNull("user_name")user_name IS NOT NULL
in(R column, Collection value)字段 IN (value.get(0), value.get(1), ...)in("user_age",{1,2,3})user_age IN (?,?,?)
notIn(R column, Collection value)字段 NOT IN (value.get(0), value.get(1), ...)notIn("user_age",{1,2,3})user_age NOT IN (?,?,?)
inSql(R column, String inValue)字段 IN ( sql語句 )inSql("id","select id from user")id IN (select id from user)
notInSql(R column, String inValue)字段 NOT IN ( sql語句 )notInSql("id","select id from user where id > 2")id NOT IN (select id from user where id > 2
groupBy(R... columns)分組:GROUP BY 字段, ...groupBy("id","user_age")GROUP BY id,user_age
orderByAsc(R... columns)排序:ORDER BY 字段, ... ASCorderByAsc("id","user_age")ORDER BY id ASC,user_age ASC
orderByDesc(R... columns)排序:ORDER BY 字段, ... DESCorderByDesc("id","user_age")ORDER BY id DESC,user_age DESC
orderBy(boolean condition, boolean isAsc, R... columns)ORDER BY 字段, ...orderBy(true,true,"id","user_age")ORDER BY id ASC,user_age ASC
having(String sqlHaving, Object... params)HAVING ( sql語句 )having("sum(user_age)>{0}","25")HAVING sum(user_age)>25
or()拼接 OReq("id",1).or().eq("user_age",25)id = 1 OR user_age = 25
and(Consumerconsumer)AND 嵌套and(i->i.eq("id",1).ne("user_age",18))id = 1 AND user_age <> 25
nested(Consumerconsumer)正常嵌套 不帶 AND 或者 ORnested(i->i.eq("id",1).ne("user_age",18))id = 1 AND user_age <> 25
apply(String applySql, Object... params)拼接 sql(不會有SQL注入風險)apply("user_age>{0}","25 or 1=1")user_age >'25 or 1=1'
last(String lastSql)拼接到 sql 的最后,多次調用以最后一次為準(有sql注入的風險)last("limit 1")limit 1
exists(String existsSql)拼接 EXISTS ( sql語句 )exists("select id from user where user_age = 1")EXISTS (select id from user where user_age = 1)
notExists(String notExistsSql)拼接 NOT EXISTS ( sql語句 )notExists("select id from user where user_age = 1")NOT EXISTS (select id from user where user_age = 1)

3、語法詳情演示

對于上表出現的每個語法,這里通過代碼展示出來。

更多可以參考地址:https://github.com/YSOcean/mybatisplusstudy.git

package com.ys.mybatisplusstudy;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ys.mybatisplusstudy.entry.User;
import com.ys.mybatisplusstudy.mapper.UserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@SpringBootTest
public class WrapperTest {
    @Autowired
    private UserMapper userMapper;
 
 
    /**
     * 新增一條記錄
     */
    @Test
    public void testInsert(){
        User user = new User();
        user.setId(4L);
        user.setUserName("test insert");
        user.setUserAge("1");
        int insert = userMapper.insert(user);
        System.out.println("影響記錄數:"+insert);
    }
 
    /**
     * allEq 全部等于
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_name = ? AND id = ?)
     */
    @Test
    public void testAllEq(){
        QueryWrapper queryWrapper = new QueryWrapper();
        Map map = new HashMap<  >();
        map.put("id","3");
        map.put("user_name","IT可樂");
        queryWrapper.allEq(map);
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * eq 等于
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (id = ?)
     */
    @Test
    public void testEq(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("id","3");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * ne 不等于
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (id <  > ?)
     */
    @Test
    public void testNe(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.ne("id","3");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * gt 大于
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age > ?)
     */
    @Test
    public void testGt(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.gt("user_age","18");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * ge 大于等于
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age >= ?)
     */
    @Test
    public void testGe(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.ge("user_age","18");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * lt 小于
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age < ?)
     */
    @Test
    public void testLt(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.lt("user_age","18");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * le 小于等于
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age <= ?)
     */
    @Test
    public void testLe(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.le("user_age","18");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * between 值1和值2之間,兩邊臨界值都包含
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age BETWEEN ? AND ?)
     */
    @Test
    public void testBetween(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.between("user_age","18","25");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * notBetween 不在值1和值2之間,兩邊臨界值都包含
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age NOT BETWEEN ? AND ?)
     */
    @Test
    public void testNoBetween(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.notBetween("user_age","18","25");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * like 模糊查詢,會在參數左右兩邊加上 %
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_name LIKE ?)
     */
    @Test
    public void testLike(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.like("user_name","可樂");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * notLike NOT LIKE ‘%parameter%’
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_name NOT LIKE ?)
     */
    @Test
    public void testNotLike(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.notLike("user_name","可樂");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * likeLeft LIKE ‘%parameter’
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_name LIKE '%parameter')
     */
    @Test
    public void testLikeLeft(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.likeLeft("user_name","可樂");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * likeRight LIKE ‘parameter%’
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_name LIKE 'parameter%')
     */
    @Test
    public void testLikeRight(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.likeRight("user_name","可樂");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
    /**
     * isNull 判斷字段為null
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_name IS NULL)
     */
    @Test
    public void testIsNull(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.isNull("user_name");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * isNotNull 判斷字段不為null
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_name IS NOT NULL)
     */
    @Test
    public void testIsNotNull(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.isNotNull("user_name");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
 
    /**
     * in 范圍定值查詢
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age IN (?,?,?))
     */
    @Test
    public void testIn(){
        QueryWrapper queryWrapper = new QueryWrapper();
        List< Integer > queryList = new ArrayList<  >();
        queryList.add(18);
        queryList.add(1);
        queryList.add(25);
        queryWrapper.in("user_age",queryList);
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * notIn
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age IN (?,?,?))
     */
    @Test
    public void testNotIn(){
        QueryWrapper queryWrapper = new QueryWrapper();
        List< Integer > queryList = new ArrayList<  >();
        queryList.add(18);
        queryList.add(1);
        queryList.add(25);
        queryWrapper.notIn("user_age",queryList);
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * inSql
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (id IN (select id from user))
     */
    @Test
    public void testInSql(){
        QueryWrapper queryWrapper = new QueryWrapper();
        //查詢所有數據
        queryWrapper.inSql("id","select id from user");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * notInSql
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (id NOT IN (select id from user where id > 2))
     */
    @Test
    public void testNotInSql(){
        QueryWrapper queryWrapper = new QueryWrapper();
        //查詢所有數據
        queryWrapper.notInSql("id","select id from user where id > 2");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
 
    /**
     * groupBy 分組
     * 下面SQL有個問題,在MySQL8.0版本中,是可以執行下面SQL語句的,select user_name并沒有出現在group by 語句中
     * 實例SQL:SELECT id,user_name,user_age FROM user GROUP BY id,user_age
     */
    @Test
    public void testGroupBy(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.groupBy("id","user_age");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
 
    /**
     * orderByAsc 升序
     * 實例SQL:SELECT id,user_name,user_age FROM user ORDER BY id ASC,user_age ASC
     */
    @Test
    public void testOrderByAsc(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.orderByAsc("id","user_age");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * orderByDesc 降序
     * 實例SQL:SELECT id,user_name,user_age FROM user ORDER BY id DESC,user_age DESC
     */
    @Test
    public void testOrderByDesc(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.orderByDesc("id","user_age");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * orderBy 指定順序排序
     * 實例SQL:SELECT id,user_name,user_age FROM user ORDER BY id ASC,user_age ASC
     */
    @Test
    public void testOrderBy(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.orderBy(true,true,"id","user_age");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
 
    /**
     * having
     * 實例SQL:SELECT id,user_name,user_age FROM user GROUP BY id,user_age HAVING sum(user_age) >?
     */
    @Test
    public void testHaving(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.groupBy("id","user_age");
        queryWrapper.having("sum(user_age) >{0}","25");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * having
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (id = ? OR user_age = ?)
     */
    @Test
    public void testOr(){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("id",1);
        queryWrapper.or();
        queryWrapper.eq("user_age",25);
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * and
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE ((id = ? AND user_age <  > ?))
     */
    @Test
    public void testAnd(){
        QueryWrapper< User > queryWrapper = new QueryWrapper<  >();
        queryWrapper.and(i- >i.eq("id",1).ne("user_age",18));
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
 
    /**
     * nested
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE ((id = ? AND user_age <  > ?))
     */
    @Test
    public void testNested(){
        QueryWrapper< User > queryWrapper = new QueryWrapper<  >();
        queryWrapper.nested(i- >i.eq("id",1).ne("user_age",18));
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * apply
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (user_age >?)
     */
    @Test
    public void testApplyd(){
        QueryWrapper< User > queryWrapper = new QueryWrapper<  >();
        queryWrapper.apply("user_age >{0}","25 or 1=1");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * last
     * 實例SQL:SELECT id,user_name,user_age FROM user limit 1
     */
    @Test
    public void testLast(){
        QueryWrapper< User > queryWrapper = new QueryWrapper<  >();
        queryWrapper.last("limit 1 ");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
 
    /**
     * exists
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (EXISTS (select id from user where user_age = 1))
     */
    @Test
    public void testExists(){
        QueryWrapper< User > queryWrapper = new QueryWrapper<  >();
        queryWrapper.exists("select id from user where user_age = 1");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
 
 
    /**
     * notExists
     * 實例SQL:SELECT id,user_name,user_age FROM user WHERE (EXISTS (select id from user where user_age = 1))
     */
    @Test
    public void testNotExists(){
        QueryWrapper< User > queryWrapper = new QueryWrapper<  >();
        queryWrapper.notExists("select id from user where user_age = 1");
        List< User > list = userMapper.selectList(queryWrapper);
        System.out.println(list);
    }
}

4、LambdaQueryWrapper和LambdaUpdateWrapper(推薦

LambdaQueryWrapper 和 LambdaUpdateWrapper 這是相對于 QueryWrapper 及 UpdateWrapper 的 Lmbda 語法實現方式。

分別通過如下兩種方式獲取:

//兩種方式        
LambdaQueryWrapper queryLambda = new QueryWrapper().lambda();
LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<  >();

//兩種方式
LambdaUpdateWrapper updateLambda = new UpdateWrapper().lambda();
LambdaUpdateWrapper lambdaUpdateWrapper = new LambdaUpdateWrapper();

注意:獲取LambdaQueryWrapper 和 LambdaUpdateWrapper 對象時,為了使用lambda語法,要使用泛型。

下面我演示幾個實例:

/**
 * LambdaQueryWrapper
 * SQL實例:SELECT id,user_name,user_age FROM user WHERE (id = ? AND user_age <  > ?)
 */
@Test
public void testLambdaQueryWrapper(){
    LambdaQueryWrapper< User > queryLambda = new LambdaQueryWrapper<  >();
    queryLambda.eq(User::getId,"1").ne(User::getUserAge,25);
    List< User > users = userMapper.selectList(queryLambda);
    System.out.println(users);
 
}
 
/**
 * LambdaQueryWrapper
 * SQL實例:UPDATE user SET user_name=? WHERE (user_name = ?)
 */
@Test
public void testLambdaUpdateWrapper(){
    User user = new User();
    user.setUserName("LambdaUpdateWrapper");
    LambdaUpdateWrapper< User > userLambdaUpdateWrapper = new LambdaUpdateWrapper<  >();
    userLambdaUpdateWrapper.eq(User::getUserName,"IT可樂");
    userMapper.update(user,userLambdaUpdateWrapper);
 
}

5、總結

對于mybatis plus 中的四種條件構造器,我們就到此結束了,大家可以按照我的實例敲一遍代碼,基本上就沒啥問題了。

有沒有發現使用 Lamba 語法很爽,語法簡潔,另外有個優點是,使用QueryWrapper或者UpdateWrapper時,對于條件的某個列,我們是寫的字符串配置,比如 QueryWrapper.eq("id",1);這里的id是數據庫表的列名,很有可能我們會寫錯,但是通過lambda 的方式,LambdaQueryWrapper.eq(User::getId,1),這樣就不會有寫錯的可能了。所以推薦大家使用Lambda 的方式。

至此,mybatis plus 的常規用法就全部介紹結束了,當然,事情還遠沒有結束,為了讓大家用的更爽,后續將給大家介紹一些高階玩法。

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • 代碼
    +關注

    關注

    30

    文章

    4788

    瀏覽量

    68612
  • 語法
    +關注

    關注

    0

    文章

    44

    瀏覽量

    9812
  • SQL語句
    +關注

    關注

    0

    文章

    19

    瀏覽量

    7032
  • Lambda
    +關注

    關注

    0

    文章

    29

    瀏覽量

    9878
  • mybatis
    +關注

    關注

    0

    文章

    60

    瀏覽量

    6713
收藏 人收藏

    評論

    相關推薦

    Mybatis的內部設計介紹

    Mybatis源碼分析-整體設計(一)
    發表于 06-06 09:43

    MyBatis的整合

    SpringBoot-15-之整合MyBatis-注解篇+分頁
    發表于 10-28 08:09

    Mybatis是什么

    Mybatis第一講
    發表于 06-04 15:33

    KEIL斷點調試窗口的常規用法有哪些

    程序運行過程中的數據是怎么修改的?在哪里修改的?KEIL斷點調試窗口的常規用法有哪些?
    發表于 02-17 06:32

    FreeRTOS plus用法實例講解

    本文檔的主要內容詳細介紹的是FreeRTOS plus用法實例講解。
    發表于 11-07 17:31 ?19次下載
    FreeRTOS <b class='flag-5'>plus</b>的<b class='flag-5'>用法</b>實例講解

    一篇讓你熟練掌握 MyBatis-Plus

    MyBatis-plus 是一款 Mybatis 增強工具,用于簡化開發,提高效率。下文使用縮寫 mp來簡化表示 MyBatis-plus,本文主要介紹 mp 搭配 Spring Boot
    的頭像 發表于 06-01 09:30 ?2608次閱讀
    一篇讓你熟練掌握 <b class='flag-5'>MyBatis-Plus</b>!

    Mybatis-Plus Mybatis增強工具包

    ./oschina_soft/gitee-mybatis-plus.zip
    發表于 06-13 11:34 ?1次下載
    <b class='flag-5'>Mybatis-Plus</b> <b class='flag-5'>Mybatis</b>增強工具包

    easy-mybatis Mybatis的增強框架

    ./oschina_soft/gitee-easy-mybatis.zip
    發表于 06-14 09:45 ?1次下載
    easy-<b class='flag-5'>mybatis</b> <b class='flag-5'>Mybatis</b>的增強框架

    MyBatis-Plus的使用與測試

    本文主要介紹mybatis-plus這款插件,針對springboot用戶。包括引入,配置,使用,以及擴展等常用的方面做一個匯總整理,盡量包含大家常用的場景內容。
    的頭像 發表于 08-22 11:56 ?1322次閱讀

    Fluent Mybatis、原生MybatisMybatis Plus對比

    mapper中再組裝參數。那對比原生Mybatis, Mybatis Plus或者其他框架,FluentMybatis提供了哪些便利呢?
    的頭像 發表于 09-15 15:41 ?1434次閱讀

    MyBatis-Plus為什么不支持聯表

    MyBatis Plus Join`一款專門解決MyBatis Plus 關聯查詢問題的擴展框架,他并不一款全新的框架,而是基于`MyBatis
    的頭像 發表于 02-28 15:19 ?2471次閱讀
    <b class='flag-5'>MyBatis-Plus</b>為什么不支持聯表

    介紹一款基于Mybatis-Plus的代碼自助生成器

    在基于Mybatis的開發模式中,很多開發者還會選擇Mybatis-Plus來輔助功能開發,以此提高開發的效率。
    的頭像 發表于 05-23 14:16 ?1147次閱讀
    介紹一款基于<b class='flag-5'>Mybatis-Plus</b>的代碼自助生成器

    如何調優MyBatis 25倍性能

    最近在壓測一批接口,發現接口處理速度慢的有點超出預期,感覺很奇怪,后面定位發現是數據庫批量保存這塊很慢。 這個項目用的是 mybatis-plus,批量保存直接用的是 mybatis-plus 提供的 saveBatch。 我點進去看了下源碼,感覺有點不太對勁
    的頭像 發表于 05-30 09:56 ?609次閱讀
    如何調優<b class='flag-5'>MyBatis</b> 25倍性能

    MyBatis Plus如何簡化開發

    本篇文章,我們通過 MyBatis Plus 來對一張表進行 CRUD 操作,來看看是如何簡化我們開發的。 1、創建測試表 創建 USER 表: DROP TABLE IF EXISTS
    的頭像 發表于 10-09 15:08 ?428次閱讀
    <b class='flag-5'>MyBatis</b> <b class='flag-5'>Plus</b>如何簡化開發

    mybatis和mybatisplus的區別

    MyBatisMyBatis Plus是兩個非常受歡迎的Java持久層框架。這兩個框架在設計和功能上有一些區別,下面我將詳細介紹它們之間的差異以及各自的特點。 設計理念與目標: MyBati
    的頭像 發表于 12-03 11:53 ?2562次閱讀
    主站蜘蛛池模板: 26uuu欧美日本| 亚洲精品欧洲久久婷婷99| 国产在线一区视频| 特黄视频| 34pao强力打造免费永久视频| 性中国videosex国产孕妇| 看日本黄大片在线观看| 国产农村一级特黄α真人毛片| 奇米影视777欧美在线观看| 亚洲光棍天堂| 女性一级全黄生活片在线播放| 国产婷婷色| 国产片18在线观看| 69女poren18中国| 四大名著成人高h肉版| qyule亚洲精品| 六月丁香激情| 日本高清www| 天天看天天做| 边做饭边被躁欧美三级小说| 婷婷中文网| 俺不色| 欧美激情αv一区二区三区| www日本免费| 黄色免费小视频| 91精品啪国产在线观看免费牛牛 | 国产精品xxxav免费视频| 婷婷久久综合| 一本大道加勒比久久| 亚洲视频入口| 久久精品国产清自在天天线| 加勒比一本一道在线| 亚洲合集综合久久性色| www.成人av.com| 一区二区在线观看高清| 六月丁香中文字幕| 成年男人午夜片免费观看| 操白虎美女| 丁香五香天堂网| 亚洲黄色在线网站| 激情亚洲|