{
	"name": "form/manager/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": "query/manager/product/product_work/actual/productivity_report/time_period.json"},
		{"run": [["map", ["productivityReportTargetDate", "data.wpa.data"]]]},
		{
			"run": [
				[
					"sort",
					[
						"data.wpa.data",
						[
							"prwo.resource_id",
							">",
							"prwo.production_lot",
							">",
							"prwo.work_phase_number",
							">",
							"target_date",
							">",
							"prwo.json_data.work_shift",
							">",
							"prwo.json_data.end_date",
							">",
							"prwo.json_data.end_time",
							">"
						]
					]
				]
			]
		},
		{"run": [["parameter.production_lot", "=", ["fieldValueToArray", ["data.wpa.data", "prwo.production_lot"]]]]},
		{"run": [["parameter.work_phase", "=", ["fieldValueToArray", ["data.wpa.data", "prwo.work_phase_number"]]]]},
		{"run": [["parameter.work_number", "=", ["map", ["parseBeforeFromArray", "parameter.production_lot", "/"]]]]},
		{"tag": "wpa_all", "query": "query/manager/product/product_work/actual/productivity_report/time_period_all.json"},
		{"run": [["map", ["productivityReportTargetDate", "data.wpa_all.data"]]]},
		{
			"tag": "wos",
			"query": "query/manager/product/product_work/order/productivity_report/selected_production_lot_phase.json"
		},
		{
			"tag": "track_time_all",
			"query": "query/manager/product/product_work/actual/productivity_report/selected_work_track_time.json"
		},
		{"tag": "rcl", "query": "query/manager/product/reclamation/productivity_report/time_period.json"},
		{"tag": "wlg", "query": "query/manager/resource/resource/resource/productivity_report.json"},
		{"tag": "wpe", "query": "query/manager/product/product_work/estimated/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": "query/manager/product/product_work/actual/productivity_report/time_period_before.json"
		},
		{
			"tag": "wpa_after",
			"query": "query/manager/product/product_work/actual/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": "query/manager/product/product_work/actual/productivity_report/time_period_after.json"
		}
	]
}
