1. TestMapper
int updateBatch(
@Param(
"id")
int[] id, String test);
2. TestMapper.xml
<update id=
"updateBatch">
UPDATE table_name
SET test =
WHERE id IN
<foreach collection=
"id" item=
"item" open=
"(" separator=
"," close=
")">
</foreach>
</update>
3. 调用
int[]
id = new
int[]{
1,
2,
3};
updateBatch(
id,
"test");
转载请注明原文地址: https://ju.6miu.com/read-19817.html