@api.put("{{ path }}", status_code=200, response_model={{ model_name }}UpdateManyItemListResponseModel)
{{ 'async ' if is_async else '' }}def entire_update_many_by_query(
                                                response: Response,
                                                update_data: {{ model_name }}UpdateManyRequestBodyModel = Depends(),
                                                extra_query: {{ model_name }}UpdateManyRequestQueryModel = Depends(),
                                                session=Depends(db_session)):
    model = {{ model_name }}

    extra_args = extra_query.__dict__
    update_args = update_data.__dict__
    filter_list: List[BinaryExpression] = find_query_builder(param=extra_args,
                                                             model=model)
    stmt = select(model).where(and_(*filter_list))
    sql_executed_result = {{ 'await ' if is_async else '' }}session.execute(stmt)
    data_instance_list = [i for i in sql_executed_result.scalars()]


    if not data_instance_list:
        return Response(status_code=HTTPStatus.NOT_FOUND, headers={"x-total-count": str(0)})
    try:
        response_data = []
        for i in data_instance_list:
            for update_arg_name, update_arg_value in update_args.items():
                        setattr(i, update_arg_name, update_arg_value)
            response_data.append(i)

        result = parse_obj_as({{ model_name }}UpdateManyItemListResponseModel, response_data)
        response.headers["x-total-count"] = str(len(response_data))
        {{ 'await ' if is_async else '' }}session.flush()
        return result

    except IntegrityError as e:
        err_msg, = e.orig.args
        if 'unique constraint' not in err_msg.lower():
            raise e
        result = Response(status_code=HTTPStatus.CONFLICT, headers={"x-total-count": str(0)})
        return result
