mybatis中使用循环、mybatis传入map案例
<!-- 根据id修改商户提成配置--> <update id="editStopAll" parameterType="pd"> update tb_member_join <set> <if test="status !=null and status !=''"> status=#{status}, </if> <if test="update_time!=null and update_time!=''"> update_time=#{update_time}, </if> <if test="createtor!=null and createtor!=''"> createtor=#{createtor}, </if> </set> where id in <foreach item="item" collection="list" separator="," open="(" close=")" index=""> #{item.id} </foreach> </update>
PageData pd = new PageData();//这里就是一个map pd.put("list", list); pd.put("status","0"); pd.put("update_time", DateUtil.getTime()); pd.put("createtor",u_id); return (Integer)dao.update("franchiseeMapper.editStopAll", pd);