Browse Source

fix 新增网格id

tjf 3 năm trước cách đây
mục cha
commit
13b740f37d

+ 12 - 1
boman-web-core/src/main/java/com/boman/web/core/domain/GridInfo.java

@@ -38,7 +38,18 @@ public class GridInfo extends BaseEntity
     @Excel(name = "是否删除")
     @Excel(name = "是否删除")
     private String isDel;
     private String isDel;
 
 
-    public void setId(Long id) 
+    /** 父网格id */
+    private Long pid;
+
+    public Long getPid() {
+        return pid;
+    }
+
+    public void setPid(Long pid) {
+        this.pid = pid;
+    }
+
+    public void setId(Long id)
     {
     {
         this.id = id;
         this.id = id;
     }
     }

+ 7 - 2
boman-web-core/src/main/resources/mapper/GridInfoMapper.xml

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="GridInfo" id="GridInfoResult">
     <resultMap type="GridInfo" id="GridInfoResult">
         <result property="id"    column="id"    />
         <result property="id"    column="id"    />
         <result property="areaName"    column="area_name"    />
         <result property="areaName"    column="area_name"    />
+        <result property="pid"    column="pid"    />
         <result property="gridName"    column="grid_name"    />
         <result property="gridName"    column="grid_name"    />
         <result property="sort"    column="sort"    />
         <result property="sort"    column="sort"    />
         <result property="type"    column="type"    />
         <result property="type"    column="type"    />
@@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     </resultMap>
 
 
     <sql id="selectGridInfoVo">
     <sql id="selectGridInfoVo">
-        select id, area_name, grid_name, sort, type, create_by, create_time, update_by, update_time, is_del from grid_info
+        select id, area_name, pid,grid_name, sort, type, create_by, create_time, update_by, update_time, is_del from grid_info
     </sql>
     </sql>
 
 
     <select id="selectGridInfoList" parameterType="GridInfo" resultMap="GridInfoResult">
     <select id="selectGridInfoList" parameterType="GridInfo" resultMap="GridInfoResult">
@@ -27,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="areaName != null  and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
             <if test="areaName != null  and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
             <if test="gridName != null  and gridName != ''"> and grid_name like concat('%', #{gridName}, '%')</if>
             <if test="gridName != null  and gridName != ''"> and grid_name like concat('%', #{gridName}, '%')</if>
             <if test="sort != null  and sort != ''"> and sort = #{sort}</if>
             <if test="sort != null  and sort != ''"> and sort = #{sort}</if>
+            <if test="pid != null  and pid != ''"> and pid = #{pid}</if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
             <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
             <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
         </where>
         </where>
@@ -41,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into grid_info
         insert into grid_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="areaName != null and areaName != ''">area_name,</if>
             <if test="areaName != null and areaName != ''">area_name,</if>
+            <if test="pid != null and pid != ''">pid,</if>
             <if test="gridName != null and gridName != ''">grid_name,</if>
             <if test="gridName != null and gridName != ''">grid_name,</if>
             <if test="sort != null and sort != ''">sort,</if>
             <if test="sort != null and sort != ''">sort,</if>
             <if test="type != null">type,</if>
             <if test="type != null">type,</if>
@@ -52,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="areaName != null and areaName != ''">#{areaName},</if>
             <if test="areaName != null and areaName != ''">#{areaName},</if>
+            <if test="pid != null and pid != ''">#{pid},</if>
             <if test="gridName != null and gridName != ''">#{gridName},</if>
             <if test="gridName != null and gridName != ''">#{gridName},</if>
             <if test="sort != null and sort != ''">#{sort},</if>
             <if test="sort != null and sort != ''">#{sort},</if>
             <if test="type != null">#{type},</if>
             <if test="type != null">#{type},</if>
@@ -67,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update grid_info
         update grid_info
         <trim prefix="SET" suffixOverrides=",">
         <trim prefix="SET" suffixOverrides=",">
             <if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
             <if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
+            <if test="pid != null and pid != ''">pid = #{pid},</if>
             <if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
             <if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
             <if test="sort != null and sort != ''">sort = #{sort},</if>
             <if test="sort != null and sort != ''">sort = #{sort},</if>
             <if test="type != null">type = #{type},</if>
             <if test="type != null">type = #{type},</if>
@@ -91,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
     </delete>
 
 
     <select id="treeSelect" parameterType="GridInfo" resultMap="GridInfoResult">
     <select id="treeSelect" parameterType="GridInfo" resultMap="GridInfoResult">
-        select id,area_name, grid_name, sort, type from grid_info
+        select id,area_name, grid_name, sort, type,pid from grid_info
         <where>
         <where>
             is_del = 'N'
             is_del = 'N'
             <if test="pid != null "> and pid =#{pid}</if>
             <if test="pid != null "> and pid =#{pid}</if>