MyBatis Plus框架學習 概述及上手

2021-10-08 23:47:45 字數 2119 閱讀 1367

目錄

一、mybatis-plus簡介

二、mybatis-plus上手

1、準備工作

(1)資料庫建表

(2)新建springboot專案

(3)匯入mybatisplus的依賴

(4) yml配置檔案

2、正式開始

專案結構如下

(1)建立實體類

(3)建立測試類

(4)啟動類

啟動測試類效果如下:

國產的開源框架,基於mybatis

核心功能是簡化mybatis的開發,提高效率

底層採用cglib動態**方式

springboot(2.3.2)+mybatis-plus(國產的框架,沒有接入到spring官方孵化器中)

#加入後可列印日誌

*@date: 2023年8月9日 16:17:36

*/@data

public class user

* @author shkstart

* @create 2020-08-09 16:23

*/import mybatisplus.mybatisplus.entity.user;

/** *@program: mybatisplus

*@description: 使用者介面

Mybatis Plus學習筆記

實體類屬性 建立日期 tablefield fill fieldfill.insert private date createtime 更新日期 tablefield fill fieldfill.insert update private date updatetime 3.0版本之前的配置類 c...

Mybatis Plus學習筆記(五) 刪除

本系列部落格其他文章下方鏈結檢視 mybatis plus學習筆記 目錄 很簡單,一句就可以了,返回影響的行數。相當於 debug preparing delete from user where id debug parameters 1088250446457389058 long 和查詢相似的...

Mybatis Plus學習筆記(四) 更新

本系列部落格其他文章下方鏈結檢視 mybatis plus學習筆記 目錄 mp中的updatebyid需要傳入乙個實體 必須有id 不為null的值都會被更改,返回影響的行數。如下 user user new user user.setid 1087982257332887553l user.set...