const system=require("../../system");
const Dao=require("../dao.base");
class EjobapplyDao extends Dao{
  constructor(){
    super(Dao.getModelName(EjobapplyDao));
  }

  async findAccountIds(ecompanyId, ejobId) {
    var result = [];
    if(!ecompanyId && !ejobId) {
      return result;
    }
    var sql = "SELECT usereaccount_id FROM c_ejob_apply WHERE 1 = 1  ";
    if(ecompanyId) {
      sql = sql + " AND ecompany_id = " + Number(ecompanyId);
    }
    if(ejobId) {
      sql = sql + " AND ejob_id = " + Number(ejobId);
    }

    var list = await this.customQuery(sql);
    if(!list || list.length == 0) {
      return result;
    }

    for(var item of list) {
      result.push(item.usereaccount_id);
    }
    return result;
  }
}
module.exports=EjobapplyDao;
