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

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.iotrddailyreportdetail.vo.IotRdDailyReportDetailPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotrddailyreportdetail.IotRdDailyReportDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 瑞都日报明细(生产动态拆分) Mapper
 *
 * @author ruiqi
 */
@Mapper
public interface IotRdDailyReportDetailMapper extends BaseMapperX<IotRdDailyReportDetailDO> {

    default PageResult<IotRdDailyReportDetailDO> selectPage(IotRdDailyReportDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotRdDailyReportDetailDO>()
                .eqIfPresent(IotRdDailyReportDetailDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotRdDailyReportDetailDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(IotRdDailyReportDetailDO::getTaskId, reqVO.getTaskId())
                .eqIfPresent(IotRdDailyReportDetailDO::getReportId, reqVO.getReportId())
                .inIfPresent(IotRdDailyReportDetailDO::getReportId, reqVO.getReportIds())
                .betweenIfPresent(IotRdDailyReportDetailDO::getReportDate, reqVO.getReportDate())
                .betweenIfPresent(IotRdDailyReportDetailDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(IotRdDailyReportDetailDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(IotRdDailyReportDetailDO::getDuration, reqVO.getDuration())
                .eqIfPresent(IotRdDailyReportDetailDO::getConstructionDetail, reqVO.getConstructionDetail())
                .eqIfPresent(IotRdDailyReportDetailDO::getCurrentOperation, reqVO.getCurrentOperation())
                .eqIfPresent(IotRdDailyReportDetailDO::getRdStatus, reqVO.getRdStatus())
                .eqIfPresent(IotRdDailyReportDetailDO::getExtProperty, reqVO.getExtProperty())
                .eqIfPresent(IotRdDailyReportDetailDO::getSort, reqVO.getSort())
                .eqIfPresent(IotRdDailyReportDetailDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotRdDailyReportDetailDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotRdDailyReportDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotRdDailyReportDetailDO::getId));
    }

}