select * from table
<where>
<if test="deptId != null ">
and dept_id = #{deptId}
</if>
</where>
////////////
SELEC * FROM table
<if test="type == 1">
and case_break_discipline is not null and case_break_discipline!=''
</if>
select * from table
<where>
<if test="deptId != null ">
and dept_id = #{deptId}
</if>
</where>
////////////
SELEC * FROM table
<if test="type == 1">
and case_break_discipline is not null and case_break_discipline!=''
</if>