测试类查询遇到问题
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘user_type’ not found. Available parameters are [2, 1, 0, param1, param2, param3]
解决办法
在mapper.java类中,由于参数列表都是Stirng类型,两个以上的就需要添加@Param:
List selectByCode(@Param(“aaa”)String cltcode,@Param(“bbb”)String cltname);
结果又报另一个错误:
Expected one result (or null) to be returned by selectOne(), but found: 4;
结果找到了4个,所以就把 bean 改成集合 List,返回的集合就没有问题了。