|
|
@@ -151,7 +151,7 @@ func (r *ErmcpExposureDetailModel) buildSql() string {
|
|
|
" t.logtype," +
|
|
|
" t.contracttype," +
|
|
|
" wc.wrstandardid," +
|
|
|
- " tmp.qty," +
|
|
|
+ " t.qty / t.convertfactor / t.convertratio as qty," +
|
|
|
" t.convertfactor," +
|
|
|
" t.convertratio," +
|
|
|
" t.qty changeQty," +
|
|
|
@@ -176,7 +176,7 @@ func (r *ErmcpExposureDetailModel) buildSql() string {
|
|
|
" left join tmp" +
|
|
|
" on t.logtype = tmp.LogType" +
|
|
|
" and t.relatedid = tmp.relatedid" +
|
|
|
- " where t.middlegoodsid=%v and t.areauserid=%v"
|
|
|
+ " where t.middlegoodsid=%v and t.areauserid=%v and t.tradedate=to_char(sysdate, 'yyyymmdd')"
|
|
|
|
|
|
return fmt.Sprintf(str, r.MiddlegoodsId, r.Areauserid)
|
|
|
}
|
|
|
@@ -293,7 +293,7 @@ type ErmcpAreaSpotDetailModel struct {
|
|
|
WrstandardId int32 `json:"-"` // 现货商品ID
|
|
|
}
|
|
|
|
|
|
-// buildSql 组建查询SQL
|
|
|
+// buildSql 组建查询SQL(只查当前日期的)
|
|
|
func (r *ErmcpAreaSpotDetailModel) buildSql() string {
|
|
|
str := "with tmp as" +
|
|
|
" (select to_char(t.hedgeplanid) relatedid," +
|
|
|
@@ -327,7 +327,8 @@ func (r *ErmcpAreaSpotDetailModel) buildSql() string {
|
|
|
" and t.areauserid = %v" +
|
|
|
" and t.wrstandardid = %v" +
|
|
|
" left join wrstandard w" +
|
|
|
- " on t.wrstandardid = w.wrstandardid"
|
|
|
+ " on t.wrstandardid = w.wrstandardid" +
|
|
|
+ " where t.tradedate=to_char(sysdate, 'yyyymmdd')"
|
|
|
|
|
|
return fmt.Sprintf(str, r.UserId, r.WrstandardId, r.UserId, r.WrstandardId, r.UserId, r.WrstandardId)
|
|
|
}
|