添加与编辑重复校验
检查部门名称是否重复
int checkNameExist(Department department);
<select id="checkNameExist" resultType="java.lang.Integer">
SELECT count(depart_id)
FROM department
<where>
is_deleted = 0
<if test="departId !=null and departId !=''">
AND depart_id != #{departId}
</if>
AND depart_name = #{departName}
</where>
</select>