|
@@ -392,15 +392,15 @@ func isNullSearch(scd *SieveCondition) (isNull bool) {
|
|
* count 返回数量 (-1:预览数据查询)
|
|
* count 返回数量 (-1:预览数据查询)
|
|
*/
|
|
*/
|
|
|
|
|
|
-func GetDataExportSearchResultByScdId(sim, bid mg.MongodbSim, elasticAddress, id, dataType string, checkCount int) (*[]map[string]interface{}, error) {
|
|
|
|
|
|
+func GetDataExportSearchResultByScdId(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress, id, dataType string, checkCount int) (*[]map[string]interface{}, error) {
|
|
scd := GetSqlObjFromId(sim, id)
|
|
scd := GetSqlObjFromId(sim, id)
|
|
- return GetDataExportSearchResult(bid, elasticAddress, scd, dataType, checkCount)
|
|
|
|
|
|
+ return GetDataExportSearchResult(bid, bidMgoDBName, elasticAddress, scd, dataType, checkCount)
|
|
}
|
|
}
|
|
|
|
|
|
//收藏导出
|
|
//收藏导出
|
|
var contentfilterReg = regexp.MustCompile("<[^>]+>")
|
|
var contentfilterReg = regexp.MustCompile("<[^>]+>")
|
|
|
|
|
|
-func GetDataExportSelectResult(bidding mg.MongodbSim, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
|
|
|
|
|
|
+func GetDataExportSelectResult(bidding mg.MongodbSim, biddingName string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
|
|
sess := bidding.GetMgoConn()
|
|
sess := bidding.GetMgoConn()
|
|
defer bidding.DestoryMongoConn(sess)
|
|
defer bidding.DestoryMongoConn(sess)
|
|
if checkCount == -1 {
|
|
if checkCount == -1 {
|
|
@@ -422,7 +422,7 @@ func GetDataExportSelectResult(bidding mg.MongodbSim, scd *SieveCondition, dataT
|
|
}
|
|
}
|
|
}
|
|
}
|
|
returnLsit := make([]map[string]interface{}, 0, len(queryIds))
|
|
returnLsit := make([]map[string]interface{}, 0, len(queryIds))
|
|
- iter := sess.DB("qfw_data").C("bidding").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
|
|
|
|
|
|
+ iter := sess.DB(biddingName).C("bidding").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
|
|
"$in": queryIds,
|
|
"$in": queryIds,
|
|
}}).Iter()
|
|
}}).Iter()
|
|
for m := make(map[string]interface{}); iter.Next(&m); {
|
|
for m := make(map[string]interface{}); iter.Next(&m); {
|
|
@@ -437,7 +437,7 @@ func GetDataExportSelectResult(bidding mg.MongodbSim, scd *SieveCondition, dataT
|
|
if len(returnLsit) == checkCount {
|
|
if len(returnLsit) == checkCount {
|
|
return &returnLsit, nil
|
|
return &returnLsit, nil
|
|
}
|
|
}
|
|
- iter_back := sess.DB("qfw_data").C("bidding_back").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
|
|
|
|
|
|
+ iter_back := sess.DB(biddingName).C("bidding_back").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
|
|
"$in": queryIds,
|
|
"$in": queryIds,
|
|
}}).Iter()
|
|
}}).Iter()
|
|
for m := make(map[string]interface{}); iter_back.Next(&m); {
|
|
for m := make(map[string]interface{}); iter_back.Next(&m); {
|
|
@@ -458,13 +458,13 @@ func GetDataExportSelectResult(bidding mg.MongodbSim, scd *SieveCondition, dataT
|
|
//GetDataExportSearchResult 获取数据导出内容
|
|
//GetDataExportSearchResult 获取数据导出内容
|
|
//entmg 高级字段包查询企业电话邮箱等字段
|
|
//entmg 高级字段包查询企业电话邮箱等字段
|
|
//checkCount -1 预览500条
|
|
//checkCount -1 预览500条
|
|
-func GetDataExportSearchResult(bid mg.MongodbSim, elasticAddress string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
|
|
|
|
|
|
+func GetDataExportSearchResult(bid mg.MongodbSim, bidMgoDBName, elasticAddress string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
|
|
defer qutil.Catch()
|
|
defer qutil.Catch()
|
|
if scd == nil {
|
|
if scd == nil {
|
|
return nil, errors.New("GetDataExportSearchResult-获取查询条件")
|
|
return nil, errors.New("GetDataExportSearchResult-获取查询条件")
|
|
}
|
|
}
|
|
if scd.SelectIds != nil {
|
|
if scd.SelectIds != nil {
|
|
- return GetDataExportSelectResult(bid, scd, dataType, checkCount)
|
|
|
|
|
|
+ return GetDataExportSelectResult(bid, bidMgoDBName, scd, dataType, checkCount)
|
|
}
|
|
}
|
|
//获取查询语句
|
|
//获取查询语句
|
|
qstr := getDataExportSql(scd)
|
|
qstr := getDataExportSql(scd)
|