选择语句是:
<select id=”findByCondition” resultMap=”RM_SpUser”>
select
<include refid=”columns” />
from sp_user
<include refid=”findByCondition_where” />
order by orderCount desc, createTime desc
</select>
出现错误提示:
Error querying database. Cause: java.sql.SQLException: No value specified for parameter 1
### The error may exist in file [E:\eclipseEE\aaa\target\classes\mapper\SpUserMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT userId,phone,token,password,status,name,sex,headImageUrl,orderCount,note,createTime,updateTime FROM sp_user WHERE phone = ? LIMIT 0,1
### Cause: java.sql.SQLException: No value specified for parameter 1
; bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 1
<select id=”findByCondition” resultMap=”RM_SpUser”>
select
<include refid=”columns” />
from sp_user
<include refid=”findByCondition_where” />
order by orderCount desc, createTime desc
</select>
出现错误提示:
Error querying database. Cause: java.sql.SQLException: No value specified for parameter 1
### The error may exist in file [E:\eclipseEE\aaa\target\classes\mapper\SpUserMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT userId,phone,token,password,status,name,sex,headImageUrl,orderCount,note,createTime,updateTime FROM sp_user WHERE phone = ? LIMIT 0,1
### Cause: java.sql.SQLException: No value specified for parameter 1
; bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 1
解决方案
10
你这是mysql吗 在后台加查询条件phone能查到吗
LIMIT 是mysql的语法
select * from table limit m,n
其中m是指记录开始的index,从0开始,表示第一条记录
5
应该是数据库表未与程序中的映射对应,仔细检查一下。
5
是不是你where条件里那么多条件。而你传过来的只有一个phone导致的。