IntelliJ Idea自定义mybatis xml模版

2021-10-17  本文已影响0人  洪兴掌管一代

设置中新建并配置xml模版:

1.点击File and Code Templates

2.点击+

3.输入模版名字

4.输入模版的文件扩展名

5.输入自动生成的模版内容

6.勾选Enable Live Templates

7.apply

idea截图

附上一份mybatis mapper 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="">

<!-- type of resultMap usually is a model customized by developer. -->              

<resultMap id="" type="">

        <!-- jdbcType of result is a data type of database. -->

        <result column="" property="" jdbcType=""/>

    </resultMap>

    <!-- parameterType of select can be a customized model or a primitive type. -->

    <select id="" parameterType="" resultMap=""> </select>

    <insert id="" keyProperty="" parameterType="" useGeneratedKeys="true"> </insert>

    <update id="" parameterType=""> </update>

    <delete id="" parameterType=""> </delete>

</mapper>

然后去文件夹创建即可:

上一篇 下一篇

猜你喜欢

热点阅读