上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 52 下一页
摘要: 五、自定义Mapper 当通用Mapper无法满足我们的需求时,我们可以自定义基于Mapper接口的xml文件,并在xml文件中配置SQL语句 1、接口方法定义 在UserMapper接口中定义如下方法 List<User> selectAllByName(String name); 2、创建xml 阅读全文
posted @ 2021-11-02 22:51 Lz_蚂蚱 阅读(246) 评论(0) 推荐(0)
摘要: 四、通用Service MP中有一个接口 IService和其实现类 ServiceImpl,封装了常见的业务层逻辑 1、创建Service接口 创建 service 包,创建 UserService,继承 IService package com.atguigu.mybatisplus.servi 阅读全文
posted @ 2021-11-02 22:50 Lz_蚂蚱 阅读(200) 评论(0) 推荐(0)
摘要: 三、通用Mapper MP中的基本CRUD在内置的BaseMapper中都已得到了实现。 创建MapperTests测试类: package com.atguigu.mybatisplus; @SpringBootTest public class MapperTests { @Resource p 阅读全文
posted @ 2021-11-02 22:49 Lz_蚂蚱 阅读(129) 评论(0) 推荐(0)
摘要: 二、快速入门 1、创建数据库 创建数据库:mybatis_plus 创建数据表:user CREATE TABLE user ( id BIGINT(20) NOT NULL COMMENT '主键ID', name VARCHAR(30) NULL DEFAULT NULL COMMENT '姓名 阅读全文
posted @ 2021-11-02 22:46 Lz_蚂蚱 阅读(52) 评论(0) 推荐(0)
摘要: 声明:此系列视频来源尚硅谷,喜欢看视频学习的小伙伴请跳转b站:https://www.bilibili.com/video/BV1VV411n7nR?p=1 后续文章不再做此声明,本站很多文章都来源尚硅谷,可以去官网了解学习,博客记录作为工作中方便查看,也分享给更多攻城狮。 一、简介 1、官网 ht 阅读全文
posted @ 2021-11-02 22:42 Lz_蚂蚱 阅读(75) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 52 下一页