Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapper参数构造bug #2486

Closed
imaxun opened this issue Mar 23, 2022 · 5 comments
Closed

Mapper参数构造bug #2486

imaxun opened this issue Mar 23, 2022 · 5 comments

Comments

@imaxun
Copy link

imaxun commented Mar 23, 2022

<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最后一个参照

@harawata
Copy link
Member

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.

@imaxun
Copy link
Author

imaxun commented Mar 24, 2022

Okay thank you

@awxiaoxian2020
Copy link
Contributor

Okay thank you

Already done? If so, Should we close this issue? @imaxun @harawata

@JohnWangShiXin
Copy link

Thanks

@harawata
Copy link
Member

We can close, I assume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants