<select id="selectInfo " parameterType="map" resultMap="BaseResultMap">
select
*
from testTable
where 1=1
<if test="datetime != null and datetime !=''" >
and datetime <![CDATA[>]]>{datetime,jdbcType=TIMESTAMP}
</if>
<if test="id!= null and id!=''" >
and id = #{id,jdbcType=VARCHAR}
</if>
</select>
当执行这个sql的时候报错如下
Error querying database. Cause: java.sql.SQLException: Non supported SQL92 token at position: 511: datetime
大概意思是其中一个参数不被支持
当解决完毕第一个问题之后报第二个错
ERROR s.f.core.base.BaseControllerImpl - 程序异常信息:Invalid bound statement (not found)
找不到这个方法
当时盲写的代码
第一个错误是参数前没有添加“#”
第二个错误是方法名字最后有个空格。。
牢记牢记