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

import java.util.List;

/**
 * 合同被授权人 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ContractAuthorizedMapper extends BaseMapperX<ContractAuthorizedDO> {

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

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

}
