作者 shenhailong

完善电表充值机逻辑

@@ -71,7 +71,10 @@ spring: @@ -71,7 +71,10 @@ spring:
71 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码 71 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
72 #url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true 72 #url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true
73 url: jdbc:mysql://118.31.66.166:3306/EMPT?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai 73 url: jdbc:mysql://118.31.66.166:3306/EMPT?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
  74 +# url: jdbc:mysql://192.168.1.7:10098/empt?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
  75 +# username: shl
74 username: 110 76 username: 110
  77 +# password: vmvnv1v2VV
75 password: QAHqCJf2kFYCLirM 78 password: QAHqCJf2kFYCLirM
76 driver-class-name: com.mysql.cj.jdbc.Driver 79 driver-class-name: com.mysql.cj.jdbc.Driver
77 max-idle: 20 80 max-idle: 20
@@ -137,7 +140,7 @@ logging: @@ -137,7 +140,7 @@ logging:
137 file: 140 file:
138 path: ./logs/ 141 path: ./logs/
139 name: system.log 142 name: system.log
140 - config: classpath:logback-dev.xml 143 + config: config/logback-dev.xml
141 #转移到logback配置文件中 144 #转移到logback配置文件中
142 #level: 145 #level:
143 #org.apache.tomcat: info 146 #org.apache.tomcat: info
@@ -168,3 +171,15 @@ devops: @@ -168,3 +171,15 @@ devops:
168 #10079 171 #10079
169 eeid: 172 eeid:
170 ipAddress: 192.168.50.23 173 ipAddress: 192.168.50.23
  174 +#电表所需要接口
  175 +eeUrl:
  176 + #电表充值路径
  177 + rechargeDevicesUrl: "http://10.5.10.102:8000/api/emcs/rechargeDevices"
  178 +# rechargeDevicesUrl: "http://192.168.1.7:18080/api/emcs/rechargeDevices"
  179 + #获取电表实时数据/余额
  180 + electricityBanlanceUrl: "http://10.5.10.102:8000/api/emcs/getEnergyInfoForRealTime"
  181 +# electricityBanlanceUrl: "http://192.168.1.7:18080/api/emcs/getEnergyInfoForRealTime"
  182 + #获取设备跟公寓信息
  183 + getRoomAndDeviceUrl: "http://10.5.10.102:8000/api/emcs/getRoomAndDevice"
  184 +# getRoomAndDeviceUrl: "http://192.168.1.7:18080/api/emcs/getRoomAndDevice"
  185 +
1 package com.sunyo.energy.location.controller; 1 package com.sunyo.energy.location.controller;
2 2
3 -import com.github.pagehelper.PageInfo;  
4 import com.sunyo.energy.location.controller.response.ResultJson; 3 import com.sunyo.energy.location.controller.response.ResultJson;
5 import com.sunyo.energy.location.dao.LocationMapper; 4 import com.sunyo.energy.location.dao.LocationMapper;
6 -import com.sunyo.energy.location.model.PayRecords;  
7 -import com.sunyo.energy.location.model.WaterElectricityParameter;  
8 import com.sunyo.energy.location.service.LocationService; 5 import com.sunyo.energy.location.service.LocationService;
9 -import com.sunyo.energy.location.service.WaterElectricityParameterService;  
10 import com.sunyo.energy.location.service.WaterMeterService; 6 import com.sunyo.energy.location.service.WaterMeterService;
11 import io.swagger.annotations.Api; 7 import io.swagger.annotations.Api;
12 import io.swagger.annotations.ApiOperation; 8 import io.swagger.annotations.ApiOperation;
@@ -17,7 +13,9 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -17,7 +13,9 @@ import org.springframework.web.bind.annotation.RequestParam;
17 import org.springframework.web.bind.annotation.RestController; 13 import org.springframework.web.bind.annotation.RestController;
18 14
19 import java.io.UnsupportedEncodingException; 15 import java.io.UnsupportedEncodingException;
  16 +import java.util.HashMap;
