Mybatis关于Parameter 'Array' not found批量更新、多参数隐射的处理

单纯的多参数,只需要按照顺序 #{arg0}    #{arg1}    #{arg2} 替换即可, 我这里还有个数组类型的参数需要处理,需要把collection="arg0" 指定为参数即可

void distributeTenant (Long [] ids, Long tenantId, String name);
    <update id="distributeTenant">
        update dtu_basic_info set be_tenant_id = #{tenantId}, get_name=#{name} where id in

        <foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
            #{id}
        </foreach>

    </update>

猜你喜欢

转载自blog.csdn.net/langeldep/article/details/84029942
今日推荐