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

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.VehicleSoundPageReqVO;
import com.xindazhou.vehicle.dal.dataobject.sound.VehicleSoundDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * APP音效管理 Mapper
 *
 * @author xindazhou
 */
@Mapper
public interface VehicleSoundMapper extends BaseMapperX<VehicleSoundDO> {

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

}
