国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Springboot整合mybatisplus實(shí)戰(zhàn)

這篇具有很好參考價(jià)值的文章主要介紹了Springboot整合mybatisplus實(shí)戰(zhàn)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

Springboot整合mybatisplus,純后端,驗(yàn)證結(jié)果是通過postman調(diào)用的,記錄一下

1、建表語(yǔ)句以及初始化數(shù)據(jù)腳本

CREATE TABLE `tbl_book` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10014 DEFAULT CHARSET=utf8

INSERT INTO `tbl_book` VALUES (10000, '計(jì)算機(jī)理論', 'Java編程思想(第4版)', 'Java學(xué)習(xí)經(jīng)典,殿堂級(jí)著作!贏得了全球程序員的廣泛贊譽(yù)。');
INSERT INTO `tbl_book` VALUES (10001, '計(jì)算機(jī)理論', '計(jì)算機(jī)組成原理', '資深的計(jì)算機(jī)體系結(jié)構(gòu)教育家Alan Clements博士編寫,涵蓋計(jì)算機(jī)系統(tǒng)的組成和體系結(jié)構(gòu)的基本概念、指令系統(tǒng)以及處理器實(shí)現(xiàn)等涉及計(jì)算機(jī)組成原理課程的內(nèi)容。');
INSERT INTO `tbl_book` VALUES (10002, '程序設(shè)計(jì)', 'C++ Primer Plus 第6版 中文版', 'C++程序設(shè)計(jì)經(jīng)典教程,暢銷30年的C++大百科全書全新升級(jí),經(jīng)典C++入門教程十年新版再現(xiàn)\')');
INSERT INTO `tbl_book` VALUES (10003, '程序設(shè)計(jì)', 'RocketMQ技術(shù)內(nèi)幕:RocketMQ架構(gòu)設(shè)計(jì)與實(shí)現(xiàn)原理(第2版)', '暢銷書升級(jí),RocketMQ創(chuàng)始人高度評(píng)價(jià),深入源碼分析技術(shù)架構(gòu)和實(shí)現(xiàn)原理,打造高性能、高可用、高吞吐量、低延遲RocketMQ');
INSERT INTO `tbl_book` VALUES (10004, '程序設(shè)計(jì)', ' 深入理解Java虛擬機(jī):JVM高級(jí)特性與實(shí)踐(第3版)', '周志明虛擬機(jī)新作,第3版新增內(nèi)容近50%,5個(gè)維度全面剖析JVM,大廠面試知識(shí)點(diǎn)全覆蓋。與 Java編程思想、Effective Java、Java核心技術(shù) 堪稱:Java四大名著');
INSERT INTO `tbl_book` VALUES (10005, '歷史', '見識(shí)城邦·人類簡(jiǎn)史:從動(dòng)物到上帝(新版)', '以色列新銳歷史學(xué)家尤瓦爾·赫拉利代表作,第十屆文津圖書獎(jiǎng)獲獎(jiǎng)作品');
INSERT INTO `tbl_book` VALUES (10006, '歷史', '中國(guó)通史', '呂思勉先生寫給普通讀者的中國(guó)通史入門書,用白話文寫成的中國(guó)通史,把歷史從“帝王的家譜”轉(zhuǎn)變?yōu)槿祟惖倪M(jìn)化史');
INSERT INTO `tbl_book` VALUES (10007, '哲學(xué)', '理想國(guó)(柏拉圖代表作)', '奠定西方哲學(xué)史的源流之作。2021新譯本,以斯靈斯??北緸榈妆?,遵照“字對(duì)字”的原則,從古希臘原文直譯,兼顧準(zhǔn)確性和語(yǔ)言通順性,助你讀懂理想國(guó)。');
INSERT INTO `tbl_book` VALUES (10008, '哲學(xué)', '蘇格拉底的申辯', '《柏拉圖注疏集:蘇格拉底的申辯》記述的是公元前399年,一個(gè)叫莫勒?qǐng)D斯的年輕人在雅典狀告哲學(xué)家蘇格拉底,說他不信城邦諸神,引進(jìn)新的精靈之事,敗壞青年。 于是,蘇格拉底被傳訊,在500人組成的陪審團(tuán)面前作了著名的申辯。');
INSERT INTO `tbl_book` VALUES (10009, '文學(xué)', '魯迅全集', '大師全集,完整收錄,魯迅畢生之心血盡歸于此。\r\n\r\n  魯迅是中國(guó)20世紀(jì)的文學(xué)家、思想家、革命家,中國(guó)近代文學(xué)巨匠。他早年留學(xué)于日本,后來?xiàng)夅t(yī)從文,他用筆耕不輟的文字為新一代青年們指引方向,在國(guó)內(nèi)外思想文化領(lǐng)域有著極高的聲譽(yù)。');
INSERT INTO `tbl_book` VALUES (10010, '文學(xué)', '人間清醒', '茅盾文學(xué)獎(jiǎng)獲得者梁曉聲2021全新力作');
INSERT INTO `tbl_book` VALUES (10011, '經(jīng)濟(jì)', '八次危機(jī):中國(guó)的真實(shí)經(jīng)驗(yàn)1949-2009', '著名“三農(nóng)”專家溫鐵軍,用經(jīng)濟(jì)的獨(dú)特視角,重新審視中國(guó)的1949-2009,歷史給我了我們?cè)鯓拥恼鎸?shí)經(jīng)驗(yàn)?');

