package com.xindazhou.vehicle.dal.mysql.auth;

import com.xindazhou.framework.common.pojo.PageResult;
import com.xindazhou.framework.mybatis.core.mapper.BaseMapperX;
import com.xindazhou.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.xindazhou.vehicle.controller.admin.vehicle.vo.VehicleAuthPageReqVO;
import com.xindazhou.vehicle.dal.dataobject.auth.VehicleAuthDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 车辆授权设置 Mapper
 *
 * @author xindazhou
 */
@Mapper
public interface VehicleAuthMapper extends BaseMapperX<VehicleAuthDO> {

    default PageResult<VehicleAuthDO> selectPage(VehicleAuthPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<VehicleAuthDO>()
                .eqIfPresent(VehicleAuthDO::getModel, reqVO.getModel())
                .betweenIfPresent(VehicleAuthDO::getUpdateTime, reqVO.getUpdateTime())
                .orderByDesc(VehicleAuthDO::getId));
    }

}
