from db.mod_db import EsBase
index = "bigdata_ic_gsb_branch_1"

class BranchEs:
    def __init__(self, es=None):
        if es is None:
            self.esBase = EsBase()
        else:
            self.esBase = es
    def select_branch(self,company_name):
        query = {
                  "query": {
                      "bool": {
                          "must": [
                              {
                                  "term": {
                                      "company_name": company_name,
                                  }
                              }
                          ]
                      }
                  }
              }
        return self.esBase.select(index=index,body=query)
