魏熙美 hace 6 años
padre
commit
bdc0ebb049
Se han modificado 16 ficheros con 130 adiciones y 34 borrados
  1. 5
    7
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/IBuildingOwnerInfoController.java
  2. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserVerifyController.java
  3. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingMapper.java
  4. 18
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java
  5. 16
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpLevelMapper.java
  6. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpPhaseMapper.java
  7. 15
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpUnitMapper.java
  8. 1
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfo.java
  9. 17
    5
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java
  10. 42
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java
  11. 2
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserVerifyMapper.xml
  12. 2
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingMapper.xml
  13. 2
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml
  14. 3
    3
      CODE/smart-community/app-api/src/main/resources/mapper/TpLevelMapper.xml
  15. 2
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TpPhaseMapper.xml
  16. 2
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TpUnitMapper.xml

+ 5
- 7
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/IBuildingOwnerInfoController.java Ver fichero

@@ -32,30 +32,28 @@ public class IBuildingOwnerInfoController extends BaseController {
32 32
     private IBuildingOwnerInfo iBuildingOwnerInfo;
33 33
 
34 34
     @RequestMapping(value = "/building/select/address", method = RequestMethod.GET)
35
-    @ApiOperation(value = "根据 小区/期/楼栋/单元/楼层/户号", notes = "根据 小区/期/楼栋/单元/楼层/户号")
35
+    @ApiOperation(value = "根据 小区/期/楼栋/单元/楼层/户号 (申请注册绑定)", notes = "根据 小区/期/楼栋/单元/楼层/户号")
36 36
     @ApiImplicitParams({
37 37
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "communityId", value = "小区"),
38 38
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "phaseId", value = "期"),
39 39
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "buildingId", value = "楼栋"),
40 40
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "unitId", value = "单元"),
41
-            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "levelId", value = "楼层"),
42
-            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "roomNoId", value = "户号"),
41
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "levelId", value = "楼层")
43 42
     })
44 43
     public ResponseBean selectByAddress(@RequestParam("communityId") Integer communityId,
45 44
                                         @RequestParam(value = "phaseId", required = false) Integer phaseId,
46 45
                                         @RequestParam(value = "buildingId",required = false) Integer buildingId,
47 46
                                         @RequestParam(value = "unitId", required = false) Integer unitId,
48
-                                        @RequestParam(value = "levelId", required = false) Integer levelId,
49
-                                        @RequestParam(value = "roomNoId", required = false) Integer roomNoId) {
47
+                                        @RequestParam(value = "levelId", required = false) Integer levelId) {
50 48
 
51 49
         ResponseBean responseBean = new ResponseBean();
52
-        responseBean = iBuildingOwnerInfo.selectBuildList(communityId, phaseId, buildingId, unitId, levelId, roomNoId);
50
+        responseBean = iBuildingOwnerInfo.selectBuildList(communityId, phaseId, buildingId, unitId, levelId);
53 51
         return responseBean;
54 52
 
55 53
     }
56 54
 
57 55
     @RequestMapping(value = "/building/has", method = RequestMethod.GET)
58
-    @ApiOperation(value = "根据 小区、期、楼栋、单元、楼层、户号", notes = "根据 小区、期、楼栋、单元、楼层、户号")
56
+    @ApiOperation(value = "根据 小区、期、楼栋、单元、楼层、户号 (并校验这个用户,是否绑定了这个房产)", notes = "根据 小区、期、楼栋、单元、楼层、户号")
59 57
     @ApiImplicitParams({
60 58
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "phaseId", value = "期"),
61 59
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "buildingId", value = "楼栋"),

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserVerifyController.java Ver fichero

@@ -42,7 +42,7 @@ public class UserVerifyController extends BaseController {
42 42
     @ApiOperation(value = "添加一个审核的房产", notes = "添加一个审核的房产")
43 43
     @ApiImplicitParams({
44 44
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
45
-            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "roleName角色名称;phase期;building楼栋;unit单元;level楼层;roomNo户号")
45
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "roleName角色名称;phaseId期;buildingId楼栋;unitId单元;levelId楼层;roomNoId户号")
46 46
     })
47 47
     public ResponseBean addUserVerify(@RequestBody String parameter, HttpSession session) {
48 48
         ResponseBean responseBean = new ResponseBean();

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingMapper.java Ver fichero

@@ -31,6 +31,6 @@ public interface TpBuildingMapper {
31 31
      */
32 32
     @ResultMap("BaseResultMap")
33 33
     @Select("select * from tp_building where community_id=#{communityId} and phase_id=#{phaseId}")
34
-    List<TpBuilding> selectByCommunityIdAndPhaseId(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId);
34
+    List<TpBuilding> selectByAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId);
35 35
 
36 36
 }

+ 18
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java Ver fichero

@@ -44,9 +44,26 @@ public interface TpBuildingOwnerInfoMapper {
44 44
     @ResultMap("BaseResultMap")
45 45
     @Select("select * from tp_building_owner_info where community_id=#{communityId}" +
46 46
             " and phase_id=#{phaseId} and building_id=#{buildingId} and unit_id=#{unitId}" +
47
-            " and level_id=#{levelId} and room_no_id=#{roomNoId} and verify_status=1")
47
+            " and level_id=#{levelId} and id=#{roomNoId} and verify_status=1")
48 48
     TpBuildingOwnerInfo selectCommunityIdAndAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId,
49 49
                                                     @Param("buildingId") Integer building, @Param("unitId") Integer unitId,
50 50
                                                     @Param("levelId") Integer level, @Param("roomNoId") Integer roomNoId);
51 51
 
52
+    /*
53
+     * 根据 小区,期,楼栋,单元,楼层
54
+     * @param communityId
55
+     * @param phase
56
+     * @param building
57
+     * @param unit
58
+     * @param level
59
+     * @param roomNo
60
+     * @return
61
+     */
62
+    @ResultMap("BaseResultMap")
63
+    @Select("select * from tp_building_owner_info where community_id=#{communityId}" +
64
+            " and phase_id=#{phaseId} and building_id=#{buildingId} and unit_id=#{unitId}" +
65
+            " and level_id=#{levelId} and verify_status=1")
66
+    List<TpBuildingOwnerInfo> selectByAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId,
67
+                                                    @Param("buildingId") Integer building, @Param("unitId") Integer unitId,
68
+                                                    @Param("levelId") Integer level);
52 69
 }

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpLevelMapper.java Ver fichero

@@ -2,6 +2,10 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpLevel;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.ResultMap;
6
+import org.apache.ibatis.annotations.Select;
7
+
8
+import java.util.List;
5 9
 
6 10
 @Mapper
