IDEA中添加mybaite-config.xml和mybaits-mapper.xml文件

1.Settings--->Editor--->File and Code Templates

点击+,填写Name(mybatis-config或者mybatis-mapper)和Extension(xml)

config文件添加如下:

<?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>
</configuration>

mapper文件添加如下:

<?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>
    
</mapper>

勾选住Enable Live Templates,点击应用就可以了

IDEA中添加mybaite-config.xml和mybaits-mapper.xml文件

IDEA中添加mybaite-config.xml和mybaits-mapper.xml文件