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.ContractVehicleServiceDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 合同车辆服务项目 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ContractVehicleServiceMapper extends BaseMapperX<ContractVehicleServiceDO> {

    default List<ContractVehicleServiceDO> selectListByContractVehicleId(Long contractVehicleId) {
        return selectList(new LambdaQueryWrapperX<ContractVehicleServiceDO>()
                .eq(ContractVehicleServiceDO::getContractVehicleId, contractVehicleId)
                .orderByAsc(ContractVehicleServiceDO::getId));
    }

    default int deleteByContractVehicleId(Long contractVehicleId) {
        return delete(new LambdaQueryWrapperX<ContractVehicleServiceDO>()
                .eq(ContractVehicleServiceDO::getContractVehicleId, contractVehicleId));
    }

    default int deleteByContractVehicleIds(List<Long> contractVehicleIds) {
        return delete(new LambdaQueryWrapperX<ContractVehicleServiceDO>()
                .in(ContractVehicleServiceDO::getContractVehicleId, contractVehicleIds));
    }

}
