<update id="update" parameterType="XXX">
update XX set YY
<choose>
<when test="dmlItem.id != null">
where XX1
</when>
<otherwise>
where XX2
</otherwise>
</choose>
</update>