How does mybatis iterate through a string?

is a string made up of multiple id String ids = "1 id 2, 3 4". Now you want to traverse through the mybatis without cutting it into an array. What do you do according to the delete operation according to the id? I reported an error here:
< where >

        u.id IN
        <foreach collection="-sharp{param1}" item="item" index="index" open="(" separator="," close=")">
            "${item}"
        </foreach>

<bind name="idsBind" value="'(' + param1 + ')'"></bind>
u.id in ${idsBind}

try it?


refer to this
https://blog.csdn.net/u012009.


Direct u.id in (${ids})


wouldn't it be better for first impressions to use mybatis, and directly use java to process List;

the inspiration from the answer is to use SQL to deal with it, both of which are great.

Menu