| | |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, |
| | | (select dept_name from sys_dept where dept_id = d.parent_id) parent_name |
| | | from sys_dept d |
| | | where d.dept_id = #{deptId} |
| | | where d.dept_id = #{deptId} and del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | |
| | | <include refid="selectDeptVo"/> |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <select id="page" resultType="com.ruoyi.system.pojo.vo.SysDeptPageVO"> |
| | | select |
| | | dept_id,dept_name |
| | | from sys_dept |
| | | where |
| | | del_flag='0' |
| | | <if test="name!=null and name!='' "> |
| | | and `dept_name` like concat('%',#{name},'%') |
| | | </if> |
| | | </select> |
| | | <select id="selectDeptByName" resultType="com.ruoyi.common.core.domain.entity.SysDept"> |
| | | select dept_id from sys_dept where del_flag='0' and dept_name like #{name} |
| | | </select> |
| | | <select id="getDeptList" resultType="com.ruoyi.system.pojo.vo.SysDeptPageVO"> |
| | | select |
| | | dept_id,dept_name |
| | | from sys_dept |
| | | where |
| | | del_flag='0' |
| | | |
| | | </select> |
| | | |
| | | <insert id="insertDept" parameterType="SysDept"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | |
| | | #{deptId} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <update id="updateDeptName">update sys_dept set dept_name = #{sysDept.deptName} where dept_id = #{sysDept.deptId}</update> |
| | | |
| | | <delete id="deleteDeptById" parameterType="Long"> |
| | | update sys_dept set del_flag = '2' where dept_id = #{deptId} |
| | | </delete> |