package models
|
|
type PersonInfo struct {
|
DocumentNumber string `json:"document_number"`
|
CommunityId string `json:"community_id"`
|
OrgId string `json:"org_id"`
|
PersonName string `json:"person_name"`
|
IdCard string `json:"id_card"`
|
FrequentAddress string `json:"frequent_address"`
|
LastAppearanceTime int64 `json:"last_appearance_time"`
|
LastDirection string `json:"last_direction"`
|
LastLocation string `json:"last_location"`
|
}
|
|
func GetDomainFilters(orgIds, areaIds []interface{}) (filters []map[string]interface{}) {
|
filters = make([]map[string]interface{}, 0)
|
// 数据权限过滤
|
if len(orgIds) > 0 && len(areaIds) > 0 {
|
var authParams = map[string]interface{}{
|
"bool": map[string]interface{}{
|
"should": []interface{}{
|
map[string]interface{}{
|
"terms": map[string]interface{}{
|
"orgId": orgIds,
|
}},
|
map[string]interface{}{
|
"terms": map[string]interface{}{
|
"communityId": areaIds,
|
}},
|
},
|
},
|
}
|
filters = append(filters, authParams)
|
|
} else if len(orgIds) > 0 {
|
filters = append(filters, map[string]interface{}{
|
"terms": map[string]interface{}{
|
"orgId": orgIds,
|
},
|
})
|
} else if len(areaIds) > 0 {
|
filters = append(filters, map[string]interface{}{
|
"terms": map[string]interface{}{
|
"communityId": areaIds,
|
},
|
})
|
}
|
return filters
|
}
|