|  |  | 
 |  |  |         <if test="hisParentId != null and hisParentId != ''"> | 
 |  |  |             AND his_parent_id = #{hisParentId} | 
 |  |  |         </if> | 
 |  |  |             <if test="orgid != null and orgid != ''"> | 
 |  |  |             AND orgid = #{orgid} | 
 |  |  |         </if> | 
 |  |  |         <!-- 数据范围过滤 --> | 
 |  |  |         ${params.dataScope} | 
 |  |  |         order by d.parent_id, d.order_num | 
 |  |  |         order by d.dept_type asc, d.parent_id, d.order_num | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="selectDeptListByRoleId" resultType="Long"> | 
 |  |  | 
 |  |  |                d.email, | 
 |  |  |                d.status, | 
 |  |  |                d.his_dept_id, | 
 |  |  |                d.his_parent_id | 
 |  |  |                d.his_parent_id, | 
 |  |  |                (select dept_name from sys_dept where dept_id = d.parent_id) parent_name | 
 |  |  |         from sys_dept d | 
 |  |  |         where d.dept_id = #{deptId} | 
 |  |  | 
 |  |  |  | 
 |  |  |     <delete id="deleteDeptById" parameterType="Long"> | 
 |  |  |         update sys_dept | 
 |  |  |         set del_flag = '2' | 
 |  |  |         set del_flag = '1' | 
 |  |  |         where dept_id = #{deptId} | 
 |  |  |     </delete> | 
 |  |  |  |