|
@@ -1098,7 +1098,17 @@ func (r *Ermcp8HedgeditemReport) buildReportSql() string {
|
|
|
WHERE (t.TRADEUSERID = %v OR t.AREAUSERID = %v)
|
|
WHERE (t.TRADEUSERID = %v OR t.AREAUSERID = %v)
|
|
|
`
|
|
`
|
|
|
sqlId.FormatParam(r.USERID, r.USERID)
|
|
sqlId.FormatParam(r.USERID, r.USERID)
|
|
|
- sqlId.And("t.CYCLETIME", r.CYCLETIME)
|
|
|
|
|
|
|
+ // 过滤周期类型
|
|
|
|
|
+ if r.CYCLETYPE == 1 {
|
|
|
|
|
+ // 月
|
|
|
|
|
+ sqlId.And("t.cycletype", 1)
|
|
|
|
|
+ sqlId.And("t.CYCLETIME", r.CYCLETIME)
|
|
|
|
|
+ } else if r.CYCLETYPE == 4 {
|
|
|
|
|
+ // 周
|
|
|
|
|
+ // 获取查询日期的当前周
|
|
|
|
|
+ sqlId.And("t.cycletype", 4)
|
|
|
|
|
+ sqlId.And("t.CYCLETIME", mtpcache.GetWeekIW(r.CYCLETIME))
|
|
|
|
|
+ }
|
|
|
sqlId.AndEx("t.HEDGEDTYPE", r.HEDGEDTYPE, r.HEDGEDTYPE > 0)
|
|
sqlId.AndEx("t.HEDGEDTYPE", r.HEDGEDTYPE, r.HEDGEDTYPE > 0)
|
|
|
sqlId.AndEx("t.HEDGEDITEMSTATUS", r.HEDGEDITEMSTATUS, r.HEDGEDITEMSTATUS > 0)
|
|
sqlId.AndEx("t.HEDGEDITEMSTATUS", r.HEDGEDITEMSTATUS, r.HEDGEDITEMSTATUS > 0)
|
|
|
sqlId.AndLike("t.HEDGEDITEMNUM", r.HEDGEDITEMNUM)
|
|
sqlId.AndLike("t.HEDGEDITEMNUM", r.HEDGEDITEMNUM)
|