- "↵### Error querying database. Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).↵### The error may exist in file [/home/wpu/apache-tomcat-8.0.32/webapps/h5s/WEB-INF/classes/config/mybatis/sqlxml/UserInfoMapper.xml]↵### The error may involve com.allcam.uas.sys.mybatis.mapper.UserInfoMapper.getProgramAllList-Inline↵### The error occurred while setting parameters↵### SQL: SELECT * FROM tbl_course_info WHERE PROGRAM_ID like '%?%' or COURSE_REMARK like '%?%' order by COURSE_PRAISE DESC↵### Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).↵; SQL []; Parameter index out of range (1 > number of parameters, which is 0).; nested exception is java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0)."
<select id="getProgramAllList" parameterType="map" resultMap="ProgramBaseResultMap">
SELECT * FROM tbl_course_info <where> <if test="keyword != null and !"".equals(keyword.trim())"> PROGRAM_ID like '%#{keyword}%' or COURSE_REMARK like '%#{keyword}%' </if> </where> order by COURSE_PRAISE DESC </select>
需要改成
<select id="getProgramAllList" parameterType="map" resultMap="ProgramBaseResultMap">
SELECT * FROM tbl_course_info <where> <if test="keyword != null and !"".equals(keyword.trim())"> PROGRAM_ID like "%"#{keyword}"%" or COURSE_REMARK like "%"#{keyword}"%" </if> </where> order by COURSE_PRAISE DESC </select>