|
@@ -102,21 +102,22 @@ func (e *EntClaimService) InstitutionList(userId int, appId string, page int, pa
|
|
|
return e.BaseMysql.Find(entity.TableDomainEntClaim, query, field, order, (page-1)*pageSize, pageSize), int(total)
|
|
|
}
|
|
|
|
|
|
-// GetInstitution 获取机构信息
|
|
|
-func (e EntClaimService) GetInstitution(id string) *map[string]interface{} {
|
|
|
- query := map[string]interface{}{
|
|
|
- "company_id": id,
|
|
|
+// GetCompanyByIds 批量获取经销商详细信息
|
|
|
+func (e EntClaimService) GetCompanyByIds(ids []string) *[]map[string]interface{} {
|
|
|
+ if len(ids) == 0 {
|
|
|
+ return &[]map[string]interface{}{}
|
|
|
}
|
|
|
- field := "company_name,establish_date,company_address,capital,company_phone"
|
|
|
- return e.GlobalCommonData.FindOne(entity.TableCompanyBasInfo, query, field, "")
|
|
|
+ q := "select a.company_id,a.company_name,a.establish_date,a.company_address,a.capital,a.company_phone,b.area,b.city from %v a left join %v b on a.area_code=b.code where a.company_id in (\"%v\") "
|
|
|
+ query := fmt.Sprintf(q, entity.TableCompanyBasInfo, entity.TableCodeArea, strings.Join(ids, "\" , \""))
|
|
|
+ return e.GlobalCommonData.SelectBySql(query)
|
|
|
}
|
|
|
|
|
|
-// GetInstitutionByIds GetInstitution 批量获取机构详细信息
|
|
|
+// GetInstitutionByIds 批量获取机构详细信息
|
|
|
func (e EntClaimService) GetInstitutionByIds(ids []string) *[]map[string]interface{} {
|
|
|
if len(ids) == 0 {
|
|
|
return &[]map[string]interface{}{}
|
|
|
}
|
|
|
- q := "select a.company_id,a.company_name,a.establish_date,a.company_address,a.capital,a.company_phone,b.area,b.city from %v a left join %v b on a.area_code=b.code where a.company_id in (\"%v\") "
|
|
|
- query := fmt.Sprintf(q, entity.TableCompanyBasInfo, entity.TableCodeArea, strings.Join(ids, "\" , \""))
|
|
|
- return e.GlobalCommonData.SelectBySql(query)
|
|
|
+ q := "select a.company_id,a.mi_name,a.establish_date,b.area,b.city from %v.%v a left join %v.%v b on a.area_code=b.code where a.company_id in (\"%v\") "
|
|
|
+ query := fmt.Sprintf(q, entity.DbMedical, entity.TableInstitutionBaseInfo, entity.DbGlobal, entity.TableCodeArea, strings.Join(ids, "\" , \""))
|
|
|
+ return e.Mysql.SelectBySql(query)
|
|
|
}
|