package cn.iocoder.yudao.module.server.dal.mysql.techorg;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.server.dal.dataobject.techorg.TechOrgDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.server.controller.admin.techorg.vo.*;

/**
 * 技术运维单位 Mapper
 *
 * @author TRS
 */
@Mapper
public interface TechOrgMapper extends BaseMapperX<TechOrgDO> {

    default PageResult<TechOrgDO> selectPage(TechOrgPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TechOrgDO>()
                .likeIfPresent(TechOrgDO::getWebsiteName, reqVO.getWebsiteName())
                .likeIfPresent(TechOrgDO::getWebsiteUrl, reqVO.getWebsiteUrl())
                .betweenIfPresent(TechOrgDO::getLaunchDate, reqVO.getLaunchDate())
                .likeIfPresent(TechOrgDO::getOwnerName, reqVO.getOwnerName())
                .eqIfPresent(TechOrgDO::getOwnerPhone, reqVO.getOwnerPhone())
                .eqIfPresent(TechOrgDO::getTechOrgId, reqVO.getTechOrgId())
                .likeIfPresent(TechOrgDO::getTechOrgName, reqVO.getTechOrgName())
                .betweenIfPresent(TechOrgDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TechOrgDO::getId));
    }

}