1.點擊File --->Settings --->file and code template-->點擊+ --> 設置name-->選擇模版文件后綴--> 添加模版內容--> 點擊ok
步驟如下圖
模版內容:
<?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="">
</mapper>
2、然后新建mapper.xml文件,點擊mapper即可