1. 程式人生 > >Invalid bound statement (not found): com.xxx.xxx.mapper.xxx

Invalid bound statement (not found): com.xxx.xxx.mapper.xxx

開發工具:IDEA

問題現象:訪問介面時Dao呼叫報錯找不到mapper

mapper和entity是逆向工程生成的  訪問報這個錯誤。

 Invalid bound statement (not found): com.xxx.repository.mapper.SchoolInfoMapper.countByExample

 

解決方法:

<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
			<resource>
				<directory>src/main/java</directory>
				<filtering>false</filtering>
				<includes>
					<include>**/mapping/*.xml</include>
				</includes>
			</resource>
		</resources>
	</build>

配置你的mapping的路徑

問題解決

問題還有可能是其他原因造成的可以參考

https://blog.csdn.net/weixin_42204641/article/details/81155726