select
distinct department_lv1 AS department
from
input_dept_info
where 1=1
${if(len(getDept)} == 0,"","and department_lv1 in ('" + getDept + "')")}
and start_time <= '${edate}' and end_time >= '${bdate}'
and is_delete = 0
order by
department_lv1_rank
試試看這個 where 条件那边是不是少了一个and?