private function getBaseSelect($storeId, $type)
{
$connection = $this->getConnection();
$select = $connection->select();
$select->from(['thesaurus' => $this->getMainTable()], [])->join(['terms' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)], 'thesaurus.thesaurus_id = terms.thesaurus_id', [])->join(['store' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)], 'store.thesaurus_id = thesaurus.thesaurus_id', [])->group(['thesaurus.thesaurus_id', 'terms.term_id'])->where("thesaurus.type = ?", $type)->where('thesaurus.is_active = 1')->where('store.store_id IN (?)', [0, $storeId]);
return $select;
}