mybatis-3
mybatis-3 copied to clipboard
Mapper参数构造bug
<select id="queryList" resultType="com.xxx.entity.ReceivableEntity">
select * from ims_rec_receivable
<where>
tenant_id = #{tenantId}
<if test="receivableIds != null and !receivableIds.isEmpty()">
and receivable_id in
<foreach collection="receivableIds" open="(" separator="," close=")" item="receivableId">
#{receivableId, jdbcType=VARCHAR}
</foreach>
</if>
<if test="receivableId != null and receivableId != ''">
and receivable_id = #{receivableId, jdbcType=VARCHAR}
</if>
</where>
</select>
问题描述: 当前查询参数对象的receivableId为空但是会默认以 collection="receivableIds" 中的receivableId最后一个参照
Hello @imaxun ,
Which version do you use? We've fixed a similar issue #966 in 3.4.5. If your problem reproduces in the latest version, please provide a test case or demo project.
Okay thank you
Okay thank you
Already done? If so, Should we close this issue? @imaxun @harawata
Thanks
We can close, I assume.