20 import java.util.List; 17 import java.util.List;
  18 +import java.util.Map;
21 19
22 @Api(description = "用户支付管理") 20 @Api(description = "用户支付管理")
23 @RestController 21 @RestController
@@ -30,6 +28,9 @@ public class UserPayController { @@ -30,6 +28,9 @@ public class UserPayController {
30 @Autowired 28 @Autowired
31 private WaterMeterService waterMeterService; 29 private WaterMeterService waterMeterService;
32 30
  31 + @Autowired
  32 + private LocationMapper locationMapper;
  33 +
33 @ApiOperation(value = "查看缴费房间") 34 @ApiOperation(value = "查看缴费房间")
34 @RequestMapping("/list") 35 @RequestMapping("/list")
35 public List userPayList(@RequestParam(value = "roomNumber", required = false) String roomNumber ){ 36 public List userPayList(@RequestParam(value = "roomNumber", required = false) String roomNumber ){
@@ -57,4 +58,17 @@ public class UserPayController { @@ -57,4 +58,17 @@ public class UserPayController {
57 return resultJson; 58 return resultJson;
58 } 59 }
59 60
  61 + @ApiOperation(value = "钉钉小程序请求水电返回数据")
  62 + @PostMapping("/mincData")
  63 + public Map<String, Object> mincData(@RequestParam(value = "loginName", required = false) String loginName){
  64 +
  65 + Map<String, Object> map = new HashMap<>();
  66 + /**
  67 + * 查询该账号所绑定的水电编号
  68 + */
  69 +
  70 +
  71 + return map;
  72 + }
  73 +
60 } 74 }
@@ -38,4 +38,7 @@ public interface LocationMapper { @@ -38,4 +38,7 @@ public interface LocationMapper {
38 38
39 String eeId(String roomNumber); 39 String eeId(String roomNumber);
40 40
  41 + int editEeId(@Param(value = "name") String name,
  42 + @Param(value = "deviceId") String deviceId);
  43 +
41 } 44 }
  1 +package com.sunyo.energy.location.dao;
  2 +
  3 +import com.sunyo.energy.location.model.USERS;
  4 +
  5 +public interface USERSMapper {
  6 + int deleteByPrimaryKey(Integer userId);
  7 +
  8 + int insert(USERS record);
  9 +
  10 + int insertSelective(USERS record);
  11 +
  12 + USERS selectByPrimaryKey(Integer userId);
  13 +
  14 + int updateByPrimaryKeySelective(USERS record);
  15 +
  16 + int updateByPrimaryKey(USERS record);
  17 +}
@@ -18,19 +18,41 @@ public class QrDemo { @@ -18,19 +18,41 @@ public class QrDemo {
18 18
19 public static String orUrl(String orderId, String payMent) throws UnsupportedEncodingException { 19 public static String orUrl(String orderId, String payMent) throws UnsupportedEncodingException {
20 String bankURL="https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain"; 20 String bankURL="https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain";
21 -  
22 - String MERCHANTID = "105001453995827";  
23 - String POSID = "031575220"; 21 + /**
  22 + * 商户代码
  23 + */
  24 + String MERCHANTID = "105000045820502";
  25 +// String MERCHANTID = "105001453995827";
  26 + /**
  27 + * 商户柜台代码
  28 + */
  29 + String POSID = "049347762";
  30 +// String POSID = "031575220";
  31 + /**
  32 + * 分行代码
  33 + */
  34 +// String BRANCHID = "410803805";
24 String BRANCHID = "410000000"; 35 String BRANCHID = "410000000";
25 -// String ORDERID = "1050014539958271238454321";  
26 -// String PAYMENT= "0.01"; 36 + /**
  37 + * 货币种类 01 人民币 只支持人民币
  38 + */
27 String CURCODE="01"; 39 String CURCODE="01";
  40 + /**
  41 + * 交易码
  42 + */
28 String TXCODE = "530550"; 43 String TXCODE = "530550";
29 String REMARK1 = ""; 44 String REMARK1 = "";
30 String REMARK2 = ""; 45 String REMARK2 = "";
  46 + /**
  47 + * 返回类型
  48 + */
31 String RETURNTYPE="3"; 49 String RETURNTYPE="3";
32 String TIMEOUT = ""; 50 String TIMEOUT = "";
33 - String PUB32TR2= "8578d1cd9340dba556126a71020111"; 51 + /**
  52 + * 应柜台的公钥后30位
  53 + */
  54 + String PUB32TR2= "57b3055539f4925efaf9dacb020111";
  55 +// String PUB32TR2= "8578d1cd9340dba556126a71020111";
34 56
35 StringBuffer tmp = new StringBuffer(); //ÑéÇ©×Ö¶Î 57 StringBuffer tmp = new StringBuffer(); //ÑéÇ©×Ö¶Î
36 tmp.append("MERCHANTID="); 58 tmp.append("MERCHANTID=");
@@ -8,9 +8,11 @@ public class QrURLDemo { @@ -8,9 +8,11 @@ public class QrURLDemo {
8 public String getSUCCESS() { 8 public String getSUCCESS() {
9 return SUCCESS; 9 return SUCCESS;
10 } 10 }
  11 +
11 public void setSUCCESS(String success) { 12 public void setSUCCESS(String success) {
12 SUCCESS = success; 13 SUCCESS = success;
13 } 14 }
  15 +
14 public String getPAYURL() { 16 public String getPAYURL() {
15 return PAYURL; 17 return PAYURL;
16 } 18 }
  1 +package com.sunyo.energy.location.model;
  2 +
  3 +import java.util.Date;
  4 +
  5 +public class USERS {
  6 + private Integer userId;
  7 +
  8 + private String username;
  9 +
  10 + private String password;
  11 +
  12 + private Date birthday;
  13 +
  14 + private String sex;
  15 +
  16 + private String address;
  17 +
  18 + private Boolean state;
  19 +
  20 + private String mobilephone;
  21 +
  22 + private Date creattime;
  23 +
  24 + private Date updatetime;
  25 +
  26 + private String userface;
  27 +
  28 + private String realname;
  29 +
  30 + private String email;
  31 +
  32 + private Integer age;
  33 +
  34 + private Integer companyId;
  35 +
  36 + public Integer getUserId() {
  37 + return userId;
  38 + }
  39 +
  40 + public void setUserId(Integer userId) {
  41 + this.userId = userId;
  42 + }
  43 +
  44 + public String getUsername() {
  45 + return username;
  46 + }
  47 +
  48 + public void setUsername(String username) {
  49 + this.username = username == null ? null : username.trim();
  50 + }
  51 +
  52 + public String getPassword() {
  53 + return password;
  54 + }
  55 +
  56 + public void setPassword(String password) {
  57 + this.password = password == null ? null : password.trim();
  58 + }
  59 +
  60 + public Date getBirthday() {
  61 + return birthday;
  62 + }
  63 +
  64 + public void setBirthday(Date birthday) {
  65 + this.birthday = birthday;
  66 + }
  67 +
  68 + public String getSex() {
  69 + return sex;
  70 + }
  71 +
  72 + public void setSex(String sex) {
  73 + this.sex = sex == null ? null : sex.trim();
  74 + }
  75 +
  76 + public String getAddress() {
  77 + return address;
  78 + }
  79 +
  80 + public void setAddress(String address) {
  81 + this.address = address == null ? null : address.trim();
  82 + }
  83 +
  84 + public Boolean getState() {
  85 + return state;
  86 + }
  87 +
  88 + public void setState(Boolean state) {
  89 + this.state = state;
  90 + }
  91 +
  92 + public String getMobilephone() {
  93 + return mobilephone;
  94 + }
  95 +
  96 + public void setMobilephone(String mobilephone) {
  97 + this.mobilephone = mobilephone == null ? null : mobilephone.trim();
  98 + }
  99 +
  100 + public Date getCreattime() {
  101 + return creattime;
  102 + }
  103 +
  104 + public void setCreattime(Date creattime) {
  105 + this.creattime = creattime;
  106 + }
  107 +
  108 + public Date getUpdatetime() {
  109 + return updatetime;
  110 + }
  111 +
  112 + public void setUpdatetime(Date updatetime) {
  113 + this.updatetime = updatetime;
  114 + }
  115 +
  116 + public String getUserface() {
  117 + return userface;
  118 + }
  119 +
  120 + public void setUserface(String userface) {
  121 + this.userface = userface == null ? null : userface.trim();
  122 + }
  123 +
  124 + public String getRealname() {
  125 + return realname;
  126 + }
  127 +
  128 + public void setRealname(String realname) {
  129 + this.realname = realname == null ? null : realname.trim();
  130 + }
  131 +
  132 + public String getEmail() {
  133 + return email;
  134 + }
  135 +
  136 + public void setEmail(String email) {
  137 + this.email = email == null ? null : email.trim();
  138 + }
  139 +
  140 + public Integer getAge() {
  141 + return age;
  142 + }
  143 +
  144 + public void setAge(Integer age) {
  145 + this.age = age;
  146 + }
  147 +
  148 + public Integer getCompanyId() {
  149 + return companyId;
  150 + }
  151 +
  152 + public void setCompanyId(Integer companyId) {
  153 + this.companyId = companyId;
  154 + }
  155 +}
1 package com.sunyo.energy.location.service.imp; 1 package com.sunyo.energy.location.service.imp;
2 2
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 -import com.sunyo.energy.location.dao.ElectricityInfoMapper;  
5 -import com.sunyo.energy.location.dao.PayRecordsMapper; 4 +import com.sunyo.energy.location.dao.*;
6 import com.sunyo.energy.location.model.*; 5 import com.sunyo.energy.location.model.*;
7 import com.sunyo.energy.location.service.ElectricityMeterService; 6 import com.sunyo.energy.location.service.ElectricityMeterService;
8 import com.sunyo.energy.location.utils.HttpsUtils; 7 import com.sunyo.energy.location.utils.HttpsUtils;
@@ -29,10 +28,19 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { @@ -29,10 +28,19 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
29 @Autowired 28 @Autowired
30 PayRecordsMapper payRecordsMapper; 29 PayRecordsMapper payRecordsMapper;
31 30
  31 + @Autowired
  32 + LocationMapper locationMapper;
  33 +
  34 + @Autowired
  35 + USERSMapper usersMapper;
  36 +
  37 +
  38 +
32 /** 39 /**
33 * 获取电表实时数据/余额 40 * 获取电表实时数据/余额
34 */ 41 */
35 - private final static String electricityBanlanceUrl = "http://192.168.1.2:18080/api/emcs/getEnergyInfoForRealTime"; 42 + @Value("${eeUrl.electricityBanlanceUrl}")
  43 + private String electricityBanlanceUrl;
36 44
37 /** 45 /**
38 * 电表充值接口读取配置文件ip地址 46 * 电表充值接口读取配置文件ip地址
@@ -42,11 +50,13 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { @@ -42,11 +50,13 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
42 /** 50 /**
43 * 电表充值接口地址 51 * 电表充值接口地址
44 */ 52 */
45 - private final static String rechargeDevicesUrl = "http://192.168.1.2:18080/api/emcs/rechargeDevices"; 53 + @Value("${eeUrl.rechargeDevicesUrl}")
  54 + private String rechargeDevicesUrl;
46 /** 55 /**
47 * 获取设备跟公寓信息 56 * 获取设备跟公寓信息
48 */ 57 */
49 - private final static String getRoomAndDeviceUrl = "http://192.168.1.2:18080/api/emcs/getRoomAndDevice"; 58 + @Value("${eeUrl.getRoomAndDeviceUrl}")
  59 + private String getRoomAndDeviceUrl;
50 60
51 /** 61 /**
52 * 实施获取电表数据 62 * 实施获取电表数据
@@ -135,7 +145,7 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { @@ -135,7 +145,7 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
135 /** 145 /**
136 * 定时读取电表临时表 发起充值 146 * 定时读取电表临时表 发起充值
137 */ 147 */
138 - @Scheduled(fixedDelay = 5000) 148 + @Scheduled(fixedDelay = 30000)
139 public void electricityInfo(){ 149 public void electricityInfo(){
140 List<ElectricityInfo> electricityInfos = electricityInfoMapper.selectAll(""); 150 List<ElectricityInfo> electricityInfos = electricityInfoMapper.selectAll("");
141 if (electricityInfos.size() > 0){ 151 if (electricityInfos.size() > 0){
@@ -173,4 +183,23 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { @@ -173,4 +183,23 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
173 map.put("ipAddress", ip_address); 183 map.put("ipAddress", ip_address);
174 return map; 184 return map;
175 } 185 }
  186 +
  187 +
  188 + /**
  189 + * 批量添加用户
  190 + */
  191 +// @Scheduled(fixedDelay = 10000)
  192 + public void loginName() throws Exception {
  193 + Map<String, Object> stringObjectMap = new HashMap<>();
  194 + String s = HttpsUtils.sendPostHttpRequest("http://192.168.1.7:18080/api/emcs/getRoomAndDevice", "");
  195 + List<ElectricityRoomDeviceThree> datas = JSON.parseObject(s, ElectricityRoomDeviceOne.class).getData().getDatas();
  196 + for (ElectricityRoomDeviceThree electricityRoomDeviceThree: datas){
  197 + USERS users = new USERS();
  198 + users.setUserId(electricityRoomDeviceThree.getRoomId());
  199 + users.setUsername(electricityRoomDeviceThree.getRoomName());
  200 + users.setPassword(Md5Utils.getMD5("ZZAIRPORT20200631@EMPT", true, 32));
  201 + usersMapper.insertSelective(users);
  202 + }
  203 +
  204 + }
176 } 205 }
@@ -153,4 +153,10 @@ @@ -153,4 +153,10 @@
153 type = #{type,jdbcType=INTEGER} 153 type = #{type,jdbcType=INTEGER}
154 where id = #{id,jdbcType=INTEGER} 154 where id = #{id,jdbcType=INTEGER}
155 </update> 155 </update>
  156 +
  157 + <update id="editEeId" parameterType="string">
  158 + update location
  159 + set ee_id = #{deviceId,jdbcType=VARCHAR}
  160 + where adrName = #{name,jdbcType=INTEGER}
  161 + </update>
156 </mapper> 162 </mapper>
  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.sunyo.energy.location.dao.USERSMapper" >
  4 + <resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.USERS" >
  5 + <id column="user_id" property="userId" jdbcType="INTEGER" />
  6 + <result column="username" property="username" jdbcType="VARCHAR" />
  7 + <result column="password" property="password" jdbcType="VARCHAR" />
  8 + <result column="birthday" property="birthday" jdbcType="TIMESTAMP" />
  9 + <result column="sex" property="sex" jdbcType="CHAR" />
  10 + <result column="address" property="address" jdbcType="VARCHAR" />
  11 + <result column="state" property="state" jdbcType="BIT" />
  12 + <result column="mobilePhone" property="mobilephone" jdbcType="VARCHAR" />
  13 + <result column="creatTime" property="creattime" jdbcType="TIMESTAMP" />
  14 + <result column="updateTime" property="updatetime" jdbcType="TIMESTAMP" />
  15 + <result column="userFace" property="userface" jdbcType="VARCHAR" />
  16 + <result column="realName" property="realname" jdbcType="VARCHAR" />
  17 + <result column="email" property="email" jdbcType="VARCHAR" />
  18 + <result column="age" property="age" jdbcType="INTEGER" />
  19 + <result column="company_id" property="companyId" jdbcType="INTEGER" />
  20 + </resultMap>
  21 + <sql id="Base_Column_List" >
  22 + user_id, username, password, birthday, sex, address, state, mobilePhone, creatTime,
  23 + updateTime, userFace, realName, email, age, company_id
  24 + </sql>
  25 + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  26 + select
  27 + <include refid="Base_Column_List" />
  28 + from users
  29 + where user_id = #{userId,jdbcType=INTEGER}
  30 + </select>
  31 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  32 + delete from users
  33 + where user_id = #{userId,jdbcType=INTEGER}
  34 + </delete>
  35 + <insert id="insert" parameterType="com.sunyo.energy.location.model.USERS" >
  36 + insert into users (user_id, username, password,
  37 + birthday, sex, address,
  38 + state, mobilePhone, creatTime,
  39 + updateTime, userFace, realName,
  40 + email, age, company_id
  41 + )
  42 + values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  43 + #{birthday,jdbcType=TIMESTAMP}, #{sex,jdbcType=CHAR}, #{address,jdbcType=VARCHAR},
  44 + #{state,jdbcType=BIT}, #{mobilephone,jdbcType=VARCHAR}, #{creattime,jdbcType=TIMESTAMP},
  45 + #{updatetime,jdbcType=TIMESTAMP}, #{userface,jdbcType=VARCHAR}, #{realname,jdbcType=VARCHAR},
  46 + #{email,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}
  47 + )
  48 + </insert>
  49 + <insert id="insertSelective" parameterType="com.sunyo.energy.location.model.USERS" >
  50 + insert into users
  51 + <trim prefix="(" suffix=")" suffixOverrides="," >
  52 + <if test="userId != null" >
  53 + user_id,
  54 + </if>
  55 + <if test="username != null" >
  56 + username,
  57 + </if>
  58 + <if test="password != null" >
  59 + password,
  60 + </if>
  61 + <if test="birthday != null" >
  62 + birthday,
  63 + </if>
  64 + <if test="sex != null" >
  65 + sex,
  66 + </if>
  67 + <if test="address != null" >
  68 + address,
  69 + </if>
  70 + <if test="state != null" >
  71 + state,
  72 + </if>
  73 + <if test="mobilephone != null" >
  74 + mobilePhone,
  75 + </if>
  76 + <if test="creattime != null" >
  77 + creatTime,
  78 + </if>
  79 + <if test="updatetime != null" >
  80 + updateTime,
  81 + </if>
  82 + <if test="userface != null" >
  83 + userFace,
  84 + </if>
  85 + <if test="realname != null" >
  86 + realName,
  87 + </if>
  88 + <if test="email != null" >
  89 + email,
  90 + </if>
  91 + <if test="age != null" >
  92 + age,
  93 + </if>
  94 + <if test="companyId != null" >
  95 + company_id,
  96 + </if>
  97 + </trim>
  98 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  99 + <if test="userId != null" >
  100 + #{userId,jdbcType=INTEGER},
  101 + </if>
  102 + <if test="username != null" >
  103 + #{username,jdbcType=VARCHAR},
  104 + </if>
  105 + <if test="password != null" >
  106 + #{password,jdbcType=VARCHAR},
  107 + </if>
  108 + <if test="birthday != null" >
  109 + #{birthday,jdbcType=TIMESTAMP},
  110 + </if>
  111 + <if test="sex != null" >
  112 + #{sex,jdbcType=CHAR},
  113 + </if>
  114 + <if test="address != null" >
  115 + #{address,jdbcType=VARCHAR},
  116 + </if>
  117 + <if test="state != null" >
  118 + #{state,jdbcType=BIT},
  119 + </if>
  120 + <if test="mobilephone != null" >
  121 + #{mobilephone,jdbcType=VARCHAR},
  122 + </if>
  123 + <if test="creattime != null" >
  124 + #{creattime,jdbcType=TIMESTAMP},
  125 + </if>
  126 + <if test="updatetime != null" >
  127 + #{updatetime,jdbcType=TIMESTAMP},
  128 + </if>
  129 + <if test="userface != null" >
  130 + #{userface,jdbcType=VARCHAR},
  131 + </if>
  132 + <if test="realname != null" >
  133 + #{realname,jdbcType=VARCHAR},
  134 + </if>
  135 + <if test="email != null" >
  136 + #{email,jdbcType=VARCHAR},
  137 + </if>
  138 + <if test="age != null" >
  139 + #{age,jdbcType=INTEGER},
  140 + </if>
  141 + <if test="companyId != null" >
  142 + #{companyId,jdbcType=INTEGER},
  143 + </if>
  144 + </trim>
  145 + </insert>
  146 + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.USERS" >
  147 + update users
  148 + <set >
  149 + <if test="username != null" >
  150 + username = #{username,jdbcType=VARCHAR},
  151 + </if>
  152 + <if test="password != null" >
  153 + password = #{password,jdbcType=VARCHAR},
  154 + </if>
  155 + <if test="birthday != null" >
  156 + birthday = #{birthday,jdbcType=TIMESTAMP},
  157 + </if>
  158 + <if test="sex != null" >
  159 + sex = #{sex,jdbcType=CHAR},
  160 + </if>
  161 + <if test="address != null" >
  162 + address = #{address,jdbcType=VARCHAR},
  163 + </if>
  164 + <if test="state != null" >
  165 + state = #{state,jdbcType=BIT},
  166 + </if>
  167 + <if test="mobilephone != null" >
  168 + mobilePhone = #{mobilephone,jdbcType=VARCHAR},
  169 + </if>
  170 + <if test="creattime != null" >
  171 + creatTime = #{creattime,jdbcType=TIMESTAMP},
  172 + </if>
  173 + <if test="updatetime != null" >
  174 + updateTime = #{updatetime,jdbcType=TIMESTAMP},
  175 + </if>
  176 + <if test="userface != null" >
  177 + userFace = #{userface,jdbcType=VARCHAR},
  178 + </if>
  179 + <if test="realname != null" >
  180 + realName = #{realname,jdbcType=VARCHAR},
  181 + </if>
  182 + <if test="email != null" >
  183 + email = #{email,jdbcType=VARCHAR},
  184 + </if>
  185 + <if test="age != null" >
  186 + age = #{age,jdbcType=INTEGER},
  187 + </if>
  188 + <if test="companyId != null" >
  189 + company_id = #{companyId,jdbcType=INTEGER},
  190 + </if>
  191 + </set>
  192 + where user_id = #{userId,jdbcType=INTEGER}
  193 + </update>
  194 + <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.USERS" >
  195 + update users
  196 + set username = #{username,jdbcType=VARCHAR},
  197 + password = #{password,jdbcType=VARCHAR},
  198 + birthday = #{birthday,jdbcType=TIMESTAMP},
  199 + sex = #{sex,jdbcType=CHAR},
  200 + address = #{address,jdbcType=VARCHAR},
  201 + state = #{state,jdbcType=BIT},
  202 + mobilePhone = #{mobilephone,jdbcType=VARCHAR},
  203 + creatTime = #{creattime,jdbcType=TIMESTAMP},
  204 + updateTime = #{updatetime,jdbcType=TIMESTAMP},
  205 + userFace = #{userface,jdbcType=VARCHAR},
  206 + realName = #{realname,jdbcType=VARCHAR},
  207 + email = #{email,jdbcType=VARCHAR},
  208 + age = #{age,jdbcType=INTEGER},
  209 + company_id = #{companyId,jdbcType=INTEGER}
  210 + where user_id = #{userId,jdbcType=INTEGER}
  211 + </update>
  212 +</mapper>