2、項(xiàng)目目錄

Springboot整合mybatisplus實(shí)戰(zhàn)

?3、pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>springboot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>springboot</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>8</java.version>
    </properties>

    <dependencies>
        <!--web-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!--mysql-connector-->
        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.20</version>
        </dependency>

        <!--lombok-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>


        <!--mybatis-plus-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.1.1</version>
        </dependency>
        <!--druid-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.2.6</version>
        </dependency>


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

4、application文件

spring:
  datasource:
    druid:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://localhost:3306/myproject?serverTimezone=UTC
      username: root
      password: root
mybatis-plus:
  global-config:
    db-config:
      table-prefix: tbl_
      id-type: auto
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  #開啟MP運(yùn)行日志信息

5、PO類以及VO類

package com.example.po;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Book {
    private Integer id;
    private String type;
    private String name;
    private String description;
}
package com.example.vo;
/**
 * 供頁(yè)面顯示使用的類
 */

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class BookVo {
    private String type;
    private String name;
    private String description;
}

6、Dao層

package com.example.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.po.Book;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

@Mapper
@Component
public interface BookDao extends BaseMapper<Book> {
}

7、service以及實(shí)現(xiàn)類

package com.example.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.po.Book;

/**
 * 基于 mybatisplus 實(shí)現(xiàn)CRUD快速開發(fā)
 */
public interface IBookService extends IService<Book> {
    IPage<Book> getPage(Integer currentPage,Integer pageSize);
    IPage<Book> getPage(Integer currentPage,Integer pageSize,Book book);
}
package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.dao.BookDao;
import com.example.po.Book;
import com.example.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@Service
public class IBookServiceImpl extends ServiceImpl<BookDao, Book> implements IBookService {
    @Autowired
    private BookDao bookDao;

    @Override
    public IPage<Book> getPage(Integer currentPage, Integer pageSize) {
        Page<Book> page = new Page<>(currentPage,pageSize);
        bookDao.selectPage(page,null);
        return page;
    }

    @Override
    public IPage<Book> getPage(Integer currentPage, Integer pageSize, Book book) {
        LambdaQueryWrapper<Book> queryWrapper = new LambdaQueryWrapper<Book>();
        queryWrapper.like(!StringUtils.isEmpty(book.getType()),Book::getType,book.getType());
        queryWrapper.like(!StringUtils.isEmpty(book.getName()),Book::getName,book.getName());
        queryWrapper.like(!StringUtils.isEmpty(book.getDescription()),Book::getDescription,book.getDescription());
        Page<Book> page = new Page<>(currentPage,pageSize);
        bookDao.selectPage(page,queryWrapper);
        return page;
    }
}

8、controller層

package com.example.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.global.PlatErrorCodeEnum;
import com.example.po.Book;
import com.example.global.Response;
import com.example.global.ResponseBuilder;
import com.example.service.IBookService;
import com.example.vo.BookVo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/books")
public class BookController {
    @Autowired
    private IBookService bookService;

    //查詢所有數(shù)據(jù)
    @GetMapping
    public Response<List<BookVo>> getBooks(){
        List<BookVo> bookList = bookService.list().stream().map(po -> {
            BookVo vo = new BookVo();
            //將兩個(gè)字段相同的對(duì)象進(jìn)行屬性值的復(fù)制
            BeanUtils.copyProperties(po, vo);
            return vo;
        }).collect(Collectors.toList());
        return ResponseBuilder.buildNormalResponse(bookList);


    }

    //添加數(shù)據(jù)
    @PostMapping("/save")
    public Response<Boolean> saveBook(@RequestBody Book book){
        Boolean flag = bookService.save(book);
        return flag == true ? ResponseBuilder.buildNormalResponse() : ResponseBuilder.buildErrorResponse(PlatErrorCodeEnum.ADD_DATA_FAILED);
    }

