Forráskód Böngészése

迭代二 区域表结构调整为父子目录

车车 1 éve
szülő
commit
688e7718d0

+ 1 - 1
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsWorkareaController.java

@@ -57,7 +57,7 @@ public class IsWorkareaController extends BaseController {
     @GetMapping("/getIsWorkareaList")
     public CommonResult<List<IsWorkarea>> getIsWorkareaList(Long workshopId) {
         List<IsWorkarea> result = isWorkareaService.list(Wrappers.<IsWorkarea>lambdaQuery()
-                .eq(IsWorkarea::getWorkshopId, workshopId)
+                .eq(workshopId != null, IsWorkarea::getWorkshopId, workshopId)
                 .orderByDesc(IsWorkarea::getWorkareaId));
         return CommonResult.success(result);
     }

+ 8 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsWorkarea.java

@@ -54,5 +54,13 @@ public class IsWorkarea extends BaseBean
     @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
     private String delFlag;
 
+    @ApiModelProperty(value = "父部门id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "祖级列表")
+    private String ancestors;
+
+    @ApiModelProperty(value = "显示顺序")
+    private Integer orderNum;
 
 }

+ 9 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/workarea/PageWorkareaVO.java

@@ -55,5 +55,14 @@ public class PageWorkareaVO extends BaseBean
     @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
     private String delFlag;
 
+    @ApiModelProperty(value = "父部门id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "祖级列表")
+    private String ancestors;
+
+    @ApiModelProperty(value = "显示顺序")
+    private Integer orderNum;
+
 
 }

+ 16 - 1
ktg-iscs/src/main/resources/mapper/IsWorkareaMapper.xml

@@ -16,10 +16,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
+        <result property="parentId"    column="parent_id"    />
+        <result property="ancestors"    column="ancestors"    />
+        <result property="orderNum"    column="order_num"    />
     </resultMap>
 
     <sql id="selectIsWorkareaVo">
-        select workarea_id, workarea_code, workarea_name, workarea_type, workshop_id, map, del_flag, create_by, create_time, update_time, update_by from is_workarea
+        select workarea_id, workarea_code, workarea_name,
+               workarea_type, workshop_id, map, del_flag, create_by,
+               create_time, update_time, update_by, parent_id, ancestors, order_num
+        from is_workarea
     </sql>
 
     <select id="selectIsWorkareaList" parameterType="IsWorkarea" resultMap="IsWorkareaResult">
@@ -51,6 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateBy != null">update_by,</if>
+            <if test="parentId != null">parent_id,</if>
+            <if test="ancestors != null and ancestors != ''">ancestors,</if>
+            <if test="orderNum != null">order_num,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="workareaCode != null and workareaCode != ''">#{workareaCode},</if>
@@ -63,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
+            <if test="parentId != null">parent_id,</if>
+            <if test="ancestors != null and ancestors != ''">ancestors,</if>
+            <if test="orderNum != null">order_num,</if>
          </trim>
     </insert>
 
@@ -79,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="parentId != null">parent_id = #{parentId},</if>
+            <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
+            <if test="orderNum != null">order_num = #{orderNum},</if>
         </trim>
         where workarea_id = #{workareaId}
     </update>