package cn.iocoder.yudao.module.asset.dal.mysql.station;

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.asset.controller.admin.station.vo.HydrogenStationPageReqVO;
import cn.iocoder.yudao.module.asset.dal.dataobject.station.HydrogenStationDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 加氢站 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface HydrogenStationMapper extends BaseMapperX<HydrogenStationDO> {

    default PageResult<HydrogenStationDO> selectPage(HydrogenStationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HydrogenStationDO>()
                .likeIfPresent(HydrogenStationDO::getName, reqVO.getName())
                .likeIfPresent(HydrogenStationDO::getStationNo, reqVO.getStationNo())
                .likeIfPresent(HydrogenStationDO::getCity, reqVO.getCity())
                .eqIfPresent(HydrogenStationDO::getCooperationType, reqVO.getCooperationType())
                .eqIfPresent(HydrogenStationDO::getStationStatus, reqVO.getStationStatus())
                .betweenIfPresent(HydrogenStationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HydrogenStationDO::getId));
    }

    default List<HydrogenStationDO> selectSimpleList() {
        return selectList();
    }

}
