Procházet zdrojové kódy

查询app用户个人信息,修改头像

weiximei před 6 roky
rodič
revize
15dfaff4f7

+ 3
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Zobrazit soubor

@@ -37,6 +37,7 @@ public class TicketController {
37 37
             @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区编号"),
38 38
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNum",value = "第几页"),
39 39
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少数据"),
40
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
40 41
     })
41 42
     public ResponseBean getService(@PathVariable(value = "communityId") String communityId,
42 43
                                    @RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
@@ -74,6 +75,7 @@ public class TicketController {
74 75
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNum", value = "第几页"),
75 76
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize", value = "一页多少数据"),
76 77
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "type", value = "工单类型 (0报修/1投诉/2联系单)"),
78
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
77 79
     })
78 80
     public ResponseBean getServiceList(@PathVariable(value = "communityId") String communityId,
79 81
                                        @RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
@@ -115,6 +117,7 @@ public class TicketController {
115 117
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "ticketContent",value = "工单内容"),
116 118
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "ticketTitle",value = "工单标题"),
117 119
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "repairType",value = "报修房屋类型"),
120
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
118 121
     })
119 122
     @RequestMapping(value = "/addAlltpTicket",method = RequestMethod.POST)
120 123
     @ResponseBody

+ 48
- 15
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Zobrazit soubor

@@ -40,15 +40,14 @@ public class UserController {
40 40
     @ApiOperation(value = "登录", notes = "根据登录名和验证码")
41 41
     @ApiImplicitParams({
42 42
             @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区"),
43
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginName",value = "登陆名(手机号)"),
44
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码")
43
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "loginName(登陆名(手机号)) code(验证码)"),
45 44
     })
46 45
     @RequestMapping(value = "/user/login/{communityId}",method = RequestMethod.POST)
47
-    public ResponseBean login(@RequestParam(value = "loginName") String loginName,
48
-                              @RequestParam(value = "code",defaultValue = "") String code,
46
+    public ResponseBean login(@RequestBody String parameter,
49 47
                               @PathVariable(value = "communityId") String communityId,
50 48
                               HttpSession session){
51
-        ResponseBean responseBean = iTaUserService.login(loginName,communityId,code);
49
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
50
+        ResponseBean responseBean = iTaUserService.login(jsonObject.getString("loginName"),communityId, jsonObject.getString("code"));
52 51
         TaUserVO userVO = (TaUserVO) responseBean.getData();
53 52
 
54 53
         if (null != userVO) {
@@ -63,7 +62,8 @@ public class UserController {
63 62
     @ApiOperation(value = "修改手机号", notes = "修改手机号")
64 63
     @ApiImplicitParams({
65 64
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "登陆(手机号)"),
66
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码")
65
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码"),
66
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
67 67
     })
68 68
             @RequestMapping(value = "/user/phone",method = RequestMethod.PUT)
69 69
     public ResponseBean update(@RequestBody String paramets, HttpSession session){
@@ -85,16 +85,17 @@ public class UserController {
85 85
     }
86 86
     @ApiOperation(value = "修改用户名和性别", notes = "修改用户名和性别")
87 87
     @ApiImplicitParams({
88
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "userName",value = "用户民"),
89
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "gender",value = "性别")
88
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName用户民和gender性别"),
89
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
90 90
     })
91 91
     @RequestMapping(value = "/user/update/info",method = RequestMethod.PUT)
92
-    public ResponseBean updateUserNameAndGender(@RequestBody TaUser user,
92
+    public ResponseBean updateUserNameAndGender(@RequestBody String parameter,
93 93
                                                 HttpSession session){
94 94
         ResponseBean response = new ResponseBean();
95 95
 
96 96
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
97 97
 
98
+        TaUser user = JSONObject.parseObject(parameter,TaUser.class);
98 99
         user.setId(userElement.getId());
99 100
 
100 101
         response = iTaUserService.modifyUser(user);
@@ -104,8 +105,8 @@ public class UserController {
104 105
 
105 106
     @ApiOperation(value = "租客或家属 启用或者停用", notes = "租客或家属 启用或者停用")
106 107
     @ApiImplicitParams({
107
-            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "userId",value = "租客或者家属"),
108
-            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "type",value = "1启用 0停用")
108
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userId(租客或者家属) type(1启用 0停用)"),
109
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
109 110
     })
110 111
     @RequestMapping(value = "/user/update/dependentsOrTenants",method = RequestMethod.PUT)
111 112
     public ResponseBean updateDependentsOrTenants(@RequestBody String parameter,
@@ -124,10 +125,11 @@ public class UserController {
124 125
 
125 126
     @ApiOperation(value = "业主添加 租客或家属", notes = "业主添加 租客或家属")
126 127
     @ApiImplicitParams({
127
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "userName",value = "租客或者家属 姓名"),
128
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "租客或者家属 手机号"),
129
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "gender",value = "租客或者家属 性别 1男 2女"),
130
-            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "type",value = "1家属 0租客")
128
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName(租客或者家属 姓名) " +
129
+                    "phone(租客或者家属 手机号) " +
130
+                    "gender(租客或者家属 性别 1男 2女) " +
131
+                    "type(1家属 0租客)"),
132
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
131 133
     })