    @PutMapping("/update")
    public Response<Boolean> updateBook(@RequestBody Book book){
        boolean flag = bookService.updateById(book);
        return flag == true ? ResponseBuilder.buildNormalResponse() : ResponseBuilder.buildErrorResponse(PlatErrorCodeEnum.UPDATE_DATA_FAILED);
    }
    //查詢單個(gè)數(shù)據(jù)
    @GetMapping("{id}")
    public Response<BookVo> getBookById(@PathVariable Integer id){
        Book book = bookService.getById(id);
        BookVo vo = new BookVo();
        BeanUtils.copyProperties(book,vo);
        return ResponseBuilder.buildNormalResponse(vo);
    }
    //刪除單個(gè)數(shù)據(jù)
    @DeleteMapping("{id}")
    public Response<Boolean> deleteBook(@PathVariable Integer id){
        boolean flag = bookService.removeById(id);
        return flag == true ? ResponseBuilder.buildNormalResponse() : ResponseBuilder.buildErrorResponse(PlatErrorCodeEnum.DELETE_DATA_FAILED);
    }

    //分頁(yè)查詢數(shù)據(jù)
    @GetMapping("{currentPage}/{pageSize}")
    public Response<List<BookVo>> getBooksByPage(@PathVariable Integer currentPage,@PathVariable Integer pageSize){
        IPage<Book> page = bookService.getPage(currentPage,pageSize);
        //避免查出來所有的數(shù)據(jù),增加一個(gè)vo類,只展示需要的字段
        List<BookVo> bookVos = page.getRecords().stream().map(po -> {
            BookVo vo = new BookVo();
            //將兩個(gè)字段相同的對(duì)象進(jìn)行屬性值的復(fù)制
            BeanUtils.copyProperties(po, vo);
            return vo;
        }).collect(Collectors.toList());
        return ResponseBuilder.buildNormalResponse(bookVos);
    }

}

9、為了給前端返回統(tǒng)一的值,再加一些優(yōu)化

package com.example.global;

public enum PlatErrorCodeEnum {

	ADD_DATA_FAILED("10000", "添加數(shù)據(jù)失敗"),
    UPDATE_DATA_FAILED("10001", "更新數(shù)據(jù)失敗"),
    DELETE_DATA_FAILED("10001", "刪除數(shù)據(jù)失敗"),



    ;

    public static final String ERROR_CODE="000";

    private String code;
    private String message;

    PlatErrorCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

	public String getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}

}
package com.example.global;

import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

@Data
@ToString(callSuper = true)
public class Response<T> implements Serializable {

	private static final long serialVersionUID = -2644259941898334897L;

	private String returnCode;
	private String returnMsg;
	private T returnData;

	public Response(){

	}

	public Response(String returnCode){
		this.returnCode = returnCode;
	}

	public Response(String returnCode, String returnMsg){
		this.returnCode = returnCode;
		this.returnMsg = returnMsg;
	}

	public Response(String returnCode, String returnMsg, T returnData){
		this.returnCode = returnCode;
		this.returnMsg = returnMsg;
		this.returnData = returnData;
	}

	public T getReturnData() {
		return returnData;
	}

	public Response<T> setReturnData(T returnData) {
		this.returnData = returnData;
		return this;
	}
}
package com.example.global;


/**
 * 構(gòu)造響應(yīng)結(jié)果
 */
public final class ResponseBuilder {
	/**
	 * 返回成功.
	 */
	public static final String RESPONSE_OK = "0000";
	public static final String RESPONSE_MESSAGE = "響應(yīng)成功";
	
	/**
	 * 構(gòu)造一個(gè)失敗響應(yīng)
	 */
	public static <T> Response<T> buildErrorResponse(PlatErrorCodeEnum enums) {
		Response<T> entity = new Response<>();
		entity.setReturnCode(String.valueOf(enums.getCode()));
		entity.setReturnMsg(enums.getMessage());
		return entity;
	}

	/**
	 * 構(gòu)造一個(gè)失敗響應(yīng)
	 */
	public static <T> Response<T> buildErrorResponse(String error, String message) {
		Response<T> entity = new Response<>();
		entity.setReturnCode(error);
		entity.setReturnMsg(message);
		return entity;
	}
	
	/**
	 * 構(gòu)造一個(gè)正常的沒有返回?cái)?shù)據(jù)的響應(yīng)
	 */
	public static <T> Response<T> buildNormalResponse() {
		return new Response<T>(RESPONSE_OK, RESPONSE_MESSAGE);
	}

