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

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.asset.dal.dataobject.contract.ContractVehicleDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 合同车辆租赁订单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ContractVehicleMapper extends BaseMapperX<ContractVehicleDO> {

    default List<ContractVehicleDO> selectListByContractId(Long contractId) {
        return selectList(new LambdaQueryWrapperX<ContractVehicleDO>()
                .eq(ContractVehicleDO::getContractId, contractId)
                .orderByAsc(ContractVehicleDO::getId));
    }

    default int deleteByContractId(Long contractId) {
        return delete(new LambdaQueryWrapperX<ContractVehicleDO>()
                .eq(ContractVehicleDO::getContractId, contractId));
    }

}
