{
	"name": "query/manager/product/product_work/order/workpost_gig/subquery_sql.json",
	"table": [
		{
			"record_type": ["schedule"],
			"table": "product_work"
		}
	],
	"parameter": {
		"production_lot": ""
	},
	"from": "product_work",
	"join_table": "product_work",
	"join_type": "FULL OUTER JOIN",
	"join_where": [
		["prwo.production_lot", "=", "prwo.production_lot"],
		"and",
		["prwo.work_phase_number", "=", "prwo.work_phase_number"]
	],
	"query": [
		["prwo.json_data.production_lot__work_ph", "starts", "production_lot"],
		"or",
		["prwo.production_lot", "starts", "production_lot"]
	],
	"select": [
		"prwo.production_lot",
		"prwo.work_phase_number",
		"prwo.json_data.production_lot__work_ph",
		"prwo.resource_id",
		"prwo.work_phase_state",
		"prwo.description",
		"prwo.json_data.start_time",
		"prwo.description",
		"prwo.json_data.start_person_id",
		"prwo.person_id",
		"prwo.production_lot",
		"prwo.work_phase_number",
		"prwo.work_phase_type",
		"prwo.produced_amount",
		"prwo.json_data.start_date",
		"prwo.json_data.start_time",
		"prwo.json_data.end_date",
		"prwo.json_data.end_time",
		"prwo.record_id"
	]
}