mybatis小示例

2023-05-16

一般使用mybatis的环境,大多都是别人已经配置好的。直接用就好了,如何自己搭建呢?其实很简单。看官方的文档就可以解决了。主要为了学习mybatis最基础的配置。我文章中的方法不基于spring,一般很少会在真实项目中直接使用。我把我的搭建过程记录下来给有用的人吧。

什么是 MyBatis?

MyBatis 是一款优秀的持久层框架,它支持自定义 SQL、存储过程以及高级映射。MyBatis 免除了几乎所有的 JDBC 代码以及设置参数和获取结果集的工作。MyBatis 可以通过简单的 XML 或注解来配置和映射原始类型、接口和 Java POJO(Plain Old Java Objects,普通老式 Java 对象)为数据库中的记录。

官方文档地址:
https://mybatis.org/mybatis-3/zh/index.html

强烈建议自行查看官方文档来操作。

没有spring如何使用mybatis

现在我身边基本大部分项目都在使用spring技术了,那么如果没有spring呢?如何用mybatis?

建表

mybatis怎么能少的了对表进行操作呢?就以下面的表为例吧!数据库就用mysql吧

表结构

create table qa_category
(
    category_id bigint auto_increment comment '分类ID'
        primary key,
    title       varchar(200)           not null comment '标题',
    sort        int(5)                 null comment '排序',
    create_by   varchar(64) default '' null comment '创建者',
    create_time datetime               null comment '创建时间',
    update_by   varchar(64) default '' null comment '更新者',
    update_time datetime               null comment '更新时间'
)
    comment '提问分类';

测试数据

INSERT INTO qa_category (title, sort, create_by, create_time, update_by, update_time) VALUES ('Java', 1, 'itkey', '2022-05-09 17:18:50', '', '2022-05-09 17:27:35');
INSERT INTO qa_category (title, sort, create_by, create_time, update_by, update_time) VALUES ('Vue', 2, 'itkey', '2022-05-09 17:19:09', '', '2022-05-09 17:27:35');
INSERT INTO qa_category (title, sort, create_by, create_time, update_by, update_time) VALUES ('React', 3, 'itkey', '2022-05-10 10:46:28', '', '2022-05-10 11:05:27');
INSERT INTO qa_category (title, sort, create_by, create_time, update_by, update_time) VALUES ('mysql', 4, 'itkey', '2022-05-11 14:51:48', '', '2022-05-11 14:51:59');
INSERT INTO qa_category (title, sort, create_by, create_time, update_by, update_time) VALUES ('MacOS', 5, 'itkey', '2022-05-11 14:53:18', '', '2022-05-11 14:53:24');

代码

本来想写细点的,发现也没有什么内容可以说的。我直接上代码吧。

pom.xml

mybatis-demo/pom.xml 这个文件的重点就是mysql,mybatis的依赖。

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>mybatis-demo</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <!-- Mysql驱动包 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.28</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.10</version>
        </dependency>

    </dependencies>

</project>

实体类

mybatis-demo/src/main/java/cn/ycmit/domain/QaCategory.java

package cn.ycmit.domain;



import java.util.Date;

/**
 * 问答分类对象 qa_category
 *
 * @author ycmit
 * @date 2022-05-09
 */
public class QaCategory
{
    private static final long serialVersionUID = 1L;

    /** 分类ID */
    private Long categoryId;

    /** 标题 */
    private String title;

    /** 排序 */
    private Integer sort;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    private Date updateTime;

    public void setCategoryId(Long categoryId)
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId()
    {
        return categoryId;
    }
    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getTitle()
    {
        return title;
    }
    public void setSort(Integer sort)
    {
        this.sort = sort;
    }

    public Integer getSort()
    {
        return sort;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "QaCategory{" +
                "categoryId=" + categoryId +
                ", title='" + title + '\'' +
                ", sort=" + sort +
                ", createBy='" + createBy + '\'' +
                ", createTime=" + createTime +
                ", updateBy='" + updateBy + '\'' +
                ", updateTime=" + updateTime +
                '}';
    }
}

mapper

mybatis-demo/src/main/java/cn/ycmit/mapper/QaCategoryMapper.java

package cn.ycmit.mapper;



import cn.ycmit.domain.QaCategory;

import java.util.List;

/**
 * 问答分类Mapper接口
 *
 * @author ycmit
 * @date 2022-05-09
 */
