-
Goal: I really don't know how this query has syntax issue
-
Steps: I tried this, everything works:
-
SELECT
*
WHERE
(
({{ vessel_checkBox.value }} AND t_load_info.status = 63) OR
({{ hold_checkBox.value }} AND t_load_info.status = 62) OR
({{ exam_checkBox.value }} AND t_load_info.status = 60) OR
({{ examAvailable_checkBox.value }} AND t_load_info.status = 75) OR
({{ scheduled_checkBox.value }} AND t_load_info.status = 71) OR
({{ l_oldYard_checkBox.value }} AND t_load_info.status = 50) OR
({{ l_newYard_checkBox.value }} AND t_load_info.status = 51) OR
({{ l_INDYard_checkBox.value }} AND t_load_info.status = 52) OR
({{ l_lbYard_checkBox.value }} AND t_load_info.status = 53) OR
({{ l_pomonaYard_checkBox.value }} AND t_load_info.status = 83) OR
({{ l_wh_checkBox.value }} AND t_load_info.status = 59) OR
({{ m_shceduled_checkBox.value }} AND t_load_info.status = 82) OR
({{ l_process_checkBox.value }} AND t_load_info.status = 72) OR
({{ delivery_process_checkBox.value }} AND t_load_info.status = 74) OR
({{ unloading_checkBox.value }} AND t_load_info.status = 79) OR
({{ e_wh_checkBox.value }} AND t_load_info.status = 37) OR
({{ e_rtn_proces_checkBox.value }} AND t_load_info.status = 78) OR
({{ e_oldYard_checkBox.value }} AND t_load_info.status = 55) OR
({{ e_newYard_checkBox.value }} AND t_load_info.status = 54) OR
({{ e_indYard_checkBox.value }} AND t_load_info.status = 56) OR
({{ e_lbYard_checkBox.value }} AND t_load_info.status = 57) OR
({{ e_pomonaYard_checkBox.value }} AND t_load_info.status = 84) OR
({{ e_rtn_checkBox.value }} AND t_load_info.status = 38) OR
({{ Invoice_checkBox.value }} AND t_load_info.status = 80) OR
({{ chassis_paid_checkBox.value }} AND t_load_info.status = 77) OR
({{ finished_checkBox.value }} AND t_load_info.status = 35) OR
(NOT {{ vessel_checkBox.value }} AND NOT {{ hold_checkBox.value }} AND NOT {{ exam_checkBox.value }} AND NOT {{ examAvailable_checkBox.value }} AND NOT {{ scheduled_checkBox.value }} AND NOT {{ l_oldYard_checkBox.value }} AND NOT {{ l_newYard_checkBox.value }} AND NOT {{ l_INDYard_checkBox.value }} AND NOT {{ l_lbYard_checkBox.value }} AND NOT {{ l_pomonaYard_checkBox.value }} AND NOT {{ l_wh_checkBox.value }} AND NOT {{ m_shceduled_checkBox.value }} AND NOT {{ l_process_checkBox.value }} AND NOT {{ delivery_process_checkBox.value }} AND NOT {{ unloading_checkBox.value }} AND NOT {{ e_wh_checkBox.value }} AND NOT {{ e_rtn_proces_checkBox.value }} AND NOT {{ e_oldYard_checkBox.value }} AND NOT {{ e_newYard_checkBox.value }} AND NOT {{ e_indYard_checkBox.value }} AND NOT {{ e_lbYard_checkBox.value }} AND NOT {{ e_pomonaYard_checkBox.value }} AND NOT {{ Invoice_checkBox.value }} AND NOT {{ chassis_paid_checkBox.value }} AND NOT {{ finished_checkBox.value }})
)
AND ((true) OR ({{ customer_filter.value.length }} = 1 AND t_load_info.warehouse_id = 56) OR
({{ customer_filter.value.length}} > 1 AND t_load_info.warehouse_id IN (56,63)))
- Details: when I use this query, it says i have syntax issue:
- SELECT
*
WHERE
(
({{ vessel_checkBox.value }} AND t_load_info.status = 63) OR
({{ hold_checkBox.value }} AND t_load_info.status = 62) OR
({{ exam_checkBox.value }} AND t_load_info.status = 60) OR
({{ examAvailable_checkBox.value }} AND t_load_info.status = 75) OR
({{ scheduled_checkBox.value }} AND t_load_info.status = 71) OR
({{ l_oldYard_checkBox.value }} AND t_load_info.status = 50) OR
({{ l_newYard_checkBox.value }} AND t_load_info.status = 51) OR
({{ l_INDYard_checkBox.value }} AND t_load_info.status = 52) OR
({{ l_lbYard_checkBox.value }} AND t_load_info.status = 53) OR
({{ l_pomonaYard_checkBox.value }} AND t_load_info.status = 83) OR
({{ l_wh_checkBox.value }} AND t_load_info.status = 59) OR
({{ m_shceduled_checkBox.value }} AND t_load_info.status = 82) OR
({{ l_process_checkBox.value }} AND t_load_info.status = 72) OR
({{ delivery_process_checkBox.value }} AND t_load_info.status = 74) OR
({{ unloading_checkBox.value }} AND t_load_info.status = 79) OR
({{ e_wh_checkBox.value }} AND t_load_info.status = 37) OR
({{ e_rtn_proces_checkBox.value }} AND t_load_info.status = 78) OR
({{ e_oldYard_checkBox.value }} AND t_load_info.status = 55) OR
({{ e_newYard_checkBox.value }} AND t_load_info.status = 54) OR
({{ e_indYard_checkBox.value }} AND t_load_info.status = 56) OR
({{ e_lbYard_checkBox.value }} AND t_load_info.status = 57) OR
({{ e_pomonaYard_checkBox.value }} AND t_load_info.status = 84) OR
({{ e_rtn_checkBox.value }} AND t_load_info.status = 38) OR
({{ Invoice_checkBox.value }} AND t_load_info.status = 80) OR
({{ chassis_paid_checkBox.value }} AND t_load_info.status = 77) OR
({{ finished_checkBox.value }} AND t_load_info.status = 35) OR
(NOT {{ vessel_checkBox.value }} AND NOT {{ hold_checkBox.value }} AND NOT {{ exam_checkBox.value }} AND NOT {{ examAvailable_checkBox.value }} AND NOT {{ scheduled_checkBox.value }} AND NOT {{ l_oldYard_checkBox.value }} AND NOT {{ l_newYard_checkBox.value }} AND NOT {{ l_INDYard_checkBox.value }} AND NOT {{ l_lbYard_checkBox.value }} AND NOT {{ l_pomonaYard_checkBox.value }} AND NOT {{ l_wh_checkBox.value }} AND NOT {{ m_shceduled_checkBox.value }} AND NOT {{ l_process_checkBox.value }} AND NOT {{ delivery_process_checkBox.value }} AND NOT {{ unloading_checkBox.value }} AND NOT {{ e_wh_checkBox.value }} AND NOT {{ e_rtn_proces_checkBox.value }} AND NOT {{ e_oldYard_checkBox.value }} AND NOT {{ e_newYard_checkBox.value }} AND NOT {{ e_indYard_checkBox.value }} AND NOT {{ e_lbYard_checkBox.value }} AND NOT {{ e_pomonaYard_checkBox.value }} AND NOT {{ Invoice_checkBox.value }} AND NOT {{ chassis_paid_checkBox.value }} AND NOT {{ finished_checkBox.value }})
)
AND ((true) OR ({{ customer_filter.value.length }} = 1 AND t_load_info.warehouse_id = 56) OR
({{ customer_filter.value.length}} > 1 AND t_load_info.warehouse_id IN ({{ customer_filter.value.map(value => value.toString())}})))