<select id="countForToday" resultType="int" parameterType="string">
select count(*) from knowledgearticle where ka_date = current_date
<if test="classid!=null and classid != ''">
and ka_classid = #{classid}
</if>
</select>
-------------------------------
如上参数是一个string类型的字符串,运行时会报错:
ReflectionException: There is no getter for property named 'classid' in 'class java.lang.String'
这是个字符串不是实体啊,哪有getter for property named 'classid' ,晕...