public interface QaCategoryMapper
{
    /**
     * 查询问答分类
     *
     * @param categoryId 问答分类主键
     * @return 问答分类
     */
    public QaCategory selectQaCategoryByCategoryId(Long categoryId);

    /**
     * 查询问答分类列表
     *
     * @param qaCategory 问答分类
     * @return 问答分类集合
     */
    public List<QaCategory> selectQaCategoryList(QaCategory qaCategory);

    /**
     * 新增问答分类
     *
     * @param qaCategory 问答分类
     * @return 结果
     */
    public int insertQaCategory(QaCategory qaCategory);

    /**
     * 修改问答分类
     *
     * @param qaCategory 问答分类
     * @return 结果
     */
    public int updateQaCategory(QaCategory qaCategory);

    /**
     * 删除问答分类
     *
     * @param categoryId 问答分类主键
     * @return 结果
     */
    public int deleteQaCategoryByCategoryId(Long categoryId);

    /**
     * 批量删除问答分类
     *
     * @param categoryIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteQaCategoryByCategoryIds(Long[] categoryIds);
}

mybatis-config.xml

mybatis-demo/src/main/resources/mybatis/mybatis-config.xml
这是主配置文件:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"/>
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.cj.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://127.0.0.1:3306/ry-vue?useUnicode=true&amp;characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=true&amp;serverTimezone=GMT%2B8&amp;allowMultiQueries=true"/>
                <property name="username" value="root"/>
                <property name="password" value="itkey123456"/>
            </dataSource>
        </environment>
    </environments>
    <mappers>
        <mapper resource="mybatis/QaCategoryMapper.xml"/>
    </mappers>
</configuration>

QaCategoryMapper.xml

mybatis-demo/src/main/resources/mybatis/QaCategoryMapper.xml
内容如下:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ycmit.mapper.QaCategoryMapper">

    <resultMap type="cn.ycmit.domain.QaCategory" id="QaCategoryResult">
        <result property="categoryId"    column="category_id"    />
        <result property="title"    column="title"    />
        <result property="sort"    column="sort"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectQaCategoryVo">
        select category_id, title, sort, create_by, create_time, update_by, update_time from qa_category
    </sql>

    <select id="selectQaCategoryList" parameterType="cn.ycmit.domain.QaCategory" resultMap="QaCategoryResult">
        <include refid="selectQaCategoryVo"/>
        <where>
            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
            <if test="sort != null "> and sort = #{sort}</if>
        </where>
    </select>

    <select id="selectQaCategoryByCategoryId" parameterType="Long" resultMap="QaCategoryResult">
        <include refid="selectQaCategoryVo"/>
        where category_id = #{categoryId}
    </select>

    <insert id="insertQaCategory" parameterType="cn.ycmit.domain.QaCategory" useGeneratedKeys="true" keyProperty="categoryId">
        insert into qa_category
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="title != null and title != ''">title,</if>
            <if test="sort != null">sort,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="title != null and title != ''">#{title},</if>
            <if test="sort != null">#{sort},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>

    <update id="updateQaCategory" parameterType="cn.ycmit.domain.QaCategory">
        update qa_category
        <trim prefix="SET" suffixOverrides=",">
            <if test="title != null and title != ''">title = #{title},</if>
            <if test="sort != null">sort = #{sort},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where category_id = #{categoryId}
    </update>

    <delete id="deleteQaCategoryByCategoryId" parameterType="Long">
        delete from qa_category where category_id = #{categoryId}
    </delete>

    <delete id="deleteQaCategoryByCategoryIds" parameterType="String">
        delete from qa_category where category_id in
        <foreach item="categoryId" collection="array" open="(" separator="," close=")">
            #{categoryId}
        </foreach>
    </delete>
</mapper>

测试类

mybatis-demo/src/main/java/cn/ycmit/MybatisTest.java

package cn.ycmit;



import java.io.InputStream;
import java.util.List;

import cn.ycmit.domain.QaCategory;
import cn.ycmit.mapper.QaCategoryMapper;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class MybatisTest {
    public static void main(String[] args) throws Exception {
        test();
    }

    public static void test() throws Exception{
        String resource = "mybatis/mybatis-config.xml";
        InputStream inputStream = Resources.getResourceAsStream(resource);
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);

        try (SqlSession session = sqlSessionFactory.openSession()) {
            QaCategoryMapper mapper = session.getMapper(QaCategoryMapper.class);
            List<QaCategory> list = mapper.selectQaCategoryList(null);
            System.out.println(list);
        }

    }

}

执行结果:

[QaCategory{categoryId=1, title='Java', sort=1, createBy='itkey', createTime=Mon May 09 17:18:50 CST 2022, updateBy='', updateTime=Mon May 09 17:27:35 CST 2022}, QaCategory{categoryId=2, title='Vue', sort=2, createBy='itkey', createTime=Mon May 09 17:19:09 CST 2022, updateBy='', updateTime=Mon May 09 17:27:35 CST 2022}, QaCategory{categoryId=3, title='React', sort=3, createBy='itkey', createTime=Tue May 10 10:46:28 CST 2022, updateBy='', updateTime=Tue May 10 11:05:27 CST 2022}, QaCategory{categoryId=4, title='mysql', sort=4, createBy='itkey', createTime=Wed May 11 14:51:48 CST 2022, updateBy='', updateTime=Wed May 11 14:51:59 CST 2022}, QaCategory{categoryId=5, title='MacOS', sort=5, createBy='itkey', createTime=Wed May 11 14:53:18 CST 2022, updateBy='', updateTime=Wed May 11 14:53:24 CST 2022}]

源码

其实所有用到的源码我已经全部写到文章中了。为了方便给有用的人,我把我的项目打包分享如下:
https://download.csdn.net/download/lxyoucan/86336480

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

mybatis小示例 的相关文章

  • linux Windows双系统时间不一致的解决办法

    原因 电脑系统中有两个时间 xff1a 硬件时间 xff1a 保存在主板中 xff0c 信息比较少没时区 夏令时的概念 系统时间 xff1a 又系统维护 xff0c 独立于硬件时间 xff0c 拥有时区 夏令时等信息 系统时间又因为系统的不
  • 设计原则之【迪米特法则】,非礼勿近

    文章目录 一 什么是迪米特法则1 理解迪米特法则2 如何理解 高内聚 松耦合 xff1f 二 实例1 实例12 实例2 一 什么是迪米特法则 迪米特原则 xff08 Law of Demeter LoD xff09 是指一个对象应该对其他对
  • archlinux telnet客户端

    简单介绍 telnet是一种基于TCP的传统命令行远程控制协议 telnet使用非加密的通道 xff0c 因此不太安全 现在主要用于链接一些旧设备 下面这些介绍主要适用于在Arch Linux系统中配置一个telnet服务器 安装 如果只使
  • ASUS Vivobook安装linux

    使用ASUS Vivobook安装linux 会有一个小坑 如果你的linux启动不起来 xff0c 或者本来可以启动更新固件以后就不行了 这篇文章可能会给你一点帮助 BIOS设置 如果你想在这台电脑上安装linux 则Secure Boo
  • 修复grub启动 因调整分区导致linux无法启动解决过程

    linux调整分区后 xff0c 开机重启时会出现 error unknow filesystem grub rescue gt 我是windows11 43 archlinux双系统使用 这段时间用下来 xff0c 感觉使用linux更多
  • linux 扩容 新增分区

    一开始我只是尝试使用archlinux做为主要办公系统 xff0c 给系统分配的空间并不多 渐渐的也适应了archlinux感觉挺好 于是就把windows中占用的一些空间分配给archlinux用了 记录一下些过程吧 我把windows的
  • VirtualBox调整分分辨率

    以前在windows或者macOS基本都是使用vmware来玩虚拟机的 到linux环境 xff0c 想体验一下VirtualBox 结果用的时间发现分辨率都是调不出来 记录一下我的操作方法 环境 宿主机 xff1a archlinux 4
  • VirtualBox宿主机复制粘贴时有时无

    现象 首先我已经安装了增强功能 xff0c 共享剪切板选择的也是双向 虚拟机刚开机剪切板功能是正常的 可以双向复制 但是用了一段时间以后 xff0c 就会发现从宿主机得到到虚拟机就不行了 但是可以从虚拟机复制到宿主机 环境 我的宿主机是 a
  • HBuilderX运行微信小程序不报错也打不开

    我主用的是linux操作系统 xff0c 因为要开发微信小程序 所以在虚拟机中安装了一个windows7系统 环境 虚拟机中的windows7 HbuilderX 43 微信开发者工具 现象 使用HbuilderX开发uni app并想在微
  • Virtualbox虚拟机与主机相互访问

    刚从vmware切换到Virtualbox有些地方还是不太熟悉 网络连接这块就被卡了一下 xff0c 后来发现其实很简单 xff0c 是我想多了 环境 主机 xff1a archlinux 虚拟机 xff1a windows 10 软件版本
  • maven打包报内存不足,配置maven vm options

    服务器上内存所剩余不多了 xff0c 用mvn打包报内存不足 解决办法就要把vm options中内存设置小一些 mvn jvm config文件 xff1a 从 Maven 3 3 1 43 开始 xff0c 您可以通过 maven pr
  • archlinux滚动更新导致virtualbox虚拟机无法启动

    今天遇到一个奇怪的问题 xff0c 滚动更新以后 xff0c pacman Syyu 虚拟机无法正常启动了 虚拟机启动以后一直显示Starting virtual machine 并且卡在20 不动了 原因分析 我怀疑是更新系统后 xff0
  • 设计模式之【工厂模式】,创建对象原来有这么多玩法

    文章目录 一 什么是工厂模式1 工厂模式的意义2 什么时候应该用工厂模式 二 简单工厂模式1 实例 xff08 1 xff09 使用简单工厂进行优化 xff08 2 xff09 静态工厂 xff08 3 xff09 使用map来去除if x
  • archlinux安装node.js长期支持版本

    默认archlinux安装的node js版本是18 我今天在遇到项目时报错了 xff0c 项目中用到一个组件不支持18 那么如果安装 低版本的Node呢 xff1f 先在软件仓库中搜索一下 xff1a pacman Ss span cla
  • windows开机启动目录

    设置windows开机启动有很多种方法 xff0c 最简单的方法恐怕就是把快捷方式放到启动目录吧 windows开机启动目录 按下 win 43 R 打开运行输入 xff1a shell span class token operator
  • linux 灰度显示grayscale

    之前我在使用macOS的时候 xff0c 非常喜欢使用灰度显示界面 到底是什么原因让我有这么 变态 的需求 下面听听我的故事 xff0c 当时不重要 xff0c 可以跳过 是这样的 xff0c 因为我是程序员 xff0c 算上电脑 43 手
  • charles iOS手机抓包

    iOS手机如何抓包 下载charles https www charlesproxy com latest release download do 注册码 Registered Name span class token builtin c
  • redis cli笔记

    此篇为人个笔记 xff0c 基本是个人常用命令 xff0c 仅供参考 基础操作 redis cli redis span class token number 127 0 span 0 1 637 span class token oper
  • Jsoup通过curl Request设置header

    使用Charles时发现它有一个功能非常的方便 Copy cURL Request菜单 可以把请求中的header信息自动拼接成curl的参数 其实有很多的软件都具备这样的功能 那么如何把这些header信息直接 放到Jsoup的heade
  • 【Java题】用户数据中的身高体重收集

    题目要求 用户数据中的身高体重收集 应用程序中用户数据收集 xff0c 非常重要 xff0c 是大数据重要来源之一 在某APP场景中收集用户的身高体重数据 xff0c 身高单位 米 xff0c 体重单位kg xff0c 要求用户输入的任何数

随机推荐

  • archlinux i3wm通知管理

    通知管理 Dunst 是大多数桌面环境提供的通知守护程序的轻量级替代品 它非常可定制 xff0c 不依赖于任何工具包 xff0c 因此适合那些我们都喜欢定制到完美的以窗口管理器为中心的设置 官网如下 xff1a https dunst pr
  • i3wm 获取window class

    在i3wm中如果你想让一个程序固定在某个workspace中打开可以如下设置 span class token comment 打开virtual box直接进入第10个桌面 span assign span class token pun
  • xrandr修改分辨率与刷新率

    查询当前显示器信息 直接运行xrandr即可 我的执行结果如下 xff0c 信息过多 xff0c 我则把关键部分放出来 xff1a itkey 64 vivobook screenlayout xrandr span class token
  • 设计模式之【适配器模式】,两个人之间确实需要月老的搭线~

    文章目录 一 什么是适配器模式1 适配器模式使用场景2 代理 桥接 装饰器 适配器 4 种设计模式的区别3 适配器模式结构 二 类适配器1 实例 三 对象适配器1 实例 四 接口适配器1 实例 五 源码中的应用 一 什么是适配器模式 适配器
  • linux黑客帝国cmatrix

    装X神器 xff0c 黑客帝国 xff01 xff01 xff01 安装方法 我这里以archlinux为例 span class token function sudo span pacman S cmatrix 效果演示
  • mysql字段userid逗号分开保存按userid查询

    我的sql水平一般 xff0c 仅是一个笔记 无法保存是最优解 仅供参考 场景 有一张消息表 xff0c 其中有一个收信人字段中把多个用户以 分隔保存信息 我需要根据userid来查询信息 为了方便理解 xff0c 我减化一下表结构 我的表
  • windows11 + linux 蓝牙连接问题

    我主要使用Linux办公 xff0c 因为一些特殊情况需要到windows系统下测试 这时就会发现蓝牙键盘就需要重新连接 xff0c 只要切一次系统就要重新连接一次非常的麻烦 今天要多次往返这两个系统 xff0c 所以我决定解决一下这个问题
  • archlinux音量管理

    我用的i3wm 平时音量调整 xff0c 我是直接使用键盘自带的多媒体键实现的 xff0c 所以一直也懒得折腾 多媒体键盘调整音量的缺点就是无法细力度调整 xff0c 导致使用耳机听歌时 xff0c 要么声音听不到 xff0c 要么就是听不
  • git 命令行版本初始化

    假设你已经在网页上创建了一个如下的版本库 http git ycmit cn r manuli api git 然后我们需要把本地已经有的文件上传到版本库 xff0c 执行以下命令即可 span class token function g
  • mysql转SQL Server

    使用工具 Navicat 点击 工具 61 数据传输 即可完成
  • jdbc SQLServer Error: “The server selected protocol version TLS10

    最近在尝试在SQL Server 环境下开发新项目 xff0c 遇到了一些坑 xff0c 记录一下 报错信息 com span class token punctuation span microsoft span class token
  • windows11右键菜单变回windows10风格

    windows11的右键菜单会折叠一部分 xff0c 虽然美观了不少 但是总感觉效率反而更低了 xff0c 能不能设置回windows10风格的呢 xff1f 操作 Windows 43 R xff0c 输入 regedit 并按 Ente
  • C# winform使用SQLite

    本文仅是一个笔记 xff0c 仅供参考 SQLite SQLite是遵守ACID的关系数据库管理系统 xff0c 它包含在一个相对小的C程序库中 与许多其它数据库管理系统不同 xff0c SQLite不是一个客户端 服务器结构的数据库引擎
  • C# SQLite Database Locked exception

    现象 在查询时没有问题 xff0c 但是在Insert时会报数据库被锁定 原因分析 可能是代码某个地方连接着数据库 xff0c 忘记关闭了 解决办法 原理我还没有完全搞懂 xff0c 不过根据下面的写法确实解决了问题 在某个地方 xff0c
  • 设计模式之【桥接模式】,多用组合少用继承

    文章目录 一 什么是桥接模式1 使用场景2 代理 桥接 装饰器 适配器 4 种设计模式的区别3 桥接模式的优缺点4 桥接模式的四种角色 二 实例桥接模式优化代码 三 源码中使用的桥接模式1 桥接模式在JDBC中的应用 一 什么是桥接模式 桥
  • C# 无操作则退出登陆

    span class token keyword using span span class token namespace System span span class token punctuation span span class
  • C#调用explorer.exe打开指定目录

    需求 C 程序上有一个按钮 xff0c 点击打开电脑上对应的目录即可 代码 span class token comment 打开帮助文档 span System span class token punctuation span Diag
  • windows中ncdu替代者TreeSize

    平时开发大部分时间使用linux或者macOS系统 xff0c 近期因为要开发C 程序不得不使用windows系统 在linux或者macOS常用的ncdu来查看文件目录体积大小 到windows中无法使用 xff0c 很不习惯 就想找一个
  • Visual Studio中vim模拟器

    简介 Vim 仿真 这是 Visual Studio 2015 及更高版本的 Vim 仿真层 它将 Vim 熟悉的键绑定体验直接集成到 Visual Studio 的编辑器中 细节 GitHub 上提供了该项目和问题跟踪的完整源代码 htt
  • mybatis小示例

    一般使用mybatis的环境 xff0c 大多都是别人已经配置好的 直接用就好了 xff0c 如何自己搭建呢 xff1f 其实很简单 看官方的文档就可以解决了 主要为了学习mybatis最基础的配置 我文章中的方法不基于spring 一般很