MyBatis version

3.x.x

Database vendor and version

MySql 5.7

Test case or example project

This part code means wirte off doc batch update purchase docs residue amount to pay.

<update id="updateResidueAmount" >
        <foreach collection="lstDoc" item="mDoc" separator=";">
            update pss_purchase
            set residue_amount_to_pay=residue_amount_to_pay-#{mDoc.writeOffAmount},
            <where>
            company_id=#{mDoc.companyId} 
            and doc_code=#{mDoc.sourceDocCode} 
            and is_audited=1
            and residue_amount_to_pay &gt;= #{mDoc.writeOffAmount}
            </where>
        </foreach>
    </update>

Expected result

I need to know whether process is completely successful by a result about affected rows, like return a number of rows, or array about affected rows.

Actual result

this result actually return 1, even the doc update more than 2 rows. I can't judge whether the doc update complelety.

Comment From: harawata

Hi @YangYishe , Please see this answer. https://stackoverflow.com/a/58914577/1261766

Comment From: harawata

No response.