132 134
     @RequestMapping(value = "/user/update/addTenantsOrDependents",method = RequestMethod.POST)
133 135
     public ResponseBean addTenantsOrDependents(@RequestBody String parameter,
@@ -146,5 +148,36 @@ public class UserController {
146 148
     }
147 149
 
148 150
 
151
+    @ApiOperation(value = "修改用户头像", notes = "修改用户头像")
152
+    @ApiImplicitParams({
153
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "headPortrait(用户头像)"),
154
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
155
+    })
156
+    @RequestMapping(value = "/user/update/modifyUserHeadPortrait",method = RequestMethod.PUT)
157
+    public ResponseBean modifyUserHeadPortrait(@RequestBody String parameter,
158
+                                               HttpSession session){
159
+
160
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
161
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
162
+        ResponseBean response = iTaUserService.modifyUserHeadPortrait(userElement.getId(),jsonObject.getString("headPortrait"));
163
+
164
+        return response;
165
+
166
+    }
167
+
168
+    @ApiOperation(value = "获取用户信息", notes = "获取用户信息")
169
+    @ApiImplicitParams({
170
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
171
+    })
172
+    @RequestMapping(value = "/user/info",method = RequestMethod.GET)
173
+    public ResponseBean getUserInfo(HttpSession session){
174
+        ResponseBean response = new ResponseBean();
175
+
176
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
177
+        response = iTaUserService.getUserInfo(userElement.getId());
178
+
179
+        return response;
180
+
181
+    }
149 182
 
150 183
 }

+ 19
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/SysNationMapper.java Zobrazit soubor

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.SysNation;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface SysNationMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(SysNation record);
11
+
12
+    int insertSelective(SysNation record);
13
+
14
+    SysNation selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(SysNation record);
17
+
18
+    int updateByPrimaryKey(SysNation record);
19
+}

+ 105
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/SysNation.java Zobrazit soubor

@@ -0,0 +1,105 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class SysNation {
6
+    private Integer id;
7
+
8
+    private String code;
9
+
10
+    private String province;
11
+
12
+    private String city;
13
+
14
+    private Integer parentId;
15
+
16
+    private Date createTime;
17
+
18
+    private String district;
19
+
20
+    private Date lastUpdateTime;
21
+
22
+    private Integer operator;
23
+
24
+    private String operatorIp;
25
+
26
+    public Integer getId() {
27
+        return id;
28
+    }
29
+
30
+    public void setId(Integer id) {
31
+        this.id = id;
32
+    }
33
+
34
+    public String getCode() {
35
+        return code;
36
+    }
37
+
38
+    public void setCode(String code) {
39
+        this.code = code == null ? null : code.trim();
40
+    }
41
+
42
+    public String getProvince() {
43
+        return province;
44
+    }
45
+
46
+    public void setProvince(String province) {
47
+        this.province = province == null ? null : province.trim();
48
+    }
49
+
50
+    public String getCity() {
51
+        return city;
52
+    }
53
+
54
+    public void setCity(String city) {
55
+        this.city = city == null ? null : city.trim();
56
+    }
57
+
58
+    public Integer getParentId() {
59
+        return parentId;
60
+    }
61
+
62
+    public void setParentId(Integer parentId) {
63
+        this.parentId = parentId;
64
+    }
65
+
66
+    public Date getCreateTime() {
67
+        return createTime;
68
+    }
69
+
70
+    public void setCreateTime(Date createTime) {
71
+        this.createTime = createTime;
72
+    }
73
+
74
+    public String getDistrict() {
75
+        return district;
76
+    }
77
+
78
+    public void setDistrict(String district) {
79
+        this.district = district == null ? null : district.trim();
80
+    }
81
+
82
+    public Date getLastUpdateTime() {
83
+        return lastUpdateTime;
84
+    }
85
+
86
+    public void setLastUpdateTime(Date lastUpdateTime) {
87
+        this.lastUpdateTime = lastUpdateTime;
88
+    }
89
+
90
+    public Integer getOperator() {
91
+        return operator;
92
+    }
93
+
94
+    public void setOperator(Integer operator) {
95
+        this.operator = operator;
96
+    }
97
+
98
+    public String getOperatorIp() {
99
+        return operatorIp;
100
+    }
101
+
102
+    public void setOperatorIp(String operatorIp) {
103
+        this.operatorIp = operatorIp == null ? null : operatorIp.trim();
104
+    }
105
+}

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Zobrazit soubor

