|
|
@@ -376,6 +376,7 @@ func (r *THJWrstandard) calc() {
|
|
|
}
|
|
|
|
|
|
func (r *THJWrstandard) buildSql() string {
|
|
|
+ //取委托单中有量的商品
|
|
|
var sqlId utils.SQLVal = `
|
|
|
select
|
|
|
wr.*
|
|
|
@@ -383,7 +384,8 @@ func (r *THJWrstandard) buildSql() string {
|
|
|
where wr.wrstandardid in
|
|
|
(select distinct t.wrstandardid
|
|
|
from WR_PresaleInfo t
|
|
|
- where t.presalestatus = 2
|
|
|
+ inner join wrtrade_orderdetail od on t.sellwrtradeorderid = od.wrtradeorderid
|
|
|
+ where t.presalestatus = 2 and (od.orderqty - od.tradeqty) > 0
|
|
|
and t.marketid = 64201) and %v
|
|
|
order by wr.wrstandardname
|
|
|
`
|