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

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.manufacturer.ManufacturerDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.server.controller.admin.manufacturer.vo.*;

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

    default PageResult<ManufacturerDO> selectPage(ManufacturerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ManufacturerDO>()
                .likeIfPresent(ManufacturerDO::getManufacturerName, reqVO.getManufacturerName())
                .likeIfPresent(ManufacturerDO::getServiceName, reqVO.getServiceName())
                .likeIfPresent(ManufacturerDO::getContactName, reqVO.getContactName())
                .eqIfPresent(ManufacturerDO::getContactPhone, reqVO.getContactPhone())
                .betweenIfPresent(ManufacturerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ManufacturerDO::getId));
    }

}