@@ -76,4 +76,19 @@ public interface ITaUserService {
76 76
      */
77 77
     ResponseBean addTenantsOrDependents(String userName, String phone, String gender,Integer currentUserId,Integer type);
78 78
 
79
+    /**
80
+     * 修改用户头像
81
+     * @param currentUserId
82
+     * @param headPortrait 图片url
83
+     * @return
84
+     */
85
+    ResponseBean modifyUserHeadPortrait(Integer currentUserId, String headPortrait);
86
+
87
+    /**
88
+     * 获取用户信息
89
+     * @param userId
90
+     * @return
91
+     */
92
+    ResponseBean getUserInfo(Integer userId);
93
+
79 94
 }

+ 66
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Zobrazit soubor

@@ -5,16 +5,12 @@ import com.community.commom.mode.ResponseBean;
5 5
 import com.community.commom.utils.AccountValidatorUtil;
6 6
 import com.community.commom.utils.MD5Utils;
7 7
 import com.community.huiju.common.code.cache.AppkeyCache;
8
-import com.community.huiju.dao.TaSysRoleMapper;
9
-import com.community.huiju.dao.TaSysUserRoleMapper;
10
-import com.community.huiju.dao.TaUserMapper;
11
-import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
12
-import com.community.huiju.model.TaSysRole;
13
-import com.community.huiju.model.TaSysUserRole;
14
-import com.community.huiju.model.TaUser;
8
+import com.community.huiju.dao.*;
9
+import com.community.huiju.model.*;
15 10
 import com.community.huiju.service.ITaUserService;
16 11
 import com.community.huiju.vo.TaUserVO;
17 12
 import com.google.common.collect.Maps;
13
+import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
18 14
 import lombok.extern.slf4j.Slf4j;
19 15
 import org.apache.commons.lang.StringUtils;
20 16
 import org.checkerframework.checker.units.qual.A;
