puzhibing
2024-12-10 6f54cebf07887237f5eb8efdf9d1d0b784dbaa49
ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysDeptMapper.xml
@@ -20,10 +20,11 @@
      <result property="createTime" column="create_time" />
      <result property="updateBy"   column="update_by"   />
      <result property="updateTime" column="update_time" />
      <result property="shopId" column="shop_id" />
   </resultMap>
   
   <sql id="selectDeptVo">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.shop_id
        from sys_dept d
    </sql>
    
@@ -41,6 +42,9 @@
      </if>
      <if test="status != null and status != ''">
         AND status = #{status}
      </if>
      <if test="shopId != null">
         AND shop_id = #{shopId}
      </if>
      <!-- 数据范围过滤 -->
      ${params.dataScope}
@@ -96,6 +100,7 @@
          <if test="phone != null and phone != ''">phone,</if>
          <if test="email != null and email != ''">email,</if>
          <if test="status != null">status,</if>
          <if test="shopId != null">shop_id,</if>
          <if test="createBy != null and createBy != ''">create_by,</if>
          create_time
       )values(
@@ -108,6 +113,7 @@
          <if test="phone != null and phone != ''">#{phone},</if>
          <if test="email != null and email != ''">#{email},</if>
          <if test="status != null">#{status},</if>
          <if test="shopId != null">#{shopId},</if>
          <if test="createBy != null and createBy != ''">#{createBy},</if>
          sysdate()
       )
@@ -124,6 +130,7 @@
          <if test="phone != null">phone = #{phone},</if>
          <if test="email != null">email = #{email},</if>
          <if test="status != null and status != ''">status = #{status},</if>
          <if test="shopId != null">shop_id = #{shopId},</if>
          <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
          update_time = sysdate()
       </set>