package cn.iocoder.yudao.module.energy.dal.mysql.account;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.energy.dal.dataobject.account.EnergyProjectAccountDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface EnergyProjectAccountMapper extends BaseMapperX<EnergyProjectAccountDO> {

    default EnergyProjectAccountDO selectByContractId(Long contractId) {
        return selectOne(EnergyProjectAccountDO::getContractId, contractId);
    }

    default List<EnergyProjectAccountDO> selectListByAccountId(Long accountId) {
        return selectList(new LambdaQueryWrapperX<EnergyProjectAccountDO>()
                .eq(EnergyProjectAccountDO::getAccountId, accountId));
    }

}
