{
  "name": "query/manager/product/product_work/actual/maintenance_last.json",
  "database": "4d",
  "parameter": {
    "show_sql": false,
    "load_group": "",
		"maintenance_work_arr": [],
		"min_dt" : 0,
		"min_date" : "2019-01-01",
		"min_time" : "12:12:12",
    "record_type": "actual"
	},
	"map_parameter": [
		[
			"maintenance_work_arr",
			"=",
			["preferenceTagValue", ["manager/maintenance.json", "work_number_arr"]]
		],
		["min_date", "=", ["dateTimeToDateString", ["min_dt"]]],
		["min_time", "=", ["dateTimeToTimeString", ["min_dt"]]]
	],
  "query": [
    ["prwo_resource_id", "=", "load_group"],
    "and",
    ["prwo_json_data_work__position_num_id", "in", "maintenance_work_arr"],
		"and",
		"after_min_dt"
	],
	"set": {
		"after_min_dt": [
			"time_check_1",
			"or",
			"time_check_2"
		],
		"time_check_1": [
			["prwo_json_data_date", "=", "min_date"],
			"and",
			["prwo_json_data_end_time", ">", "min_time"]
		],
		"time_check_2": [
			["prwo_json_data_date", ">", "min_date"]
		]
	},
	"order": [
		"prwo_json_data_date", ">", "prwo_json_data_end_time", ">"
	],
	"limit": 1, 
  "field": [
    "prwo_record_id",
    "prwo_json_data_date",
    "prwo_json_data_end_time"
  ]
}
