def METHOD_NAME(cls, emli_contact_type_code, mine_region_code=None, is_major_mine=None):
    if is_major_mine and mine_region_code:
        return cls.query.filter_by(
            emli_contact_type_code=emli_contact_type_code,
            mine_region_code=mine_region_code,
            is_major_mine=is_major_mine).filter_by(deleted_ind=False).first()
    elif mine_region_code:
        return cls.query.filter_by(
            emli_contact_type_code=emli_contact_type_code,
            mine_region_code=mine_region_code).filter_by(deleted_ind=False).first()
    return cls.query.filter_by(emli_contact_type_code=emli_contact_type_code).filter_by(
        deleted_ind=False).first()