package com.gzzm.lobster.config;

import net.cyan.thunwind.annotation.OQL;
import net.cyan.thunwind.dao.GeneralDao;

public abstract class AgentProfileDao extends GeneralDao {

    @OQL("select a from AgentProfile a where a.agentId=:1")
    public abstract AgentProfile getAgent(String agentId) throws Exception;

    @OQL("select a from AgentProfile a where a.enabled=1 and (a.orgId=?1 or a.orgId is null) order by a.orgId desc limit 0,1")
    public abstract AgentProfile getDefaultByOrg(String orgId) throws Exception;
}
