Browse Source

情报返回数据处理

WH01243 1 year ago
parent
commit
55b91927d9
1 changed files with 6 additions and 6 deletions
  1. 6 6
      api/internal/service/employService.go

+ 6 - 6
api/internal/service/employService.go

@@ -670,19 +670,19 @@ func employInfoPerson(table, employKey, findKey string, in *types.InfoEmployinfo
 	wuyeData1 := &[]map[string]interface{}{}
 	wuyeData2 := &[]map[string]interface{}{}
 	if len(infoId1Arr) > 0 {
-		infoData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select   %s, is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')    GROUP BY %s ,type  order  by type", employKey, table, employKey, strings.Join(infoId1Arr, "','"), employKey), in.PositionId)
+		infoData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select   %s, is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')    GROUP BY %s ,type  order  by type desc", employKey, table, employKey, strings.Join(infoId1Arr, "','"), employKey), in.PositionId)
 	}
 	if len(infoId2Arr) > 0 {
-		infoData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  %s,  is_ignore,status,id,type from  %s   where position_id =? and  %s in '%s')    GROUP BY %s ,type order  by type ", employKey, table, employKey, strings.Join(infoId2Arr, "','"), employKey), in.PositionId)
+		infoData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  %s,  is_ignore,status,id,type from  %s   where position_id =? and  %s in '%s')    GROUP BY %s ,type order  by type desc", employKey, table, employKey, strings.Join(infoId2Arr, "','"), employKey), in.PositionId)
 	}
 	if len(niJianIdArr) > 0 {
-		niJianData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s,   is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')    GROUP BY %s  ,type order  by type", employKey, table, employKey, strings.Join(niJianIdArr, "','"), employKey), in.PositionId)
+		niJianData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s,   is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')    GROUP BY %s  ,type order  by type desc", employKey, table, employKey, strings.Join(niJianIdArr, "','"), employKey), in.PositionId)
 	}
 	if len(wuye1Arr) > 0 {
-		wuyeData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  %s,  is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')  GROUP BY %s  ,type order  by type", employKey, table, employKey, strings.Join(wuye1Arr, "','"), employKey), in.PositionId)
+		wuyeData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  %s,  is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')  GROUP BY %s  ,type order  by type desc", employKey, table, employKey, strings.Join(wuye1Arr, "','"), employKey), in.PositionId)
 	}
 	if len(wuye2Arr) > 0 {
-		wuyeData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select   %s, is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')    GROUP BY %s ,type order  by type ", employKey, table, employKey, strings.Join(wuye2Arr, "','"), employKey), in.PositionId)
+		wuyeData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select   %s, is_ignore,status,id,type from  %s   where position_id =? and  %s in ('%s')    GROUP BY %s ,type order  by type desc", employKey, table, employKey, strings.Join(wuye2Arr, "','"), employKey), in.PositionId)
 	}
 	for _, v := range *infoData1 {
 		valueMap := map[string]interface{}{
@@ -802,7 +802,7 @@ func employInfoEnt(table, employKey, findKey, depIDArr string, in *types.InfoEmp
 		wuyeData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s,  id,is_ignore,status ,type  from  %s   where %s in ('%s')  and status =1 and  source=? and    ent_dept_id in  (%s)  GROUP BY %s  ,type order  by type", employKey, table, employKey, strings.Join(wuye1Arr, "','"), depIDArr, employKey), 1)
 	}
 	if len(wuye2Arr) > 0 {
-		wuyeData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s id,is_ignore,status ,type  from  %s   where %s  in ('%s')  and status =1 and  source=? and    ent_dept_id in  (%s) GROUP BY %s ,type order  by type", employKey, table, employKey, strings.Join(wuye2Arr, "','"), depIDArr, employKey), 2)
+		wuyeData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s, id,is_ignore,status ,type  from  %s   where %s  in ('%s')  and status =1 and  source=? and    ent_dept_id in  (%s) GROUP BY %s ,type order  by type", employKey, table, employKey, strings.Join(wuye2Arr, "','"), depIDArr, employKey), 2)
 	}
 	for _, v := range *infoData1 {
 		valueMap := map[string]interface{}{