@@ -47,6 +43,12 @@ public class TaUserServiceImpl implements ITaUserService {
47 43
     @Autowired
48 44
     private TaSysUserRoleMapper taSysUserRoleMapper;
49 45
 
46
+    @Autowired
47
+    private ToCommunitiesMapper toCommunitiesMapper;
48
+
49
+    @Autowired
50
+    private SysNationMapper sysNationMapper;
51
+
50 52
     @Transactional
51 53
     @Override
52 54
     public ResponseBean login(TaUser user) {
@@ -301,7 +303,7 @@ public class TaUserServiceImpl implements ITaUserService {
301 303
         user.setRemark("这是业主添加的!");
302 304
         user.setUserName(user.getLoginName());
303 305
         user.setBuildingOwnerInfoId(taUser.getBuildingOwnerInfoId());
304
-        user.setCommunityId(user.getCommunityId());
306
+        user.setCommunityId(taUser.getCommunityId());
305 307
 
306 308
         int result = taUserMapper.insertSelective(user);
307 309
         if (result < 0) {
@@ -338,4 +340,60 @@ public class TaUserServiceImpl implements ITaUserService {
338 340
 
339 341
         return response;
340 342
     }
343
+
344
+    @Transactional
345
+    @Override
346
+    public ResponseBean modifyUserHeadPortrait(Integer currentUserId, String headPortrait) {
347
+
348
+        ResponseBean response = new ResponseBean();
349
+
350
+        TaUser user = taUserMapper.selectByPrimaryKey(currentUserId);
351
+        user.setHeadPortrait(headPortrait);
352
+
353
+        int result = taUserMapper.updateByPrimaryKeySelective(user);
354
+        if (result > 0) {
355
+            response.addSuccess("修改成功!");
356
+        } else {
357
+          response.addError("修改失败!");
358
+        }
359
+
360
+        return response;
361
+    }
362
+
363
+    @Override
364
+    public ResponseBean getUserInfo(Integer userId) {
365
+
366
+        ResponseBean response = new ResponseBean();
367
+        if (null == userId) {
368
+            response.addError("用户id不存在!");
369
+            return response;
370
+        }
371
+
372
+        // 获取用户
373
+        TaUser user = taUserMapper.selectByPrimaryKey(userId);
374
+        // 获取业主信息
375
+        TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectByPrimaryKey(user.getBuildingOwnerInfoId());
376
+        // 获取小区
377
+        ToCommunities toCommunities = toCommunitiesMapper.selectByPrimaryKey(tpBuildingOwnerInfo.getCommunityId());
378
+
379
+        // 省
380
+        SysNation province = sysNationMapper.selectByPrimaryKey(toCommunities.getProvinceId());
381
+        // 市
382
+        SysNation city = sysNationMapper.selectByPrimaryKey(toCommunities.getCityId());
383
+        // 区
384
+        SysNation district = sysNationMapper.selectByPrimaryKey(toCommunities.getDistrictId());
385
+
386
+        TaUserVO userVO = new TaUserVO();
387
+        BeanUtils.copyProperties(user,userVO);
388
+        userVO.setAddressProvince(province.getProvince()+""+city.getCity()+""+district.getDistrict());
389
+        userVO.setAddressBuilding(tpBuildingOwnerInfo.getBuilding()
390
+                +tpBuildingOwnerInfo.getUnit()
391
+                +tpBuildingOwnerInfo.getLevel()
392
+                +tpBuildingOwnerInfo.getRoomNo());
393
+        userVO.setCommunityName(toCommunities.getCommunityName());
394
+
395
+        response.addSuccess(userVO);
396
+
397
+        return response;
398
+    }
341 399
 }

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java Zobrazit soubor

@@ -43,4 +43,13 @@ public class TaUserVO {
43 43
     /** 用户token **/
44 44
     private String token;
45 45
 
46
+    /** 地址省市区 **/
47
+    private String addressProvince;
48
+
49
+    /** 小区名 **/
50
+    private String communityName;
51
+
52
+    /** 楼栋单元号 **/
53
+    private String addressBuilding;
54
+
46 55
 }

+ 153
- 0
CODE/smart-community/app-api/src/main/resources/mapper/SysNationMapper.xml Zobrazit soubor

@@ -0,0 +1,153 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.SysNationMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.SysNation" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="code" property="code" jdbcType="VARCHAR" />
7
+    <result column="province" property="province" jdbcType="VARCHAR" />
8
+    <result column="city" property="city" jdbcType="VARCHAR" />
9
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
10
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
11
+    <result column="district" property="district" jdbcType="VARCHAR" />
12
+    <result column="last_update_time" property="lastUpdateTime" jdbcType="TIMESTAMP" />
13
+    <result column="operator" property="operator" jdbcType="INTEGER" />
14
+    <result column="operator_ip" property="operatorIp" jdbcType="VARCHAR" />
15
+  </resultMap>
16
+  <sql id="Base_Column_List" >
17
+    id, code, province, city, parent_id, create_time, district, last_update_time, operator, 
18
+    operator_ip
19
+  </sql>
20
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
+    select 
22
+    <include refid="Base_Column_List" />
23
+    from sys_nation
24
+    where id = #{id,jdbcType=INTEGER}
25
+  </select>
26
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
27
+    delete from sys_nation
28
+    where id = #{id,jdbcType=INTEGER}
29
+  </delete>
30
+  <insert id="insert" parameterType="com.community.huiju.model.SysNation" >
31
+    insert into sys_nation (id, code, province, 
32
+      city, parent_id, create_time, 
33
+      district, last_update_time, operator, 
34
+      operator_ip)
35
+    values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, 
36
+      #{city,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
37
+      #{district,jdbcType=VARCHAR}, #{lastUpdateTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=INTEGER}, 
38
+      #{operatorIp,jdbcType=VARCHAR})
39
+  </insert>
40
+  <insert id="insertSelective" parameterType="com.community.huiju.model.SysNation" >
41
+    insert into sys_nation
42
+    <trim prefix="(" suffix=")" suffixOverrides="," >
43
+      <if test="id != null" >
44
+        id,
45
+      </if>
46
+      <if test="code != null" >
47
+        code,
48
+      </if>
49
+      <if test="province != null" >
50
+        province,
51
+      </if>
52
+      <if test="city != null" >
53
+        city,
54
+      </if>
55
+      <if test="parentId != null" >
56
+        parent_id,
57
+      </if>
58
+      <if test="createTime != null" >
59
+        create_time,
60
+      </if>
61
+      <if test="district != null" >
62
+        district,
63
+      </if>
64
+      <if test="lastUpdateTime != null" >
65
+        last_update_time,
66
+      </if>
67
+      <if test="operator != null" >
68
+        operator,
69
+      </if>
70
+      <if test="operatorIp != null" >
71
+        operator_ip,
72
+      </if>
73
+    </trim>
74
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
75
+      <if test="id != null" >
76
+        #{id,jdbcType=INTEGER},
77
+      </if>
78
+      <if test="code != null" >
79
+        #{code,jdbcType=VARCHAR},
80
+      </if>
81
+      <if test="province != null" >
82
+        #{province,jdbcType=VARCHAR},
83
+      </if>
84
+      <if test="city != null" >
85
+        #{city,jdbcType=VARCHAR},
86
+      </if>
87
+      <if test="parentId != null" >
88
+        #{parentId,jdbcType=INTEGER},
89
+      </if>
90
+      <if test="createTime != null" >
91
+        #{createTime,jdbcType=TIMESTAMP},
92
+      </if>
93
+      <if test="district != null" >
94
+        #{district,jdbcType=VARCHAR},
95
+      </if>
96
+      <if test="lastUpdateTime != null" >
97
+        #{lastUpdateTime,jdbcType=TIMESTAMP},
98
+      </if>
99
+      <if test="operator != null" >
100
+        #{operator,jdbcType=INTEGER},
101
+      </if>
102
+      <if test="operatorIp != null" >
103
+        #{operatorIp,jdbcType=VARCHAR},
104
+      </if>
105
+    </trim>
106
+  </insert>
107
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.SysNation" >
108
+    update sys_nation
109
+    <set >
110
+      <if test="code != null" >
111
+        code = #{code,jdbcType=VARCHAR},
112
+      </if>
113
+      <if test="province != null" >
114
+        province = #{province,jdbcType=VARCHAR},
115
+      </if>
116
+      <if test="city != null" >
117
+        city = #{city,jdbcType=VARCHAR},
118
+      </if>
119
+      <if test="parentId != null" >
120
+        parent_id = #{parentId,jdbcType=INTEGER},
121
+      </if>
122
+      <if test="createTime != null" >
123
+        create_time = #{createTime,jdbcType=TIMESTAMP},
124
+      </if>
125
+      <if test="district != null" >
126
+        district = #{district,jdbcType=VARCHAR},
127
+      </if>
128
+      <if test="lastUpdateTime != null" >
129
+        last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
130
+      </if>
131
+      <if test="operator != null" >
132
+        operator = #{operator,jdbcType=INTEGER},
133
+      </if>
134
+      <if test="operatorIp != null" >
135
+        operator_ip = #{operatorIp,jdbcType=VARCHAR},
136
+      </if>
137
+    </set>
138
+    where id = #{id,jdbcType=INTEGER}
139
+  </update>
140
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.SysNation" >
141
+    update sys_nation
142
+    set code = #{code,jdbcType=VARCHAR},
143
+      province = #{province,jdbcType=VARCHAR},
144
+      city = #{city,jdbcType=VARCHAR},
145
+      parent_id = #{parentId,jdbcType=INTEGER},
146
+      create_time = #{createTime,jdbcType=TIMESTAMP},
147
+      district = #{district,jdbcType=VARCHAR},
148
+      last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
149
+      operator = #{operator,jdbcType=INTEGER},
150
+      operator_ip = #{operatorIp,jdbcType=VARCHAR}
151
+    where id = #{id,jdbcType=INTEGER}
152
+  </update>
153
+</mapper>

binární
文档/需求/app接口需求-第二版.xlsx Zobrazit soubor