{
	"name": "query/manager/product/product_work/order/productivity_report/old/time_period_old.json",
	"table": [
		{
			"record_type": ["schedule"],
			"table": "product_work"
		}
	],
	"database": "4d",
	"parameter": {
		"end_date2": "",
		"load_group": [
				
			],
		"production_lot": [
				
			],
		"show_sql": true,
		"start_date2": "",
		"subqueryX": "SELECT record_id FROM work_order_schedule WHERE CONCAT(production_lot, CONCAT('#', work_phase)) IN (SELECT CONCAT(production_lot, CONCAT('#', work_phase_est_id)) FROM work_phase_actual WHERE date_ BETWEEN '{{start_date2}}' AND '{{end_date2}}' AND work_load_group_id IN ({{load_group}}))"
	},
	"field": [
		"prwo.production_lot",
		"prwo.work_phase_number",
		"prwo.work_phase_state",
		"prwo.failed_amount",
		"prwo.remaining_amount",
		"prwo.produced_amount"
	],
	"query": [
		["prwo.resource_id", "in", "load_group"],
		"and",
		["prwo.production_lot", "in", "production_lot"]
	],
	"queryX": [
		["prwo.record_id", "in", "subquery"]
	]
}