1.在数据库url连接后加入allowMultiQueries=true参数。
2.DAO层:
Integer updateDepartmentIdByEmails(@Param("emails") List<String> emails, @Param("departmentId") Integer departmentId);
3.Mapper:
<update id="updateDepartmentIdByEmails"> <foreach collection="emails" item="email" separator=";"> update profiles t set department_id = #{departmentId} <where> t.login_name = #{email} </where> </foreach> </update>