package com.bocloud.ims.repository.resource.hmc;

import com.bocloud.common.utils.MapTools;
import com.bocloud.database.core.intf.impl.JdbcGenericDao;
import com.bocloud.ims.entity.resource.hmc.HmcShareEthernetAdapter;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Deprecated
@Component
public class HmcShareEthernetAdapterRepository extends JdbcGenericDao<HmcShareEthernetAdapter, Long> {

    public HmcShareEthernetAdapterRepository(JdbcTemplate jdbcTemplate, NamedParameterJdbcTemplate npJdbcTemplate) {
        super(jdbcTemplate, npJdbcTemplate);
    }

    public List<HmcShareEthernetAdapter> listByPartition(Long partitionId) {
        String sql = "select a.* from hmc_share_ethernet_adapter a where a.partition_id = :partitionId and a.is_deleted = 0 ";
        Map<String, Object> param = MapTools.simpleMap("partitionId", partitionId);
        return this.list(HmcShareEthernetAdapter.class, sql, param);
    }
}
