MyBatis 的 in 查詢導致的bug
案例 分享一個很久之前的案例。 任務是:根據運營部門提供的門店列表,查詢門店詳情並生成報表。起初,我寫了這樣一段 SQL: select id="selectStores" resultType="Store" SELECT * FROM stores WHERE store_code foreach collection="storeIdList" item="store
案例 分享一個很久之前的案例。 任務是:根據運營部門提供的門店列表,查詢門店詳情並生成報表。起初,我寫了這樣一段 SQL: select id="selectStores" resultType="Store" SELECT * FROM stores WHERE store_code foreach collection="storeIdList" item="store