日期:2014-05-17 浏览次数:20898 次
<!-- 根据用户名和账户搜索用户 --> <select id="selectUserByLoginnameAndShowName" parameterClass="java.util.Map" resultMap="resultUsers"> SELECT a.USER_ID ,a.LOGIN_NAME ,a.PASS_WORD ,a.SHOW_NAME ,a.PASS_WORD ,a.CREATE_TIME ,a.GROUP_ID ,a.ADMIN_FLG ,b.ID ,b.GROUP_NAME ,b.HIDE_FLG FROM table_user as a LEFT JOIN table_group AS b ON b.ID = a.GROUP_ID <dynamic prepend="WHERE"> <isNotEmpty prepend="AND" property="loginName"> a.LOGIN_NAME LIKE '%$loginName$%' </isNotEmpty> <isNotEmpty prepend="AND" property="showName"> a.SHOW_NAME LIKE '%$showName$%' </isNotEmpty> <isNotNull property="fromIndex"> <isNotNull property="pageSize"> LIMIT #fromIndex# , #pageSize# </isNotNull> </isNotNull> </dynamic> ORDER BY a.USER_ID DESC </select>
rg.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/cloudsoaring/dao/sqlmap/Users_SqlMap.xml. --- The error occurred while applying a result map. --- Check the Users.resultUsers. --- Check the result mapping for the 'id' property. --- Cause: java.sql.SQLException: Column 'USER_ID' not found. org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:111) org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322) org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:196) org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:241) com.cloudsoaring.common.dao.impl.CommonDaoImpl.searchCount(CommonDaoImpl.java:49) com.cloudsoaring.dao.impl.user.UsersDaoImpl.searchUserByShownameCount(UsersDaoImpl.java:99) com.cloudsoaring.service.impl.user.UserServiceImpl.searchUserByLoginNameAndShowName(UserServiceImpl.java:182) com.cloudsoaring.action.user.UserLoginAction.searchUserByLoginNameAndShowName(UserLoginAction.java:219) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source)