Invalid bound statement (not found): com.guli.collegemanagetrailing.mapper.LoginMapper.login
我已经检查过了没有任何问题,mybatisX插件也正常提示跳转,但是就是会报这个错误,但是使用@Select注解后又没有任何问题,我的路径是没有错误的,正常放在application.yml同级的mappers文件夹下
LoginMapper.java的代码
@Mapper
public interface LoginMapper {
/**
* 登录成功或失败
* @param loginDto 登录对象
* @return 返回loginDto对象
*/
LoginDto login(@Param("loginDto") LoginDto loginDto);
}
LoginMapper.xml的代码
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.guli.collegemanagetrailing.mapper.LoginMapper">
<resultMap id="loginMap" type="com.guli.collegemanagetrailing.dto.LoginDto">
<result property="username" column="username" />
<result property="password" column="password" />
<result property="jurisdictionId" column="jurisdiction_id" />
<result property="status" column="status" />
</resultMap>
<select id="login" resultMap="loginMap">
SELECT `username`,`password`,`jurisdiction_id`,`status` FROM `member` WHERE `username` = #{loginDto.username}
</select>
</mapper>
启动类上也加入了mapperscan
@SpringBootApplication
@MapperScan("com.guli.collegemanagetrailing.mapper")
@EnableWebSecurity
public class CollegeManageTrailingApplication {
public static void main(String[] args) {
SpringApplication.run(CollegeManageTrailingApplication.class, args);
}
}