{
  "name": "dialog/productivity_report/query.json",
  "database": "4d",
  "info": "result cache query: rc/productivity_report/query_develop",
  "run": [
    ["parameter.start_date2", "=", ["daysAdd", ["parameter.start_date", -1]]],
    ["parameter.start_date_all", "=", ["ymdAdd", ["parameter.start_date", -1, 0, 0]]],
    ["parameter.end_date2", "=", ["daysAdd", ["parameter.end_date", 1]]],
    ["data.capacity", "=", ["capacity.shiftArr", ["parameter.load_group", "parameter.start_date2", "parameter.end_date2","shift_limit_arr"]]]
  ],
  "data_query": [
    {"tag": "wpa", "query": "wpa/productivity_report/time_period.json"},
    {"run": [["map", ["productivityReportTargetDate", "data.wpa.data"]]]},
    {"run": [["sort", ["data.wpa.data", ["wpa_work_load_group_id", ">", "wpa_production_lot", ">", "wpa_work_phase_est_id", ">", "target_date", ">", "wpa_shift_number", ">", "wpa_date_", ">", "wpa_end_time", ">"]]]]},
    {"run": [["parameter.production_lot", "=", ["fieldValueToArray", ["data.wpa.data", "wpa_production_lot"]]]]},
    {"run": [["parameter.work_phase", "=", ["fieldValueToArray", ["data.wpa.data", "wpa_work_phase_est_id"]]]]},
    {"run": [["parameter.work_number", "=", ["map", ["parseBeforeFromArray", "parameter.production_lot", "/"]]]]},
    {"tag": "wpa_all", "query": "wpa/productivity_report/time_period_all.json"},
    {"run": [["map", ["productivityReportTargetDate", "data.wpa_all.data"]]]},
    {"tag": "wos", "query": "wos/productivity_report/selected_production_lot_phase.json"},
    {"tag": "track_time_all", "query": "wpa/productivity_report/selected_work_track_time.json"},
    {"tag": "rcl", "query": "rcl/productivity_report/time_period.json"},
    {"tag": "wlg", "query": "wlg/productivity_report.json"},
    {"tag": "wpe", "query": "wpe/productivity_report/time_period.json"},
    {"run": [["data", "=", ["map", ["productivityReportWpa", "data"]]]]}
  ],
  "data_query_new": [
    {"run": [["showSql", [true]]]},
    {"run": [["showSql", [false]]]}
  ],
  "data_queryXXX": [
    {"tag": "wpa_before", "query": "wpa/productivity_report/time_period_before.json"},
    {"tag": "wpa_after", "query": "wpa/productivity_report/time_period_after.json"},
    {"run": [["showSql", [false]]]},
    {"tag": "track_time", "query": "wpa/productivity_report/track_time_time_period.json"},
    {"run": [["data.wpa_before", "=", null]]},
    {"run": [["data.wpa_after", "=", null]]},
    {"tag": "wpa_after", "query": "wpa/productivity_report/time_period_after.json"}
  ]
}
