<selectid="findUsersByIdsStr02"resultType="com.cosnola.demo.demos.model.User">
SELECT * FROM user WHERE name IN
<foreachcollection="names"item="name"separator=","open="("close=")">
#{name}
</foreach></select>
@TestvoidfindUsersByIdsStr02(){
User user =User.builder().names(idsStrToList("Man Ting Fung,Harold Cruz,Aoki Momoka,Ren Jiehong")).build();List<User> usersByIdsStr = userMapper.findUsersByIdsStr02(user);
log.info("usersByIdsStr: {}", usersByIdsStr.toString());}// 需要的工具类staticpublicList<String