Mybatis-Puls 手写SQL在win10本地环境可以使用,Liunx环境无法使用

最近在项目中用Mybatis+Mybatis-Puls写SQL,在开发环境win10能执行手写在xml里面的SQL,在Liunx环境中就运行报错

ERR-INFOorg.apache.shiro.web.servlet.ShiroHttpServletRequest@2b818266
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.aegis.cli.service.wqsd.casesharing.mapper.CliWqsdCaseSharingLogMapper.getHeadings
	at com.baomidou.mybatisplus.core.override.PageMapperMethod$SqlCommand.<init>(PageMapperMethod.java:261)
	at com.baomidou.mybatisplus.core.override.PageMapperMethod.<init>(PageMapperMethod.java:58)
	at com.baomidou.mybatisplus.core.override.PageMapperProxy.cachedMapperMethod(PageMapperProxy.java:70)
	at com.baomidou.mybatisplus.core.override.PageMapperProxy.invoke(PageMapperProxy.java:63)
	at com.sun.proxy.$Proxy282.getHeadings(Unknown Source)
	at com.aegis.cli.service.wqsd.casesharing.service.impl.CliWqsdCaseSharingLogServiceImpl.getHeadings(CliWqsdCaseSharingLogServiceImpl.java:24)
	at com.aegis.cli.service.wqsd.casesharing.service.impl.CliWqsdCaseSharingLogServiceImpl$$FastClassBySpringCGLIB$$d7dc4e17.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

这是因为在Liunx中无法找到对应的xml导致SQL无法执行。

解决方案 :
在Liunx 环境中 指定 xml目录,win10不用加(加上本地就报错)
项目配置文件(application.properties)中加

#指定微球时代 sql-xml 目录
# mybatis-plus.mapper-locations=classpath:com/aegis/cli/service/wqsd/**/mapper/*.xml

你可能感兴趣的:(java,Mybatis-Puls,Mybatis)