where中使用 (字段名=条件 or 条件="")
请注意此部分(state = "{1}" or "{1}"="")、(applicant_id = "{2}" or "{2}"="")
当 "{0}"=""时,自动不作为查询条件,后同。
select
*
from leave_application
where (content like "%{0}%" or "{0}"="") and (state = "{1}" or "{1}"="") and (applicant_id = "{2}" or "{2}"="")