|
|
@@ -268,9 +268,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<update id="batchUpdateCompany" parameterType="java.util.List">
|
|
|
- <foreach collection="list" item="company" separator=";">
|
|
|
- update company set money = #{company.money}
|
|
|
- WHERE company_id = #{company.companyId}
|
|
|
+ update company set money =
|
|
|
+ <foreach collection="list" item="company" index="index" separator=" " open="case company_id" close="end">
|
|
|
+ when #{company.companyId} then #{company.money}
|
|
|
+ </foreach>
|
|
|
+ where company_id in
|
|
|
+ <foreach collection="list" index="index" item="company" separator="," open="(" close=")">
|
|
|
+ #{company.companyId}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
+
|
|
|
</mapper>
|