|
@@ -75,25 +75,28 @@ func GetReportProjectInfo(param *ReportProjectInfoParam, positionId int64) (data
|
|
// 行业 {"水利水电":["水利工程","发电工程","航运工程","其他工程"]} sql中处理成 "水利水电_水利工程"
|
|
// 行业 {"水利水电":["水利工程","发电工程","航运工程","其他工程"]} sql中处理成 "水利水电_水利工程"
|
|
tmpArr := []string{}
|
|
tmpArr := []string{}
|
|
for topIndustry, subList := range param.Industry {
|
|
for topIndustry, subList := range param.Industry {
|
|
- for i := 0; i < len(subList); i++ {
|
|
|
|
- tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
|
|
|
|
- values = append(values, fmt.Sprintf("%s_%s", topIndustry, subList[i]))
|
|
|
|
- }
|
|
|
|
if param.From == From {
|
|
if param.From == From {
|
|
tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
|
|
tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
|
|
values = append(values, topIndustry)
|
|
values = append(values, topIndustry)
|
|
|
|
+ } else {
|
|
|
|
+ for i := 0; i < len(subList); i++ {
|
|
|
|
+ tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
|
|
|
|
+ values = append(values, fmt.Sprintf("%s_%s", topIndustry, subList[i]))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
qstr = append(qstr, fmt.Sprintf("(%s)", strings.Join(tmpArr, " or ")))
|
|
qstr = append(qstr, fmt.Sprintf("(%s)", strings.Join(tmpArr, " or ")))
|
|
}
|
|
}
|
|
// 采购单位类型
|
|
// 采购单位类型
|
|
- if param.BuyerClass != nil && len(param.BuyerClass) > 0 {
|
|
|
|
- tmpArr := []string{}
|
|
|
|
- for i := 0; i < len(param.BuyerClass); i++ {
|
|
|
|
- tmpArr = append(tmpArr, "?")
|
|
|
|
- values = append(values, param.BuyerClass[i])
|
|
|
|
|
|
+ if param.From != From {
|
|
|
|
+ if param.BuyerClass != nil && len(param.BuyerClass) > 0 {
|
|
|
|
+ tmpArr := []string{}
|
|
|
|
+ for i := 0; i < len(param.BuyerClass); i++ {
|
|
|
|
+ tmpArr = append(tmpArr, "?")
|
|
|
|
+ values = append(values, param.BuyerClass[i])
|
|
|
|
+ }
|
|
|
|
+ qstr = append(qstr, fmt.Sprintf("buyerclass in (%s)", strings.Join(tmpArr, ",")))
|
|
}
|
|
}
|
|
- qstr = append(qstr, fmt.Sprintf("buyerclass in (%s)", strings.Join(tmpArr, ",")))
|
|
|
|
}
|
|
}
|
|
// 采购单位
|
|
// 采购单位
|
|
if param.Buyer != "" {
|
|
if param.Buyer != "" {
|