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

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

import java.util.List;

/**
 * 日报扩展模板属性 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotDailyReportAttrsMapper extends BaseMapperX<IotDailyReportAttrsDO> {

    default PageResult<IotDailyReportAttrsDO> selectPage(IotDailyReportAttrsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotDailyReportAttrsDO>()
                .eqIfPresent(IotDailyReportAttrsDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(IotDailyReportAttrsDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotDailyReportAttrsDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(IotDailyReportAttrsDO::getProjectClassification, reqVO.getProjectClassification())
                .eqIfPresent(IotDailyReportAttrsDO::getWellType, reqVO.getWellType())
                .eqIfPresent(IotDailyReportAttrsDO::getWellCategory, reqVO.getWellCategory())
                .eqIfPresent(IotDailyReportAttrsDO::getTechnique, reqVO.getTechnique())
                .likeIfPresent(IotDailyReportAttrsDO::getName, reqVO.getName())
                .eqIfPresent(IotDailyReportAttrsDO::getIdentifier, reqVO.getIdentifier())
                .eqIfPresent(IotDailyReportAttrsDO::getDataType, reqVO.getDataType())
                .eqIfPresent(IotDailyReportAttrsDO::getRequired, reqVO.getRequired())
                .eqIfPresent(IotDailyReportAttrsDO::getUnit, reqVO.getUnit())
                .eqIfPresent(IotDailyReportAttrsDO::getAccessMode, reqVO.getAccessMode())
                .eqIfPresent(IotDailyReportAttrsDO::getDefaultValue, reqVO.getDefaultValue())
                .eqIfPresent(IotDailyReportAttrsDO::getMaxValue, reqVO.getMaxValue())
                .eqIfPresent(IotDailyReportAttrsDO::getMinValue, reqVO.getMinValue())
                .eqIfPresent(IotDailyReportAttrsDO::getExtProperty, reqVO.getExtProperty())
                .eqIfPresent(IotDailyReportAttrsDO::getSort, reqVO.getSort())
                .eqIfPresent(IotDailyReportAttrsDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotDailyReportAttrsDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotDailyReportAttrsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotDailyReportAttrsDO::getId));
    }

    default List<IotDailyReportAttrsDO> dailyReportAttrs(IotDailyReportAttrsPageReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<IotDailyReportAttrsDO>()
                .eqIfPresent(IotDailyReportAttrsDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(IotDailyReportAttrsDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotDailyReportAttrsDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(IotDailyReportAttrsDO::getProjectClassification, reqVO.getProjectClassification())
                .eqIfPresent(IotDailyReportAttrsDO::getWellType, reqVO.getWellType())
                .eqIfPresent(IotDailyReportAttrsDO::getWellCategory, reqVO.getWellCategory())
                .eqIfPresent(IotDailyReportAttrsDO::getTechnique, reqVO.getTechnique())
                .inIfPresent(IotDailyReportAttrsDO::getTechnique, reqVO.getTechniqueIds())
                .likeIfPresent(IotDailyReportAttrsDO::getName, reqVO.getName())
                .eqIfPresent(IotDailyReportAttrsDO::getIdentifier, reqVO.getIdentifier())
                .eqIfPresent(IotDailyReportAttrsDO::getDataType, reqVO.getDataType())
                .eqIfPresent(IotDailyReportAttrsDO::getRequired, reqVO.getRequired())
                .eqIfPresent(IotDailyReportAttrsDO::getUnit, reqVO.getUnit())
                .eqIfPresent(IotDailyReportAttrsDO::getAccessMode, reqVO.getAccessMode())
                .eqIfPresent(IotDailyReportAttrsDO::getDefaultValue, reqVO.getDefaultValue())
                .eqIfPresent(IotDailyReportAttrsDO::getMaxValue, reqVO.getMaxValue())
                .eqIfPresent(IotDailyReportAttrsDO::getMinValue, reqVO.getMinValue())
                .eqIfPresent(IotDailyReportAttrsDO::getExtProperty, reqVO.getExtProperty())
                .eqIfPresent(IotDailyReportAttrsDO::getSort, reqVO.getSort())
                .eqIfPresent(IotDailyReportAttrsDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotDailyReportAttrsDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotDailyReportAttrsDO::getCreateTime, reqVO.getCreateTime()));
    }

}