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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e943e3-47297.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e943e3-47297.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?