|
@@ -6,6 +6,7 @@ import (
|
|
|
"mtp2_if/db"
|
|
"mtp2_if/db"
|
|
|
"mtp2_if/mtpcache"
|
|
"mtp2_if/mtpcache"
|
|
|
"mtp2_if/utils"
|
|
"mtp2_if/utils"
|
|
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
"strings"
|
|
|
"time"
|
|
"time"
|
|
|
)
|
|
)
|
|
@@ -749,30 +750,76 @@ func (r *SellOrder) buildQueryDiamond() string {
|
|
|
sqlId.AndEx("q.WAREHOUSEID", r.WAREHOUSEID, r.WAREHOUSEID > 0)
|
|
sqlId.AndEx("q.WAREHOUSEID", r.WAREHOUSEID, r.WAREHOUSEID > 0)
|
|
|
utils.AndBetween(&sqlId, "q.WEIGHT", r.WEIGHT, r.WEIGHT_END)
|
|
utils.AndBetween(&sqlId, "q.WEIGHT", r.WEIGHT, r.WEIGHT_END)
|
|
|
utils.AndBetween(&sqlId, "q.WEIGHTAVG", r.WEIGHTAVG, r.WEIGHTAVG_END)
|
|
utils.AndBetween(&sqlId, "q.WEIGHTAVG", r.WEIGHTAVG, r.WEIGHTAVG_END)
|
|
|
- sqlId.AndLikes("q.ZSSHAPETYPE", r.ZSSHAPETYPE...)
|
|
|
|
|
- for _, t := range r.ZSCOLORTYPE {
|
|
|
|
|
- sqlId.LessOrEq("q.ZSCOLORTYPE1", t)
|
|
|
|
|
- sqlId.BiggerOrEq("q.ZSCOLORTYPE2", t)
|
|
|
|
|
- }
|
|
|
|
|
- for _, t := range r.ZSCLARITYTYPE {
|
|
|
|
|
- sqlId.LessOrEq("q.ZSCLARITYTYPE1", t)
|
|
|
|
|
- sqlId.BiggerOrEq("q.ZSCLARITYTYPE2", t)
|
|
|
|
|
- }
|
|
|
|
|
- for _, t := range r.ZSCUTTYPE {
|
|
|
|
|
- sqlId.LessOrEq("q.ZSCUTTYPE1", t)
|
|
|
|
|
- sqlId.BiggerOrEq("q.ZSCUTTYPE2", t)
|
|
|
|
|
- }
|
|
|
|
|
- for _, t := range r.ZSSYMMETRYTYPE {
|
|
|
|
|
- sqlId.LessOrEq("q.ZSSYMMETRYTYPE1", t)
|
|
|
|
|
- sqlId.BiggerOrEq("q.ZSSYMMETRYTYPE2", t)
|
|
|
|
|
- }
|
|
|
|
|
- for _, t := range r.ZSPOLISHTYPE {
|
|
|
|
|
- sqlId.LessOrEq("q.ZSPOLISHTYPE1", t)
|
|
|
|
|
- sqlId.BiggerOrEq("q.ZSPOLISHTYPE2", t)
|
|
|
|
|
- }
|
|
|
|
|
- for _, t := range r.ZSFLUORESCENCETYPE {
|
|
|
|
|
- sqlId.LessOrEq("q.ZSFLUORESCENCETYPE1", t)
|
|
|
|
|
- sqlId.BiggerOrEq("q.ZSFLUORESCENCETYPE2", t)
|
|
|
|
|
|
|
+ zsshapetype := make([]string, 0)
|
|
|
|
|
+ for _, item := range r.ZSSHAPETYPE {
|
|
|
|
|
+ zsshapetype = append(zsshapetype, fmt.Sprintf(",%v,", item))
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlId.OrLikes("q.ZSSHAPETYPE", zsshapetype...)
|
|
|
|
|
+ // for _, t := range r.ZSCOLORTYPE {
|
|
|
|
|
+ // sqlId.LessOrEq("q.ZSCOLORTYPE1", t)
|
|
|
|
|
+ // sqlId.BiggerOrEq("q.ZSCOLORTYPE2", t)
|
|
|
|
|
+ // }
|
|
|
|
|
+ if len(r.ZSCOLORTYPE) > 0 {
|
|
|
|
|
+ zscolortype := make([]string, 0)
|
|
|
|
|
+ for _, item := range r.ZSCOLORTYPE {
|
|
|
|
|
+ zscolortype = append(zscolortype, strconv.Itoa(int(item)))
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlId.JoinFormat(" AND q.ZSCOLORTYPE1 IN (%v)", strings.Join(zscolortype, ","))
|
|
|
|
|
+ }
|
|
|
|
|
+ // for _, t := range r.ZSCLARITYTYPE {
|
|
|
|
|
+ // sqlId.LessOrEq("q.ZSCLARITYTYPE1", t)
|
|
|
|
|
+ // sqlId.BiggerOrEq("q.ZSCLARITYTYPE2", t)
|
|
|
|
|
+ // }
|
|
|
|
|
+ if len(r.ZSCLARITYTYPE) > 0 {
|
|
|
|
|
+ zsclaritytype := make([]string, 0)
|
|
|
|
|
+ for _, item := range r.ZSCLARITYTYPE {
|
|
|
|
|
+ zsclaritytype = append(zsclaritytype, strconv.Itoa(int(item)))
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlId.JoinFormat(" AND q.ZSCLARITYTYPE1 IN (%v)", strings.Join(zsclaritytype, ","))
|
|
|
|
|
+ }
|
|
|
|
|
+ // for _, t := range r.ZSCUTTYPE {
|
|
|
|
|
+ // sqlId.LessOrEq("q.ZSCUTTYPE1", t)
|
|
|
|
|
+ // sqlId.BiggerOrEq("q.ZSCUTTYPE2", t)
|
|
|
|
|
+ // }
|
|
|
|
|
+ if len(r.ZSCUTTYPE) > 0 {
|
|
|
|
|
+ zscuttype := make([]string, 0)
|
|
|
|
|
+ for _, item := range r.ZSCUTTYPE {
|
|
|
|
|
+ zscuttype = append(zscuttype, strconv.Itoa(int(item)))
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlId.JoinFormat(" AND q.ZSCUTTYPE1 IN (%v)", strings.Join(zscuttype, ","))
|
|
|
|
|
+ }
|
|
|
|
|
+ // for _, t := range r.ZSSYMMETRYTYPE {
|
|
|
|
|
+ // sqlId.LessOrEq("q.ZSSYMMETRYTYPE1", t)
|
|
|
|
|
+ // sqlId.BiggerOrEq("q.ZSSYMMETRYTYPE2", t)
|
|
|
|
|
+ // }
|
|
|
|
|
+ if len(r.ZSSYMMETRYTYPE) > 0 {
|
|
|
|
|
+ zssymmetrytype := make([]string, 0)
|
|
|
|
|
+ for _, item := range r.ZSSYMMETRYTYPE {
|
|
|
|
|
+ zssymmetrytype = append(zssymmetrytype, strconv.Itoa(int(item)))
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlId.JoinFormat(" AND q.ZSSYMMETRYTYPE1 IN (%v)", strings.Join(zssymmetrytype, ","))
|
|
|
|
|
+ }
|
|
|
|
|
+ // for _, t := range r.ZSPOLISHTYPE {
|
|
|
|
|
+ // sqlId.LessOrEq("q.ZSPOLISHTYPE1", t)
|
|
|
|
|
+ // sqlId.BiggerOrEq("q.ZSPOLISHTYPE2", t)
|
|
|
|
|
+ // }
|
|
|
|
|
+ if len(r.ZSPOLISHTYPE) > 0 {
|
|
|
|
|
+ zspolishtype := make([]string, 0)
|
|
|
|
|
+ for _, item := range r.ZSPOLISHTYPE {
|
|
|
|
|
+ zspolishtype = append(zspolishtype, strconv.Itoa(int(item)))
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlId.JoinFormat(" AND q.ZSPOLISHTYPE1 IN (%v)", strings.Join(zspolishtype, ","))
|
|
|
|
|
+ }
|
|
|
|
|
+ // for _, t := range r.ZSFLUORESCENCETYPE {
|
|
|
|
|
+ // sqlId.LessOrEq("q.ZSFLUORESCENCETYPE1", t)
|
|
|
|
|
+ // sqlId.BiggerOrEq("q.ZSFLUORESCENCETYPE2", t)
|
|
|
|
|
+ // }
|
|
|
|
|
+ if len(r.ZSFLUORESCENCETYPE) > 0 {
|
|
|
|
|
+ zsfluorescencetype := make([]string, 0)
|
|
|
|
|
+ for _, item := range r.ZSFLUORESCENCETYPE {
|
|
|
|
|
+ zsfluorescencetype = append(zsfluorescencetype, strconv.Itoa(int(item)))
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlId.JoinFormat(" AND q.ZSFLUORESCENCETYPE1 IN (%v)", strings.Join(zsfluorescencetype, ","))
|
|
|
}
|
|
}
|
|
|
if len(r.ZSCERTTYPE) > 0 {
|
|
if len(r.ZSCERTTYPE) > 0 {
|
|
|
sqlId.JoinFormat(" AND q.ZSCERTTYPE IN (%v)", strings.Join(r.ZSCERTTYPE, ","))
|
|
sqlId.JoinFormat(" AND q.ZSCERTTYPE IN (%v)", strings.Join(r.ZSCERTTYPE, ","))
|