{
  "name": "query/manager/product/product_work/actual/maintenance_split.json",
  "database": "4d",
	"parameter": {
		"days_before": 10,
		"maintenance_work_not_in_use": ["16279", "16280", "16281"],
		"maintenance_work": [],
		"record_type": "actual"
	},
	"map_parameter": [
		["maintenance_work", "=", ["preferenceTagValue", ["manager/maintenance.json", "work_number_arr"]]],
		["days_before", "=", ["preferenceTagValue", ["manager/maintenance.json", "days_to_split_before"]]],
		["days_before_negative", "=", ["-", ["days_before"]]],
		["last_date", "=", ["daysToCurrentDateStringAdd", ["days_before_negative"]]]
	],
	"query": [
		["wpa_start_date", ">=", "last_date"], 
		"and", 
		["wpa_work__position_num_id", "in", "maintenance_work"]
	],
	"order": [
		"wpa_start_date", "<", "wpa_start_time", "<"
	],
	"field": [
    "wpa_start_date",
    "wpa_start_time",
    "wpa_date_",
    "wpa_end_time",
    "wpa_start_shift_number",
    "wpa_shift_number",
    "wpa_work_load_group_id",
    "wpa_production_lot",
    "wpa_work_phase_est_id",
    "wpa_type_",
    "wpa_subtype",
    "wpa_start_employee_id",
    "wpa_program_id",
    "wpa_additional_data",
    "wpa_info",
    "wpa_record_id",
    "wpa_change_id",
    "wpa_work_time__amount",
    "wpa_social_cost_multiplier",
    "wpa_work_description",
    "wpa_profit_multiplier",
    "wpa_setup_salary__hour",
    "wpa_salary__hour",
    "wpa_machine_setup_cost__hour",
    "wpa_machine_work_cost__hour",
    "wpa_salary_bonus",
    "wpa_work__position_num_id",
    "wpa_start_subtype",
    "wpa_machine_hours",
    "wpa_setup_time__amount",
    "wpa_target_machine_time",
    "wpa_target_time",
    "wpa_track_time",
    "wpa_employee_id"
	],

	"queryxxx": [
		["prwo_json_data_date", ">=", "last_date"], 
		"and", 
		["prwo_json_data_work__position_num_id", "in", "maintenance_work"]
	],
	"orderxxx": [
		"prwo_json_data_date", "<", "prwo_json_data_end_time", "<"
	],
	"fieldxxx": [
		"prwo_json_data_work__position_num_id",
    "prwo_record_id",
		"prwo_resource_id",
		"prwo_json_data_date"
	],
	"fieldxxx": [
    "prwo_record_id",
		"prwo_resource_id",
		"prwo_person_id",
		"prwo_json_data_work__position_num_id",
    "prwo_production_lot",
		"prwo_work_phase_number",
		"prwo_json_data_start_date",
		"prwo_json_data_start_time",
		"prwo_json_data_date",
		"prwo_json_data_end_time",
		"prwo_work_phase_number",
		"prwo_json_data_hourly_salary",
		"prwo_info",
		"prwo_machine_hours",
		"prwo_setup_hourly_self_cost",
		"prwo_work_hourly_self_cost", 
		"prwo_produced_amount",
		"prwo_profit_multiplier",
		"prwo_work_hourly_salary",
		"prwo_json_data_start_work_shift",
		"prwo_json_data_work_shift",
		"prwo_json_data_social_cost_multiplier",
		"prwo_json_data_start_person_id",
		"prwo_json_data_start_subtype",
		"prwo_json_data_subtype",
		"prwo_started_amount",
		"prwo_work_phase_type",
		"prwo_cost_price",
		"prwo_description",
		"prwo_salary",
		"prwo_sales_price",
		"prwo_work_hours_per_amout"
	]
}
