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

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

/**
 * 瑞鹰设备整改日报明细(生产动态拆分) Mapper
 *
 * @author ruiqi
 */
@Mapper
public interface IotRyImproveDailyReportDetailMapper extends BaseMapperX<IotRyImproveDailyReportDetailDO> {

    default PageResult<IotRyImproveDailyReportDetailDO> selectPage(IotRyImproveDailyReportDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotRyImproveDailyReportDetailDO>()
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getReportId, reqVO.getReportId())
                .betweenIfPresent(IotRyImproveDailyReportDetailDO::getStartDateTime, reqVO.getStartDateTime())
                .betweenIfPresent(IotRyImproveDailyReportDetailDO::getEndDateTime, reqVO.getEndDateTime())
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getDuration, reqVO.getDuration())
                .likeIfPresent(IotRyImproveDailyReportDetailDO::getProjectName, reqVO.getProjectName())
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getConstructionDetail, reqVO.getConstructionDetail())
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getNextPlan, reqVO.getNextPlan())
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getSort, reqVO.getSort())
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotRyImproveDailyReportDetailDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotRyImproveDailyReportDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotRyImproveDailyReportDetailDO::getId));
    }

}