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

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

/**
 * 项目日报 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotProjectDailyReportMapper extends BaseMapperX<IotProjectDailyReportDO> {

    default PageResult<IotProjectDailyReportDO> selectPage(IotProjectDailyReportPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotProjectDailyReportDO>()
                .eqIfPresent(IotProjectDailyReportDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotProjectDailyReportDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(IotProjectDailyReportDO::getTaskId, reqVO.getTaskId())
                .eqIfPresent(IotProjectDailyReportDO::getProjectClassification, reqVO.getProjectClassification())
                .betweenIfPresent(IotProjectDailyReportDO::getConstructionStartDate, reqVO.getConstructionStartDate())
                .betweenIfPresent(IotProjectDailyReportDO::getConstructionEndDate, reqVO.getConstructionEndDate())
                .eqIfPresent(IotProjectDailyReportDO::getNextPlan, reqVO.getNextPlan())
                .eqIfPresent(IotProjectDailyReportDO::getProductionStatus, reqVO.getProductionStatus())
                .eqIfPresent(IotProjectDailyReportDO::getConstructionStatus, reqVO.getConstructionStatus())
                .eqIfPresent(IotProjectDailyReportDO::getPersonnel, reqVO.getPersonnel())
                .eqIfPresent(IotProjectDailyReportDO::getExtProperty, reqVO.getExtProperty())
                .eqIfPresent(IotProjectDailyReportDO::getSort, reqVO.getSort())
                .eqIfPresent(IotProjectDailyReportDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotProjectDailyReportDO::getStatus, reqVO.getStatus())
                .eqIfPresent(IotProjectDailyReportDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .eqIfPresent(IotProjectDailyReportDO::getAuditStatus, reqVO.getAuditStatus())
                .betweenIfPresent(IotProjectDailyReportDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotProjectDailyReportDO::getId));
    }

}