liusheng
2024-09-18 722fa40345f1fc650eaeae4a721c3ae4106d92a8
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -21,6 +21,7 @@
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="deptCode" column="dept_code"/>
        <result property="deptType" column="dept_type"/>
    </resultMap>
    <sql id="selectDeptVo">
@@ -32,6 +33,7 @@
               d.order_num,
               d.leader,
               d.phone,
               d.dept_type,
               d.email,
               d.status,
               d.del_flag,
@@ -58,6 +60,9 @@
        <if test="deptCode != null and deptCode != ''">
            AND dept_code = #{deptCode}
        </if>
          <if test="deptType != null and deptType != ''">
            AND dept_type = #{deptType}
        </if>
        <!-- 数据范围过滤 -->
        ${params.dataScope}
        order by d.parent_id, d.order_num
@@ -79,6 +84,7 @@
        select d.dept_id,
               d.parent_id,
               d.dept_code,
               d.dept_type,
               d.ancestors,
               d.dept_name,
               d.order_num,
@@ -136,6 +142,7 @@
        <if test="email != null and email != ''">email,</if>
        <if test="status != null">status,</if>
        <if test="deptCode != null">dept_code,</if>
        <if test="deptType != null">dept_type,</if>
        <if test="createBy != null and createBy != ''">create_by,</if>
        create_time
        )values(
@@ -149,6 +156,7 @@
        <if test="email != null and email != ''">#{email},</if>
        <if test="status != null">#{status},</if>
        <if test="deptCode != null">#{deptCode},</if>
        <if test="deptType != null">#{deptType},</if>
        <if test="createBy != null and createBy != ''">#{createBy},</if>
        sysdate()
        )
@@ -166,6 +174,7 @@
            <if test="email != null">email = #{email},</if>
            <if test="status != null and status != ''">status = #{status},</if>
            <if test="deptCode != null">dept_code=#{deptCode},</if>
            <if test="deptType != null">dept_type=#{deptType},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            update_time = sysdate()
        </set>