Bootstrap

mybatis-plus批量查询

 /**
     * 查询(根据ID 批量查询)
     *
     * @param idList 主键ID列表
     *
     */
    default List<T> listByIds(Collection<? extends Serializable> idList) {
        return getBaseMapper().selectBatchIds(idList);
    }

idList 为空或者idList .size() == 0 在执行过程中sql会有语法问题。程序会报错而不是返回一个空集合
sql 类似于下面的形式,括号里没有值sql语法是有问题的

select * from user where id in ()
;