From 6f602b179c34d7dc861ddad52ff4e90fe7e9cff1 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Wed, 12 Sep 2018 12:49:12 +0800 Subject: [PATCH] =?UTF-8?q?[C=E7=AB=AF=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E7=BB=9F=E8=AE=A1][=E6=96=B0=E5=A2=9E]:C?= =?UTF-8?q?=E7=AB=AF=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/simple/domain/po/WxCUser.java | 11 + .../service/impl/WxCUserServiceImpl.java | 2 + .../main/resources/mapper/WxCUserMapper.xml | 389 +++++++++--------- 3 files changed, 202 insertions(+), 200 deletions(-) diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java b/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java index 72c9c9ad4..196d09c45 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java @@ -122,6 +122,9 @@ public class WxCUser implements Serializable { /*纬度**/ @io.swagger.annotations.ApiModelProperty(value="纬度",name="latitude") private BigDecimal latitude; + /*登录次数**/ + @io.swagger.annotations.ApiModelProperty(value="登录次数",name="loginCount") + private Integer loginCount; //渠道名称 @Transient @@ -297,6 +300,14 @@ public class WxCUser implements Serializable { this.latitude = latitude; } + public Integer getLoginCount() { + return loginCount; + } + + public void setLoginCount(Integer loginCount) { + this.loginCount = loginCount; + } + public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxCUserServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxCUserServiceImpl.java index 70f37bc97..2aa324dc6 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxCUserServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxCUserServiceImpl.java @@ -46,10 +46,12 @@ public class WxCUserServiceImpl implements WxCUserService { //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); final IdWorker idWorker = IdWorker.get(); user.setId(idWorker.nextId()); + user.setLoginCount(1); user.setCreateDate(curr); user.setUpdateDate(curr); ret = wxCUserMapper.insertSelective(user); } else { + user.setLoginCount(user.getLoginCount() + 1); user.setUpdateDate(curr); ret =wxCUserMapper.updateByPrimaryKeySelective(user); } diff --git a/mallinkService/src/main/resources/mapper/WxCUserMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserMapper.xml index 6980fb8a8..a8f730304 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserMapper.xml @@ -1,214 +1,203 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - `id`,`tenant_id`,`open_id`,`union_id`,`nick_name`,`gender`,`avatar_url`,`phone`,`pure_phone`,`city`,`province`,`language`,`country_code`,`register_ip`,`verify_code_phone`,`qrcode_source`,`scene`,`scene_address`,`session_key`,`score`,`update_date`,`create_date`,`app_id`,`token`,`expire_time` - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - where 1 = 1 - - - and `id` = #{id} - - - - - and `tenant_id` like concat('%', #{tenantId},'%') - - - - - and `open_id` like concat('%', #{openId},'%') - - - - - and `union_id` like concat('%', #{unionId},'%') - - - - - and `nick_name` like concat('%', #{nickName},'%') - - - - - and `gender` = #{gender} - - - - - and `avatar_url` like concat('%', #{avatarUrl},'%') - - - - - and `phone` like concat('%', #{phone},'%') - - - - - and `pure_phone` like concat('%', #{purePhone},'%') - - - - - and `city` like concat('%', #{city},'%') - - - - - and `province` like concat('%', #{province},'%') - - - - - and `language` like concat('%', #{language},'%') - - - - - and `country_code` like concat('%', #{countryCode},'%') - - - - - and `register_ip` like concat('%', #{registerIp},'%') - - - - - and `verify_code_phone` like concat('%', #{verifyCodePhone},'%') - - - - - and `qrcode_source` like concat('%', #{qrcodeSource},'%') - - - - - and `scene` like concat('%', #{scene},'%') - - - - - and `scene_address` like concat('%', #{sceneAddress},'%') - - - - - and `session_key` like concat('%', #{sessionKey},'%') - - - - - and `score` = #{score} - - - - - and `update_date` = #{updateDate} - - - - - and `create_date` = #{createDate} - - - - - and `app_id` like concat('%', #{appId},'%') - - - - - and `token` like concat('%', #{token},'%') - - - - - and `expire_time` = #{expireTime} - - - - and id in - - #{idItem} - - - order by ${sortColumns} + + `id`,`tenant_id`,`open_id`,`union_id`,`nick_name`,`gender`,`avatar_url`,`phone`,`pure_phone`,`city`,`province`,`language`,`country_code`,`register_ip`,`verify_code_phone`,`qrcode_source`,`scene`,`scene_address`,`session_key`,`score`,`update_date`,`create_date`,`app_id`,`token`,`expire_time`,`latitude`, `longitude`, `login_count` - - - + select + + from wx_c_user + + + + - select * from wx_c_user where `token` = #{token} - - - - - - + + + + + +