参考文档
https://blog.csdn.net/weixin_42825651/article/details/123045574
解决方法一:
使用in or语句
<select id="batchGetUserInfoByUserIds" resultMap="BaseResultMap">
SELECT USER_ID, CP_ID, CITIC_USER_ID, USER_TYPE, MEMBER_CARD_NO, NICKNAME, SEX,PHOTO, MOBILE_NO, CREATE_TIME, MODIFY_TIME, REMARK, MSISDN FROM TS_USERINFO WHERE (1,USER_ID) IN
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
(1, #{userId})
</foreach>
</select>
解决方法二:
Java中按1000分批查询,再把结果加起来,这种方式稍复杂,而且查询次数过多,对业务逻辑改动较大。