package cn.iocoder.yudao.module.pms.dal.mysql.ly;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pms.controller.admin.ly.vo.LyDevicePageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.ly.LyDeviceDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 连油设备信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface LyDeviceMapper extends BaseMapperX<LyDeviceDO> {

    default PageResult<LyDeviceDO> selectPage(LyDevicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LyDeviceDO>()
                .eqIfPresent(LyDeviceDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(LyDeviceDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(LyDeviceDO::getDeviceCode, reqVO.getDeviceCode())
                .likeIfPresent(LyDeviceDO::getDeviceName, reqVO.getDeviceName())
                .likeIfPresent(LyDeviceDO::getOtherName, reqVO.getOtherName())
                .eqIfPresent(LyDeviceDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(LyDeviceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LyDeviceDO::getId));
    }

}