其他分享
首页 > 其他分享> > spring boot 使用mybatis-plus问题一

spring boot 使用mybatis-plus问题一

作者:互联网

第一次写博客,目的有两个:首先是防止下次碰到类似的问题方便查找;其次是希望可以帮到遇到同样问题的小伙伴

一、在mybatis-plus的情况下 需要使用动态sql的情形,此时需要创建对应mapper 的实现类 xxMapper.xml
但是这个文件的位置有两种选择性

  

 

  第一种是放在java包下,第二种选择是 放在resources包下  两种不同的方法  需要通过不同的配置 来将mapper.java 和mapper.xml绑定

<resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
</resources>

 

 

 

标签:xml,mapper,java,包下,spring,boot,plus,mybatis
来源: https://www.cnblogs.com/neal-blog/p/16102616.html