文件名从 src/main/resources/mybatis/system/SysDeptMapper.xml 修改 |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysDeptMapper">
|
| | |
|
| | | <resultMap type="SysDept" id="SysDeptResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysDept" id="SysDeptResult"> |
| | | <id property="deptId" column="dept_id" />
|
| | | <result property="parentId" column="parent_id" />
|
| | | <result property="ancestors" column="ancestors" />
|
| | |
| | | from sys_dept d
|
| | | </sql>
|
| | |
|
| | | <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
| | | <select id="selectDeptList" parameterType="com.ruoyi.project.system.domain.SysDept" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/>
|
| | | where d.del_flag = '0'
|
| | | <if test="deptId != null and deptId != 0">
|
| | |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
| | | </select>
|
| | |
|
| | | <insert id="insertDept" parameterType="SysDept">
|
| | | <insert id="insertDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | insert into sys_dept(
|
| | | <if test="deptId != null and deptId != 0">dept_id,</if>
|
| | | <if test="parentId != null and parentId != 0">parent_id,</if>
|
| | |
| | | )
|
| | | </insert>
|
| | |
|
| | | <update id="updateDept" parameterType="SysDept">
|
| | | <update id="updateDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | update sys_dept
|
| | | <set>
|
| | | <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|