	/**
	 * 構(gòu)造一個(gè)正常的有返回?cái)?shù)據(jù)的響應(yīng)
	 * @param returnData
	 * @param <T>
	 * @return
	 */
	public static <T> Response<T> buildNormalResponse(T returnData) {
		Response<T> entity = buildNormalResponse();
		entity.setReturnData(returnData);
		return entity;
	}

}

10、mybatisplus分頁(yè)插件配置文章來源地址http://www.zghlxwxcb.cn/news/detail-495593.html

package com.example.config;

/**
 * 配置mybatisplus分頁(yè)插件
 */

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@MapperScan("com.example.dao")
public class MyBatisPlusConf {
    @Bean
    public PaginationInterceptor mybatisPlusInterceptor(){
        //創(chuàng)建攔截器 SpringBoot 低版本用 PaginationInterceptor 高版本用 MybatisPlusInterceptor
        PaginationInterceptor interceptor = new PaginationInterceptor();
        return interceptor;

    }

}

到了這里,關(guān)于Springboot整合mybatisplus實(shí)戰(zhàn)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • SpringBoot整合MybatisPlus多數(shù)據(jù)源

    SpringBoot整合MybatisPlus多數(shù)據(jù)源

    相信在很多使用MybatisPlus框架的小伙伴都會(huì)遇到多數(shù)據(jù)源的配置問題,并且官網(wǎng)也給出了推薦使用多數(shù)據(jù)源 (dynamic-datasource-spring-boot-starter) 組件來實(shí)現(xiàn)。由于最近項(xiàng)目也在使用這個(gè)組件來實(shí)現(xiàn)多數(shù)據(jù)源切換,因此想了解一下該組件是如何運(yùn)行的,經(jīng)過自己的調(diào)試,簡(jiǎn)單記錄一

    2024年02月13日
    瀏覽(25)
  • MyBatisPlus 整合 SpringBoot 遇見的問題(一)

    【異?!浚篣nsatisfiedDependencyException: Error creating bean with name ‘xxx[類]’: Unsatisfied dependency expressed through field ‘baseMapper’; … BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instanti

    2024年02月05日
    瀏覽(31)
  • 【Spring】SpringBoot整合MybatisPlusGernerator,MybatisPlus逆向工程

    【Spring】SpringBoot整合MybatisPlusGernerator,MybatisPlus逆向工程

    ? ???個(gè)人主頁(yè):哈__ 期待您的關(guān)注? 在我們寫項(xiàng)目的時(shí)候,我們時(shí)常會(huì)因?yàn)樾枰獎(jiǎng)?chuàng)建很多的項(xiàng)目結(jié)構(gòu)而頭疼。項(xiàng)目中的表很多的時(shí)候,我們連實(shí)體類都創(chuàng)建不完,這時(shí)候就需要我們的逆向工程來幫助我們生成我們的框架結(jié)構(gòu)。這些結(jié)構(gòu)都差不多,實(shí)體類,表現(xiàn)層,業(yè)務(wù)層和

    2024年04月15日
    瀏覽(23)
  • 【SpringBoot】整合第三方技術(shù)Junit. MybatisPlus druid

    【SpringBoot】整合第三方技術(shù)Junit. MybatisPlus druid

    自己定義一個(gè)功能,測(cè)試功能接口 測(cè)試步驟 注入你要測(cè)試的對(duì)象 提前聲明為bean資源 執(zhí)行你要測(cè)試的方法 如果測(cè)試類在SpringBoot啟動(dòng)類的包或者子包中,可以省略啟動(dòng)類的設(shè)置們也就是省略classes的設(shè)定 新建一個(gè)模塊 勾選MybatisFrameWork 和MySQL driver 記得一定要配置數(shù)據(jù)庫(kù)連接信

    2024年02月06日
    瀏覽(128)
  • SpringBoot項(xiàng)目整合MybatisPlus并使用SQLite作為數(shù)據(jù)庫(kù)

    SpringBoot項(xiàng)目整合MybatisPlus并使用SQLite作為數(shù)據(jù)庫(kù)

    SQLite 是一個(gè)進(jìn)程內(nèi)庫(kù),它實(shí)現(xiàn)了 獨(dú)立的、無服務(wù)器的、零配置 的事務(wù)性 SQL 數(shù)據(jù)庫(kù)引擎。SQLite 沒有單獨(dú)的服務(wù)器進(jìn)程。 SQLite直接讀取和寫入普通磁盤文件,就是一個(gè)完整的 SQL 數(shù)據(jù)庫(kù) , 包含多個(gè)表、索引、 觸發(fā)器和視圖包含在單個(gè)磁盤文件中 。 數(shù)據(jù)庫(kù)文件格式是跨平臺(tái)

    2024年01月21日
    瀏覽(56)
  • springboot使用達(dá)夢(mèng)數(shù)據(jù)庫(kù)(DM8)整合MybatisPlus

    springboot使用達(dá)夢(mèng)數(shù)據(jù)庫(kù)(DM8)整合MybatisPlus

    在idea中開發(fā)spring boot項(xiàng)目,用到的數(shù)據(jù)庫(kù)是達(dá)夢(mèng)數(shù)據(jù)庫(kù),想要使用 MybatisPlus 自動(dòng)生成實(shí)體類和服務(wù),并且通過 MybatisPlus 完成一些簡(jiǎn)單的數(shù)據(jù)庫(kù)CRUD ps:這里的 MybatisPlus 版本必須要是3.0以上 2.1、pom ps:其中需要將達(dá)夢(mèng)數(shù)據(jù)庫(kù)的依賴添加到指定目錄下,不然達(dá)夢(mèng)的依賴無法生效

    2024年02月16日
    瀏覽(27)
  • springboot整合security,mybatisPlus,thymeleaf實(shí)現(xiàn)登錄認(rèn)證及用戶,菜單,角色權(quán)限管理

    springboot整合security,mybatisPlus,thymeleaf實(shí)現(xiàn)登錄認(rèn)證及用戶,菜單,角色權(quán)限管理

    本系統(tǒng)為springboot整合security,mybatisPlus,thymeleaf實(shí)現(xiàn)登錄認(rèn)證及用戶,菜單,角色權(quán)限管理。頁(yè)面為極簡(jiǎn)模式,沒有任何渲染。 源碼:https://gitee.com/qfp17393120407/spring-boot_thymeleaf 架構(gòu)截圖 此處以用戶表為例,其他表數(shù)據(jù)可在源碼獲取。 用戶表 共用屬性 共用屬性自動(dòng)填充配置

    2024年02月07日
    瀏覽(24)
  • 整合vue elementui springboot mybatisplus前后端分離的 簡(jiǎn)單增加功能 刪改查未實(shí)現(xiàn)

    涉及知識(shí)點(diǎn) 1.springboot項(xiàng)目啟動(dòng)創(chuàng)建? 配置yml文件 2.mybatisplus的使用 3.vue的vite文件配置 4.vue springboot 前后端數(shù)據(jù)交互 1.建立項(xiàng)目的配置文件 src/main/resources/application.yml 2.建立項(xiàng)目 pom.xml 3.建立數(shù)據(jù)庫(kù)表 4.建立實(shí)體類 cn.webrx.pojo.User 5.建立項(xiàng)目入口程序App cn.webrx.App 6.建立sevices axi

    2024年02月07日
    瀏覽(16)
  • 【SpringBoot篇】SpringBoot整合Mybatis實(shí)戰(zhàn)

    【SpringBoot篇】SpringBoot整合Mybatis實(shí)戰(zhàn)

    ??專欄【SpringBoot】 ??喜歡的詩(shī)句:天行健,君子以自強(qiáng)不息。 ??音樂分享【如愿】 ??歡迎并且感謝大家指出小吉的問題?? Spring Boot可以非常方便地集成MyBatis來實(shí)現(xiàn)對(duì)數(shù)據(jù)庫(kù)的訪問,從而快速搭建項(xiàng)目持久層。如果你也想利用Spring Boot整合MyBatis,本文將為你詳細(xì)講解整合過

    2024年02月05日
    瀏覽(24)
  • Shiro整合SpringBoot項(xiàng)目實(shí)戰(zhàn)

    Shiro整合SpringBoot項(xiàng)目實(shí)戰(zhàn)

    ?作者簡(jiǎn)介:2022年 博客新星 第八 。熱愛國(guó)學(xué)的Java后端開發(fā)者,修心和技術(shù)同步精進(jìn)。 ??個(gè)人主頁(yè):Java Fans的博客 ??個(gè)人信條:不遷怒,不貳過。小知識(shí),大智慧。 ??當(dāng)前專欄:SpringBoot 框架從入門到精通 ?特色專欄:國(guó)學(xué)周更-心性養(yǎng)成之路 ??本文內(nèi)容:Shiro整合Sp

    2023年04月09日
    瀏覽(25)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包