Skip to content

How can I iterate the item of the inner loop with <foreach> tag #3460

Open
@rebe1wave

Description

@rebe1wave

I wanna batch updating the records with dynamic columns
Here is the example:

UPDATE xxx
SET

${field} = CASE id

WHEN #{item.id} THEN #{item[${field}]}

END

WHERE xxx.id IN

#{item.id}

I definitely declare correct params of the function in mapper with the @param annotation.
The inner loop with foreach tag can't be iterated.
The exception like follow:
nested exception is org.apache.ibatis.binding.BindingException: Parameter 'item' not found. Available parameters are [updateColumnList, itemList, param1, param2]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions