您的位置:首页 > 其它

mybatis 参数为String,if test读取该参数

2015-07-24 11:23 246 查看


错误:There is no getter for property named 'userId' in 'class java.lang.String'
错误写法:

<select id="selectFlowTxInfoDO" resultType="int" parameterType="java.lang.String">
select
count(1)
from first_flow_tx_info fcpi
where 1=1
<if test="userId != null" >
and user_id = #{userId,jdbcType=VARCHAR} and fcpi.tx_status NOT IN (10,00,30,50)
</if>
</select>


正确
<select id="getMaxDepartId" parameterType="java.lang.String" resultType="java.lang.String">
select
count(1)
from first_flow_tx_info fcpi
where 1=1
<if test="_parameter != null" >
and user_id = #{userId,jdbcType=VARCHAR} and fcpi.tx_status NOT IN (10,00,30,50)
</if>
</select>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: