Explorar o código

fix 新增网格id

tjf %!s(int64=3) %!d(string=hai) anos
pai
achega
1d766d6004

+ 13 - 0
boman-api/boman-domain/src/main/java/com.boman.domain/SysUser.java

@@ -157,6 +157,19 @@ public class SysUser/* extends BaseEntity*/ {
      */
     private Date updateTime;
 
+    /**
+     * 网格id
+     */
+    private Long gridId;
+
+    public Long getGridId() {
+        return gridId;
+    }
+
+    public void setGridId(Long gridId) {
+        this.gridId = gridId;
+    }
+
     public String getRemark() {
         return remark;
     }

+ 4 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/Czrk.java

@@ -204,6 +204,10 @@ public class Czrk extends BaseEntity{
      */
     @Excel(name = "状态")
     private String status;
+    /**
+     * 网格id
+     */
+    private Long gridId;
 
     /**
      * 是否删除 默认为 "N"

+ 6 - 2
boman-modules/boman-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="remark"       column="remark"       />
 		<result property="unionId"       column="union_id"       />
 		<result property="openId"       column="open_id"       />
+		<result property="gridId"       column="grid_id"       />
 		<association property="dept"    column="dept_id" javaType="com.boman.domain.SysDept" resultMap="deptResult" />
 		<collection  property="roles"   javaType="java.util.List"        resultMap="RoleResult" />
 	</resultMap>
@@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</resultMap>
 	
 	<sql id="selectUserVo">
-        select u.id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.union_id, u.open_id,
+        select u.id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.union_id, u.open_id,u.grid_id,
         d.id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
@@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
     
     <select id="selectUserList" parameterType="com.boman.domain.SysUser" resultMap="SysUserResult">
-		select u.id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
+		select u.id, u.grid_id,u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
 		left join sys_dept d on u.dept_id = d.id
 		where u.del_flag = '0'
 		<if test="userName != null and userName != ''">
@@ -118,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">status,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="gridId, != null and gridId != ''">grid_id,</if>
  			create_time
  		)values(
  			<if test="deptId != null and deptId != ''">#{deptId},</if>
@@ -131,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="gridId != null and gridId != ''">#{gridId},</if>
  			sysdate()
  		)
 	</insert>
@@ -151,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="remark != null">remark = #{remark},</if>
+ 			<if test="gridId != null">gridId = #{gridId},</if>
  			update_time = sysdate()
  		</set>
  		where id = #{id}

+ 0 - 4
boman-web-core/src/main/java/com/boman/web/core/controller/GridInfoController.java

@@ -89,10 +89,6 @@ public class GridInfoController extends BaseController
     @PostMapping("/treeSelect")
     public AjaxResult treeSelect(@RequestBody GridInfo gridInfo)
     {
-        String areaName = gridInfo.getAreaName();
-        if (StringUtils.isNotBlank(areaName)){
-            gridInfo.setType("1");
-        }
         AjaxResult ajaxResult = gridInfoService.treeSelect(gridInfo);
         return ajaxResult;
     }

+ 13 - 2
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="villagerGroup"    column="villager_group"    />
         <result property="nowIn"    column="now_in"    />
         <result property="remark"    column="remark"    />
+        <result property="gridId"    column="grid_id"    />
         <result property="status"    column="status"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -62,12 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <sql id="selectCzrkVo">
         select id, user_name, gender, age, birthday,dept_id, id_card, phone_num, code, house_type, rlr, rl_time, yhzgx
              , work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns
-             , village_id, village, villager_group_id, villager_group, now_in, remark, status, create_by, create_time
+             , village_id, village, villager_group_id, villager_group, now_in, remark,grid_id, status, create_by, create_time
              , update_by, update_time, is_del, delete_reason, dept_id, is_rl, key_industries from czrk
     </sql>
 
     <select id="listByRlry"  resultMap="CzrkResult">
-        select id, user_name, phone_num,dept_id, id_card, gender, province, city, region
+        select id, user_name, phone_num,dept_id, id_card, gender, province, city, region,grid_id
         , house_type, update_by, code, rlr, update_time, delete_reason, now_in
         from czrk
         <where>
@@ -106,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
             <if test="deleteReason != null  and deleteReason != ''"> and delete_reason = #{deleteReason}</if>
+            <if test="gridId != null  and gridId != ''"> and grid_id = #{gridId}</if>
             <if test="deptIdList != null and deptIdList.size() > 0">
                 and dept_id in
                 <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -185,6 +187,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null  and status != ''"> and czrk.status = #{status}</if>
             <if test="isDel != null  and isDel != ''"> and czrk.is_del = #{isDel}</if>
             <if test="deleteReason != null  and deleteReason != ''"> and czrk.delete_reason = #{deleteReason}</if>
+            <if test="gridId != null  and gridId != ''"> and czrk.grid_id = #{gridId}</if>
+
             <if test="deptIdList != null and deptIdList.size() > 0">
                 and czrk.dept_id in
                 <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -222,6 +226,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
         <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
         <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="gridId != null  and gridId != ''"> and vi.grid_id = #{gridId}</if>
+
         <if test="deptIdList != null  and deptIdList.size() > 0">
             and vi.dept_id in
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -284,6 +290,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
         <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
         <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="gridId != null  and gridId != ''"> and vi.grid_id = #{gridId}</if>
+
         <if test="deptIdList != null  and deptIdList.size() > 0">
             and vi.dept_id in
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -433,6 +441,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="villagerGroup != null">villager_group,</if>
             <if test="nowIn != null">now_in,</if>
             <if test="remark != null">remark,</if>
+            <if test="gridId != null">grid_id,</if>
             <if test="status != null">status,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
@@ -469,6 +478,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="villagerGroup != null">#{villagerGroup},</if>
             <if test="nowIn != null">#{nowIn},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="gridId != null">#{gridId},</if>
             <if test="status != null">#{status},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -508,6 +518,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
             <if test="nowIn != null">now_in = #{nowIn},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="gridId != null">grid_id = #{gridId},</if>
             <if test="status != null">status = #{status},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>

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

@@ -91,11 +91,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <select id="treeSelect" parameterType="GridInfo" resultMap="GridInfoResult">
-        select area_name, grid_name, sort, type from grid_info
+        select id,area_name, grid_name, sort, type from grid_info
         <where>
             is_del = 'N'
-            <if test="areaName != null  and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
-            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="pid != null "> and pid =#{pid}</if>
         </where>
         order by sort
     </select>