|
|
@@ -50,6 +50,8 @@ type WrOrderQuote struct {
|
|
|
MarketId int32 `json:"-" form:"marketid"` // 市场id
|
|
|
BRANDNAME string `json:"-" form:"brandname"` // 品牌名称
|
|
|
DGITEMNAME string `json:"-" form:"dgitemname"` // 筛选项
|
|
|
+ BrandId int `json:"-" form:"brandid"` // 品牌id
|
|
|
+ YearsId int `json:"-" form:"yearsid"` // 年份id
|
|
|
}
|
|
|
|
|
|
func (r *WrOrderQuote) calc() {
|
|
|
@@ -151,7 +153,21 @@ func (r *WrOrderQuote) buildSqlFixedPrice() string {
|
|
|
if d, ok := r.ftItemName(); ok {
|
|
|
param2.AndLikes("w.wrfactortypename", d...)
|
|
|
}
|
|
|
- param2.AndEx("w.wrstandardid", r.WRSTANDARDID, r.WRSTANDARDID > 0)
|
|
|
+ //指定品类id
|
|
|
+ if r.WRSTANDARDID > 0 {
|
|
|
+ param2.AndEx("w.wrstandardid", r.WRSTANDARDID, r.WRSTANDARDID > 0)
|
|
|
+ } else {
|
|
|
+ //品牌过滤
|
|
|
+ if r.BrandId > 0 {
|
|
|
+ param2.JoinFormat(" and w.WRSTANDARDID in(select WRSTANDARDID from WRStandardFactoryItem t "+
|
|
|
+ "where dgfactoryitemtypeid = 100 and t.dgfactoryitemid=%d)", r.BrandId)
|
|
|
+ }
|
|
|
+ //年份过滤
|
|
|
+ if r.YearsId > 0 {
|
|
|
+ param2.JoinFormat(" and w.WRSTANDARDID in(select WRSTANDARDID from WRStandardFactoryItem t "+
|
|
|
+ "where dgfactoryitemtypeid = 101 and t.dgfactoryitemid=%d)", r.YearsId)
|
|
|
+ }
|
|
|
+ }
|
|
|
param2.AndEx("w.warehouseid", r.WAREHOUSEID, r.WAREHOUSEID > 0)
|
|
|
param2.AndEx("w.deliverygoodsid", r.DELIVERYGOODSID, r.DELIVERYGOODSID > 0)
|
|
|
sqlId.FormatParam(param.String(), param.String(), param2.String())
|
|
|
@@ -262,7 +278,21 @@ func (r *WrOrderQuote) buildSqlPriceMove() string {
|
|
|
if d, ok := r.ftItemName(); ok {
|
|
|
param2.AndLikes("w.wrfactortypename", d...)
|
|
|
}
|
|
|
- param2.AndEx("w.wrstandardid", r.WRSTANDARDID, r.WRSTANDARDID > 0)
|
|
|
+ //指定品类id
|
|
|
+ if r.WRSTANDARDID > 0 {
|
|
|
+ param2.AndEx("w.wrstandardid", r.WRSTANDARDID, r.WRSTANDARDID > 0)
|
|
|
+ } else {
|
|
|
+ //品牌过滤
|
|
|
+ if r.BrandId > 0 {
|
|
|
+ param2.JoinFormat(" and w.WRSTANDARDID in(select WRSTANDARDID from WRStandardFactoryItem t "+
|
|
|
+ "where dgfactoryitemtypeid = 100 and t.dgfactoryitemid=%d)", r.BrandId)
|
|
|
+ }
|
|
|
+ //年份过滤
|
|
|
+ if r.YearsId > 0 {
|
|
|
+ param2.JoinFormat(" and w.WRSTANDARDID in(select WRSTANDARDID from WRStandardFactoryItem t "+
|
|
|
+ "where dgfactoryitemtypeid = 101 and t.dgfactoryitemid=%d)", r.YearsId)
|
|
|
+ }
|
|
|
+ }
|
|
|
param2.AndEx("w.warehouseid", r.WAREHOUSEID, r.WAREHOUSEID > 0)
|
|
|
param2.AndEx("w.deliverygoodsid", r.DELIVERYGOODSID, r.DELIVERYGOODSID > 0)
|
|
|
sqlId.FormatParam(param.String(), param.String(), param2.String())
|