自定义创建模板:
File->setting->Editor->File and Code Templates
选择 Files , 点击 + 新建模板
Name MyBatisMapper
Extension xml
勾选 Enable live Templates
内容参考mybatis官网
<?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="org.mybatis.example.BlogMapper">
<select id="selectBlog" resultType="Blog">
select * from Blog where id = #{id}
</select>
</mapper>
点击 apply ok