package com.sifang.modules.customer.dao;

import com.sifang.modules.customer.entity.PowerStation;
import com.sifang.modules.sys.common.persistence.BaseDao;
import com.sifang.modules.sys.common.persistence.Parameter;
import org.springframework.stereotype.Repository;

@Repository
public class PowerStationDao extends BaseDao<PowerStation> {

    public PowerStation getPowerStationByuserId(String userId) {

        return getByHql("from PowerStation where userId =:p1 ", new Parameter(userId));
    }

    public PowerStation getPowerStationByuserPsId(String userId,String psId) {

        return getByHql("from PowerStation where userId =:p1 and psId=:p2 ", new Parameter(userId,psId));
    }

    public PowerStation getPowerStationBypsId(String psId) {

        return getByHql("from PowerStation where psId =:p1 ", new Parameter(psId));
    }

    public PowerStation getPowerStationById(String id) {

        return getByHql("from PowerStation where id =:p1 ", new Parameter(id));
    }
}
