|
|
@@ -1036,8 +1036,13 @@ func (r *QhjReckonPriceLog) buildSql() string {
|
|
|
" LEFT JOIN GOODS g on t.goodsid=g.goodsid" +
|
|
|
" INNER JOIN MARKET m on g.marketid=g.marketid" +
|
|
|
" WHERE 1 = 1 and m.marketid=69201"
|
|
|
- sqlId.AndEx("t.TRADEDATE", r.TRADEDATE, len(r.TRADEDATE) > 0)
|
|
|
sqlId.AndEx("t.GOODSID", r.GOODSID, r.GOODSID > 0)
|
|
|
+ if r.TRADEDATE != "" {
|
|
|
+ sqlId.AndEx("t.TRADEDATE", r.TRADEDATE, len(r.TRADEDATE) > 0)
|
|
|
+ } else {
|
|
|
+ sqlId.JoinFormat(" and t.TRADEDATE = (select max(TRADEDATE) from RECKON_PRICELOG)")
|
|
|
+ }
|
|
|
+
|
|
|
return sqlId.String()
|
|
|
}
|
|
|
|