标签:type user utf-8 namespace result 进阶 glob coding dtd
application.properties
mybatis-plus.config-location=classpath:mybatis.xml
mybatis.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> </configuration>
application.properties
mybatis-plus.mapper-locations=classpath*:mybatis/*.xml
?
UserMapper.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="com.will.learn.springboot.mapper.UserMapper"> <select id="selById" resultType="com.will.learn.springboot.pojo.User"> select * from tb_user where id = #{id} </select> </mapper>
MyBatis别名包扫名路径配置
mybatis-plus.type-aliases-package = com.will.learn.springboot.pojo
DB策略配置(IdType)
mybatis-plus.global-config.db-config.id-type=auto
DB策略配置(tablePrefix)
mybatis-plus.global-config.db-config.table-prefix=tb_
标签:type user utf-8 namespace result 进阶 glob coding dtd
原文地址:https://www.cnblogs.com/deepminer/p/12589523.html