ajax :traditional 设为 true 使用传统方式浅层序列化
$.ajax(url, {data: param, async: false, dataType: "json", traditional: true}).done(function(data) {
if (0 == data.code) {
flag = true;
} else {
$.messager.popup(data.message);
flag = false;
}
});
mybatis:批量删除
delete from staff_relations where super_staff_number=#{superStaffNumber} AND staff_number IN
<foreach collection="staffNumbers" item="item" separator="," open="(" close=")">
#{item}
</foreach>
// collection:表示参数类型,参数如果是数组则写成 array,如果是集合则写成 list
DAO
Integer deleteByStaffNumbersAndSuperStaffNumber(@Param("staffNumbers") Integer[] staffNumbers, @Param("superStaffNumber") Integer superStaffNumber);