首页 新闻 会员 周边 捐助

Mapped Statements collection does not contain value for com.zzzy.dajiatou.Mapper.UserMapper.querytyp

0
悬赏园豆:10 [已关闭问题] 关闭于 2015-07-09 19:18

mapper.xml的代码:

<!--
state 根据状态进行权限登陆判断
-->

<select id="querytypelogin" resultMap="BaseResultMap" parameterType="com.zzzy.dajiatou.Bean.User">

SELECT *
from T_USER
WHERE
USERNAME = #{username}
AND
PWD = #{pwd}
AND
USERTYPE = #{usertype}

</select>

 

public interface UserMapper {

/**
* 通过用户类型进行权限登录
* @param user 页面对象
* @return 实体类对象
* @throws Exception
*/

public User querytypelogin(User user)throws Exception;

 

daoimpl

public User querytypelogin(User user) throws Exception {
// TODO 通过用户类型进行权限登录
return userMapper.querytypelogin(user);
}

 

servicedaoimpl

public User querytypelogin(User user) throws Exception {
// TODO 通过用户类型进行权限登录
return userMapper.querytypelogin(user);
}

 

/**
* 根据状态登陆相应的管理页面
* @param ss session
* @param user 页面对象
* @param model 模型
* @return 返回响应视图
* @throws Exception
*/

@RequestMapping("typelogin")
public String typelogin(HttpSession ss,User user,Model model)throws Exception{

User userLogin = usermaperaction.querytypelogin(user);
User userterm = new User();
if(userLogin != null){
if(userterm.getUsertype() == 0){
ss.setAttribute("userLogin", userLogin);
return "forward:/index";
}else if(userterm.getUsertype() == 1){
ss.setAttribute("userLogin", userLogin);
return "forward:/managerindex";
}
}
model.addAttribute("login_error", "用户名或者密码不正确!");
return "login";


}

 

报错异常

Servlet.service() for servlet spring threw exception
java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.zzzy.dajiatou.Mapper.UserMapper.querytypelogin
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:672)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:507)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:500)
at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:240)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:71)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:39)
at com.sun.proxy.$Proxy18.querytypelogin(Unknown Source)
at com.zzzy.dajiatou.DaoImpl.UserDaoImpl.querytypelogin(UserDaoImpl.java:137)
at com.zzzy.dajiatou.ServiceDaoImpl.UserServiceDaoImpl.querytypelogin(UserServiceDaoImpl.java:142)
at com.zzzy.dajiatou.ServiceDaoImpl.UserServiceDaoImpl$$FastClassBySpringCGLIB$$c917e8c2.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:700)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633)
at com.zzzy.dajiatou.ServiceDaoImpl.UserServiceDaoImpl$$EnhancerBySpringCGLIB$$a49fab98.querytypelogin(<generated>)
at com.zzzy.dajiatou.Controller.UserController.typelogin(UserController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:685)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.zzzy.dajiatou.Filter.CharsetFilter.doFilter(CharsetFilter.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:745)

玉儿滢心的主页 玉儿滢心 | 初学一级 | 园豆:187
提问于:2015-04-20 11:50
< >
分享
所有回答(1)
0

username是不是中文的?

dudu | 园豆:30948 (高人七级) | 2015-04-20 12:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册