I have a mysql 8 update command and return effect rows in mybatis xml, this is the xml defined like:
<select id="updateShopProductSyncBatch" resultType="java.lang.Integer">
update shop_product spo left join product_line plo on spo.line_id = plo.id
set spo.online_status = plo.online_status,
spo.recommend = plo.recommend,
spo.sync_version = #{request.batchVersion,jdbcType=VARCHAR},
spo.top_quality = plo.top_quality
where spo.id in(
select id
from (
select id as id
from shop_product
where shop_id = #{request.shopId}
and sync_version != #{request.batchVersion,jdbcType=VARCHAR}
limit 1000
) idc
)
and plo.id is not null
</select>
and this is the mapper defined look like:
Integer updateShopProductSyncBatch(@Param("request") ShopProductSyncByHandleReqDTO req);
now I found the result effect rows always be null, not 0 or other value. is it possible to get the effect rows correctly? If no rows effect, just return 0, others return a number, not null in any situation.
3