Mybatis-Plus查询时排除某一列

/ 随笔 / 1 条评论 / 149浏览

public List<BrokerMessageLog> query4StatusAndTimeoutMessage() {
    return lambdaQuery().eq(BrokerMessageLog::getStatus, Constant.ORDER_SENDING)
            .le(BrokerMessageLog::getNextRetry, LocalDateTime.now())
            .select(BrokerMessageLog.class, tableFieldInfo -> !"name".equals(tableFieldInfo.getColumn()))
            .list();
}

.select(BrokerMessageLog.class, tableFieldInfo -> !"name".equals(tableFieldInfo.getColumn()))

排除了字段名称为 name 的字段.