具体报错信息:
org.mybatis.spring.MyBatisSystemException:
nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='zsrwbh', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}.
Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType null .
Try setting a different JdbcType for this parameter or a different configuration property.
Cause: java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
原因在于sql里面注释没删掉
<select id="getBdnrBybh" resultType="com.kw.gydl.bdgl.vo.BjyqListVo" parameterType="java.lang.String">
/** select id,zsrwbh,bj,yqjnr,jcqk,jcjg,remark from t_gydl_bdgl_zsnr
where zsrwbh = #{zsrwbh}
order by BJ asc **/
SELECT
COUNT( s.id ) 'zpsl',z.id,z.zsrwbh, z.bj,z.yqjnr,ifnull(if(length(trim(z.jcqk))>0,z.jcqk,null),2) AS 'jcqk',
ifnull(if(length(trim(z.jcjg))>0,z.jcjg,null),2) AS 'jcjg', z.remark
FROM
t_gydl_bdgl_zsnr z LEFT JOIN sys_file s ON z.ID = s.YWBH
WHERE z.zsrwbh = #{zsrwbh}
GROUP BY z.ID ORDER BY z.BJ ASC
</select>
sql检查了一下没问题。后来尝试着把注释掉的部分删掉就可以了!!!
。。。就可以了!
着实有点坑。。。