7 11
 public interface TpLevelMapper {
@@ -16,4 +20,16 @@ public interface TpLevelMapper {
16 20
     int updateByPrimaryKeySelective(TpLevel record);
17 21
 
18 22
     int updateByPrimaryKey(TpLevel record);
23
+
24
+    /**
25
+     * 根据 小区id,期id,楼栋id,单元id 进行查询
26
+     * @param communityId
27
+     * @param phaseId
28
+     * @param buildingId
29
+     * @param unitId
30
+     * @return
31
+     */
32
+    @ResultMap("BaseResultMap")
33
+    @Select("select * from tp_level where community_id=#{communityId} and phase_id=#{phaseId} and building_id=#{buildingId} and unit_id=#{unitId}")
34
+    List<TpLevel> selectByAddress(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId);
19 35
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpPhaseMapper.java Ver fichero

@@ -29,5 +29,5 @@ public interface TpPhaseMapper {
29 29
      */
30 30
     @ResultMap("BaseResultMap")
31 31
     @Select("select * from tp_phase where community_id = #{communityId}")
32
-    List<TpPhase> selectByCommunityId(@Param("communityId") Integer communityId);
32
+    List<TpPhase> selectByAddress(@Param("communityId") Integer communityId);
33 33
 }

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpUnitMapper.java Ver fichero

@@ -2,6 +2,10 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpUnit;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.ResultMap;
6
+import org.apache.ibatis.annotations.Select;
7
+
8
+import java.util.List;
5 9
 
6 10
 @Mapper
7 11
 public interface TpUnitMapper {
@@ -16,4 +20,15 @@ public interface TpUnitMapper {
16 20
     int updateByPrimaryKeySelective(TpUnit record);
17 21
 
18 22
     int updateByPrimaryKey(TpUnit record);
23
+
24
+    /**
25
+     * 根据 小区id,期id,楼栋id 查询
26
+     * @param communityId
27
+     * @param phaseId
28
+     * @param buildingId
29
+     * @return
30
+     */
31
+    @ResultMap("BaseResultMap")
32
+    @Select("select * from tp_unit where community_id=#{communityId} and phase_id=#{phaseId} and building_id=#{buildingId}")
33
+    List<TpUnit> selectByAddress(Integer communityId, Integer phaseId, Integer buildingId);
19 34
 }

+ 1
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfo.java Ver fichero

@@ -19,10 +19,9 @@ public interface IBuildingOwnerInfo {
19 19
      * @param buildingId
20 20
      * @param unitId
21 21
      * @param levelId
22
-     * @param roomNoId
23 22
      * @return
24 23
      */
25
-    ResponseBean selectBuildList(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, Integer roomNoId);
24
+    ResponseBean selectBuildList(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId);
26 25
 
27 26
     /**
28 27
      * 根据 小区/期/楼栋/单元/楼层/户号

+ 17
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java Ver fichero

@@ -59,15 +59,27 @@ public class BuildingOwnerInfoImpl implements IBuildingOwnerInfo {
59 59
 
60 60
 
61 61
     @Override
62
-    public ResponseBean selectBuildList(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, Integer roomNoId) {
62
+    public ResponseBean selectBuildList(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId) {
63 63
         ResponseBean responseBean = new ResponseBean();
64 64
 
65 65
         // 查询 期 -> 栋 -> 单元 -> 楼层 -> 户号
66
-        List<TpPhase> phaseList = tpPhaseMapper.selectByCommunityId(communityId);
67
-        List<TpBuilding> buildingList = tpBuildingMapper.selectByCommunityIdAndPhaseId(communityId, phaseId);
68
-
66
+        if (null == phaseId && null == buildingId && null == unitId && null == levelId) {
67
+            List<TpPhase> phaseList = tpPhaseMapper.selectByAddress(communityId);
68
+            responseBean.addSuccess(phaseList);
69
+        } else if (null == buildingId && null == unitId && null == levelId) {
70
+            List<TpBuilding> buildingList = tpBuildingMapper.selectByAddress(communityId, phaseId);
71
+            responseBean.addSuccess(buildingList);
72
+        } else if (null == unitId && null == levelId) {
73
+            List<TpUnit> unitList = tpUnitMapper.selectByAddress(communityId, phaseId, buildingId);
74
+            responseBean.addSuccess(unitList);
75
+        } else if (null == levelId) {
76
+            List<TpLevel> levelList = tpLevelMapper.selectByAddress(communityId, phaseId, buildingId, unitId);
77
+            responseBean.addSuccess(levelList);
78
+        } else {
79
+            List<TpBuildingOwnerInfo> buildingOwnerInfoList = tpBuildingOwnerInfoMapper.selectByAddress(communityId, phaseId, buildingId, unitId, levelId);
80
+            responseBean.addSuccess(buildingOwnerInfoList);
81
+        }
69 82
 
70
-        responseBean.addSuccess(null);
71 83
         return responseBean;
72 84
     }
73 85
 

+ 42
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java Ver fichero

@@ -33,15 +33,42 @@ public class TaUserVerifyServicelmpl implements TaUserVerifyServicel {
33 33
     @Autowired
34 34
     private TaSysRoleMapper taSysRoleMapper;
35 35
 
36
-    @Autowired
37
-    private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
38
-
39 36
     @Autowired
40 37
     private SysNationMapper sysNationMapper;
41 38
 
42 39
     @Autowired
43 40
     private TaUserMapper taUserMapper;
44 41
 
42
+    /**
43
+     * 期
44
+     */
45
+    @Autowired
46
+    private TpPhaseMapper tpPhaseMapper;
47
+
48
+    /**
49
+     * 单元
50
+     */
51
+    @Autowired
52
+    private TpUnitMapper tpUnitMapper;
53
+
54
+    /**
55
+     * 楼层
56
+     */
57
+    @Autowired
58
+    private TpLevelMapper tpLevelMapper;
59
+
60
+    /**
61
+     * 栋
62
+     */
63
+    @Autowired
64
+    private TpBuildingMapper tpBuildingMapper;
65
+
66
+    /**
67
+     * 户号 /  楼栋资料库
68
+     */
69
+    @Autowired
70
+    private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
71
+
45 72
     @Override
46 73
     public ResponseBean getToAuditNotApproved(UserElement userElement, Integer userVerifyId) {
47 74
         ResponseBean responseBean = new ResponseBean();
@@ -71,11 +98,23 @@ public class TaUserVerifyServicelmpl implements TaUserVerifyServicel {
71 98
         String roleName = jsonObject.getString("roleName");
72 99
         TaSysRole sysRole = taSysRoleMapper.selectByRoleName(roleName);
73 100
 
101
+        // 查询 期/栋/单元/楼层/户号 -> 设置 相应 id 和 name
102
+        TpPhase phase = tpPhaseMapper.selectByPrimaryKey(taUserVerify.getPhaseId());
103
+        TpBuilding building = tpBuildingMapper.selectByPrimaryKey(taUserVerify.getBuildingId());
104
+        TpUnit unit = tpUnitMapper.selectByPrimaryKey(taUserVerify.getUnitId());
105
+        TpLevel level = tpLevelMapper.selectByPrimaryKey(taUserVerify.getLevelId());
106
+        TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectByPrimaryKey(taUserVerify.getRoomNoId());
107
+
74 108
         taUserVerify.setRoleId(sysRole.getId());
75 109
         taUserVerify.setCommunityId(userElement.getCommunityId());
76 110
         taUserVerify.setUserId(userElement.getId());
77 111
         taUserVerify.setVerifyStatus("0");
78 112
         taUserVerify.setCreateDate(new Date());
113
+        taUserVerify.setPhaseName(phase.getName());
114
+        taUserVerify.setBuildingName(building.getName());
115
+        taUserVerify.setUnitName(unit.getName());
116
+        taUserVerify.setLevelName(level.getName());
117
+        taUserVerify.setRoomNoName(buildingOwnerInfo.getName());
79 118
 
80 119
         int rows = taUserVerifyMapper.insertSelective(taUserVerify);
81 120
         if (rows <= 0) {

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TaUserVerifyMapper.xml Ver fichero

@@ -35,7 +35,7 @@
35 35
     delete from ta_user_verify
36 36
     where id = #{id,jdbcType=INTEGER}
37 37
   </delete>
38
-  <insert id="insert" parameterType="com.community.huiju.model.TaUserVerify" >
38
+  <insert id="insert" parameterType="com.community.huiju.model.TaUserVerify"  keyColumn="id" useGeneratedKeys="true" >
39 39
     insert into ta_user_verify (id, user_id, community_id,
40 40
       role_id, phase_id, phase_name,
41 41
       building_id, building_name, unit_id,
@@ -49,7 +49,7 @@
49 49
       #{roomNoId,jdbcType=INTEGER}, #{roomNoName,jdbcType=VARCHAR}, #{verifyStatus,jdbcType=VARCHAR},
50 50
       #{createDate,jdbcType=TIMESTAMP}, #{verifyName,jdbcType=VARCHAR})
51 51
   </insert>
52
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TaUserVerify" >
52
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaUserVerify" keyColumn="id" useGeneratedKeys="true">
53 53
     insert into ta_user_verify
54 54
     <trim prefix="(" suffix=")" suffixOverrides="," >
55 55
       <if test="id != null" >

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingMapper.xml Ver fichero

@@ -23,7 +23,7 @@
23 23
     delete from tp_building
24 24
     where id = #{id,jdbcType=INTEGER}
25 25
   </delete>
26
-  <insert id="insert" parameterType="com.community.huiju.model.TpBuilding" >
26
+  <insert id="insert" parameterType="com.community.huiju.model.TpBuilding"  keyColumn="id" useGeneratedKeys="true" >
27 27
     insert into tp_building (id, community_id, phase_id,
28 28
       phase_name, name, sort,
29 29
       create_date)
@@ -31,7 +31,7 @@
31 31
       #{phaseName,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sort,jdbcType=VARCHAR},
32 32
       #{createDate,jdbcType=TIMESTAMP})
33 33
   </insert>
34
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuilding" >
34
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuilding"  keyColumn="id" useGeneratedKeys="true" >
35 35
     insert into tp_building
36 36
     <trim prefix="(" suffix=")" suffixOverrides="," >
37 37
       <if test="id != null" >

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml Ver fichero

@@ -40,7 +40,7 @@
40 40
     delete from tp_building_owner_info
41 41
     where id = #{id,jdbcType=INTEGER}
42 42
   </delete>
43
-  <insert id="insert" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
43
+  <insert id="insert" parameterType="com.community.huiju.model.TpBuildingOwnerInfo"  keyColumn="id" useGeneratedKeys="true" >
44 44
     insert into tp_building_owner_info (id, community_id, id_card,
45 45
       phase_id, phase_name, building_id,
46 46
       building_name, unit_id, unit_name,
@@ -58,7 +58,7 @@
58 58
       #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
59 59
       #{updateDate,jdbcType=TIMESTAMP})
60 60
   </insert>
61
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
61
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuildingOwnerInfo"  keyColumn="id" useGeneratedKeys="true" >
62 62
     insert into tp_building_owner_info
63 63
     <trim prefix="(" suffix=")" suffixOverrides="," >
64 64
       <if test="id != null" >

+ 3
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpLevelMapper.xml Ver fichero

@@ -18,7 +18,7 @@
18 18
     id, community_id, phase_id, phase_name, building_id, building_name, unit_id, unit_name, 
19 19
     name, sort, create_date
20 20
   </sql>
21
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"  >
22 22
     select 
23 23
     <include refid="Base_Column_List" />
24 24
     from tp_level
@@ -28,7 +28,7 @@
28 28
     delete from tp_level
29 29
     where id = #{id,jdbcType=INTEGER}
30 30
   </delete>
31
-  <insert id="insert" parameterType="com.community.huiju.model.TpLevel" >
31
+  <insert id="insert" parameterType="com.community.huiju.model.TpLevel"  keyColumn="id" useGeneratedKeys="true" >
32 32
     insert into tp_level (id, community_id, phase_id, 
33 33
       phase_name, building_id, building_name, 
34 34
       unit_id, unit_name, name, 
@@ -38,7 +38,7 @@
38 38
       #{unitId,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
39 39
       #{sort,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP})
40 40
   </insert>
41
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpLevel" >
41
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpLevel"  keyColumn="id" useGeneratedKeys="true" >
42 42
     insert into tp_level
43 43
     <trim prefix="(" suffix=")" suffixOverrides="," >
44 44
       <if test="id != null" >

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpPhaseMapper.xml Ver fichero

@@ -21,13 +21,13 @@
21 21
     delete from tp_phase
22 22
     where id = #{id,jdbcType=INTEGER}
23 23
   </delete>
24
-  <insert id="insert" parameterType="com.community.huiju.model.TpPhase" >
24
+  <insert id="insert" parameterType="com.community.huiju.model.TpPhase"  keyColumn="id" useGeneratedKeys="true" >
25 25
     insert into tp_phase (id, community_id, NAME, 
26 26
       sort, create_date)
27 27
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
28 28
       #{sort,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP})
29 29
   </insert>
30
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpPhase" >
30
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpPhase"  keyColumn="id" useGeneratedKeys="true" >
31 31
     insert into tp_phase
32 32
     <trim prefix="(" suffix=")" suffixOverrides="," >
33 33
       <if test="id != null" >

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpUnitMapper.xml Ver fichero

@@ -25,7 +25,7 @@
25 25
     delete from tp_unit
26 26
     where id = #{id,jdbcType=INTEGER}
27 27
   </delete>
28
-  <insert id="insert" parameterType="com.community.huiju.model.TpUnit" >
28
+  <insert id="insert" parameterType="com.community.huiju.model.TpUnit"  keyColumn="id" useGeneratedKeys="true" >
29 29
     insert into tp_unit (id, community_id, phase_id, 
30 30
       phase_name, building_id, building_name, 
31 31
       name, sort, create_date
@@ -35,7 +35,7 @@
35 35
       #{name,jdbcType=VARCHAR}, #{sort,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}
36 36
       )
37 37
   </insert>
38
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpUnit" >
38
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpUnit"  keyColumn="id" useGeneratedKeys="true" >
39 39
     insert into tp_unit
40 40
     <trim prefix="(" suffix=")" suffixOverrides="," >
41 41
       <if test="id != null" >