lambda 表达式:

queryWrapper.lambda().eq(Entity::getLockStatus, 0)
    .or().and(wrapper -> wrapper.eq(Entity::getLockStatus, 1).lt(Entity::getLockTime, LocalDateTime.now()))
    .isNull(Entity::getErrMsg);

其中,Entity 为实体类,queryWrappercom.baomidou.mybatisplus.core.conditions.query.QueryWrapper 对象。

sql转 mybatis plus lamdba 表达式where lock_status = 0 or lock_status = 1 and lock_time now and err_msg is null

原文地址: https://www.cveoy.top/t/topic/fFlc 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录