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

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

import java.util.List;

/**
 * 项目任务扩展属性 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotProjectTaskAttrsMapper extends BaseMapperX<IotProjectTaskAttrsDO> {

    default PageResult<IotProjectTaskAttrsDO> selectPage(IotProjectTaskAttrsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotProjectTaskAttrsDO>()
                .eqIfPresent(IotProjectTaskAttrsDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(IotProjectTaskAttrsDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotProjectTaskAttrsDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(IotProjectTaskAttrsDO::getProjectClassification, reqVO.getProjectClassification())
                .eqIfPresent(IotProjectTaskAttrsDO::getWellType, reqVO.getWellType())
                .eqIfPresent(IotProjectTaskAttrsDO::getWellCategory, reqVO.getWellCategory())
                .eqIfPresent(IotProjectTaskAttrsDO::getTechnique, reqVO.getTechnique())
                .likeIfPresent(IotProjectTaskAttrsDO::getName, reqVO.getName())
                .eqIfPresent(IotProjectTaskAttrsDO::getIdentifier, reqVO.getIdentifier())
                .eqIfPresent(IotProjectTaskAttrsDO::getExtProperty, reqVO.getExtProperty())
                .eqIfPresent(IotProjectTaskAttrsDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotProjectTaskAttrsDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotProjectTaskAttrsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotProjectTaskAttrsDO::getId));
    }

    default List<IotProjectTaskAttrsDO> selectList(IotProjectTaskAttrsPageReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<IotProjectTaskAttrsDO>()
                .eqIfPresent(IotProjectTaskAttrsDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(IotProjectTaskAttrsDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotProjectTaskAttrsDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(IotProjectTaskAttrsDO::getProjectClassification, reqVO.getProjectClassification())
                .eqIfPresent(IotProjectTaskAttrsDO::getWellType, reqVO.getWellType())
                .eqIfPresent(IotProjectTaskAttrsDO::getWellCategory, reqVO.getWellCategory())
                .eqIfPresent(IotProjectTaskAttrsDO::getTechnique, reqVO.getTechnique())
                .likeIfPresent(IotProjectTaskAttrsDO::getName, reqVO.getName())
                .eqIfPresent(IotProjectTaskAttrsDO::getIdentifier, reqVO.getIdentifier())
                .eqIfPresent(IotProjectTaskAttrsDO::getExtProperty, reqVO.getExtProperty())
                .eqIfPresent(IotProjectTaskAttrsDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotProjectTaskAttrsDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotProjectTaskAttrsDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(IotProjectTaskAttrsDO::getSort));
    }

}