Commit 4e72dfb7 by XiaHou

云应用相关的业务代码

parent 12ac5402
......@@ -35,4 +35,11 @@ public class AppleController extends BaseController {
public JsonResult appleInsertUserParam(@ApiParam(value = "传入对象") @RequestBody AppleInsertUserParam appleInsertUserParam) {
return this.atlAppleService.appleInsertUserParam(appleInsertUserParam);
}
@ApiOperation("通过identityToken解析 不绑定手机号登录 可能会导致业务失效,慎用")
@RequestMapping(value = "/identityTokenLoginNotBindMobile", method = RequestMethod.GET)
@ResponseBody
public JsonResult identityTokenLoginNotBindMobile(@ApiParam(value = "苹果identityToken", required = true) @RequestParam(value = "identityToken", required = true) String identityToken) {
return atlAppleService.identityTokenLoginNotBindMobile(identityToken);
}
}
package com.hwstudio.antaile.queryparam;
import lombok.Data;
import java.io.Serializable;
/**
* @Author xh
* @Date 2021/8/26
* description:
*/
@Data
public class QueryRandomAtlTimeParam implements Serializable {
}
......@@ -6,7 +6,6 @@ import com.hwstudio.antaile.common.Constants;
import com.hwstudio.antaile.dto.AppleInsertUserParam;
import com.hwstudio.antaile.dto.AppleLoginDTO;
import com.hwstudio.antaile.dto.LoginUserDto;
import com.hwstudio.antaile.dto.WxInsertUserParam;
import com.hwstudio.antaile.entity.AtlUser;
import com.hwstudio.antaile.entity.Sms;
import com.hwstudio.antaile.exception.BusinessException;
......@@ -17,6 +16,7 @@ import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.utils.RedisUtil;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
......@@ -90,9 +90,9 @@ public class AtlAppleService {
atlUser.setAppleSub(appleInsertUserParam.getAppleSub());
this.atlUserMapper.updateUser(atlUser);
//赋值给insertAtlUser对象
BeanUtils.copyProperties(atlUser,insertAtlUser );
BeanUtils.copyProperties(atlUser, insertAtlUser);
} else {
String nickName = appleInsertUserParam.getMobilePhone().substring(0, 3) + "****" + appleInsertUserParam.getMobilePhone().substring(7, appleInsertUserParam.getMobilePhone().length());;
String nickName = appleInsertUserParam.getMobilePhone().substring(0, 3) + "****" + appleInsertUserParam.getMobilePhone().substring(7, appleInsertUserParam.getMobilePhone().length());
insertAtlUser.setAvaterImageUrl(nickName);
insertAtlUser.setState(1);
insertAtlUser.setMobilePhone(appleInsertUserParam.getMobilePhone());
......@@ -117,6 +117,48 @@ public class AtlAppleService {
}
/**
* 通过identityToken解析 不绑定手机号登录 可能会导致业务失效,慎用
*
* @param identityToken
* @return
*/
@Transactional(rollbackFor = Exception.class)
public JsonResult identityTokenLoginNotBindMobile(String identityToken) {
JSONObject object = AppleUtil.parserIdentityToken(identityToken);
AppleLoginDTO appleLoginDTO = object.toJavaObject(AppleLoginDTO.class);
if (appleLoginDTO == null) {
return JsonResult.failed("获取apple Sub异常");
}
if (appleLoginDTO.getSub() == null || appleLoginDTO.getSub().isEmpty()) {
return JsonResult.failed("传入苹果token有误,获取sub失败");
}
AtlUser atlUser = atlUserMapper.getByAppleSub(appleLoginDTO.getSub());
//登录返回对象
LoginUserDto loginUserDto = new LoginUserDto();
String token = UUID.randomUUID().toString();
if (atlUser == null) {
//如果为空 需要插入登录
atlUser = new AtlUser();
String nickName = "atl" + token.substring(0,10 );
atlUser.setNickName(nickName);
atlUser.setState(1);
atlUser.setAppleSub(appleLoginDTO.getSub());
atlUser.setLoginDate(new Date());
this.atlUserMapper.insert(atlUser);
} else {
//否则有查询到 就登录成功
loginUserDto.setAvatarUrl(atlUser.getAvaterImageUrl());
loginUserDto.setNickName(atlUser.getNickName());
loginUserDto.setPhone(atlUser.getMobilePhone());
}
redisUtil.set(token, atlUser, Long.valueOf(604800));
loginUserDto.setToken(token);
loginUserDto.setUserId(atlUser.getId());
loginUserDto.setAppleSub(atlUser.getAppleSub());
return JsonResult.success("登录成功", loginUserDto);
}
/**
* 校验传入参数
*
* @param appleInsertUserParam
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hwstudio.antaile.mapper.AtlUserMapper">
<select id="getAllUser" resultType="com.hwstudio.antaile.entity.AtlUser">
<select id="getAllUser" resultType="com.hwstudio.antaile.entity.AtlUser">
SELECT * FROM atl_user
</select>
<select id="getByMobile" resultType="com.hwstudio.antaile.entity.AtlUser">
<select id="getByMobile" resultType="com.hwstudio.antaile.entity.AtlUser">
SELECT * FROM atl_user WHERE mobile_phone= #{mobile} and state = '1'
</select>
<insert id="registerMobile" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
INSERT INTO atl_user(mobile_phone, login_password , create_time, nick_name, clientId, is_sys_push, is_sc_push, is_rem_push
<if test="fromTimeid != null">
,from_timeid
</if>
<if test="fromUserid != null">
,from_userid
</if>
)
VALUES(#{mobilePhone}, #{loginPassword}, NOW(), #{nickName}, #{clientId}, '0', '0', '0'
<if test="fromTimeid != null">
,#{fromTimeid}
</if>
<if test="fromUserid != null">
,#{fromUserid}
</if>
)
</insert>
<insert id="registerMobile" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
INSERT INTO atl_user(mobile_phone, login_password , create_time, nick_name, clientId, is_sys_push, is_sc_push,
is_rem_push
<if test="fromTimeid != null">
,from_timeid
</if>
<if test="fromUserid != null">
,from_userid
</if>
)
VALUES(#{mobilePhone}, #{loginPassword}, NOW(), #{nickName}, #{clientId}, '0', '0', '0'
<if test="fromTimeid != null">
,#{fromTimeid}
</if>
<if test="fromUserid != null">
,#{fromUserid}
</if>
)
</insert>
<select id="getUserInfo" resultType="com.hwstudio.antaile.dto.AtlUserInfoDto">
<select id="getUserInfo" resultType="com.hwstudio.antaile.dto.AtlUserInfoDto">
SELECT id, birthday_type as birthdayType,nick_name AS nickName, avater_image_url AS avaterImageUrl, DATE_FORMAT(birthday, '%Y-%m-%d') AS birthday,
signature, sex, mobile_phone as phone, open_id AS openId, is_sys_push as isSysPush, is_sc_push as isScPush, is_rem_push as isRemPush
FROM atl_user
WHERE id = #{userId}
</select>
<update id="updateUser" parameterType="com.hwstudio.antaile.entity.AtlUser">
update atl_user
<set>
<if test="nickName != null">
nick_name = #{nickName,jdbcType=VARCHAR},
</if>
<if test="realName != null">
real_name = #{realName,jdbcType=VARCHAR},
</if>
<if test="mobilePhone != null">
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if test="loginPassword != null">
login_password = #{loginPassword,jdbcType=VARCHAR},
</if>
<if test="payPassword != null">
pay_password = #{payPassword,jdbcType=VARCHAR},
</if>
<if test="openId != null">
open_id = #{openId,jdbcType=VARCHAR},
</if>
<if test="avaterImageUrl != null and avaterImageUrl != ''">
avater_image_url = #{avaterImageUrl,jdbcType=VARCHAR},
</if>
<if test="cloudSpaceUsage != null">
cloud_space_usage = #{cloudSpaceUsage,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="birthday != null">
birthday = #{birthday},
</if>
<if test="birthdayType != null">
birthday_type = #{birthdayType},
</if>
<if test="state != null">
state = #{state},
</if>
<if test="signature != null">
signature = #{signature},
</if>
<if test="loginDate != null">
login_date = #{loginDate},
</if>
<if test="officeOpenId != null and officeOpenId !=''">
office_open_id = #{officeOpenId},
</if>
<if test="appletOpenId != null and appletOpenId !=''">
applet_open_id = #{appletOpenId},
</if>
<if test="webappOpenId != null and webappOpenId !=''">
webapp_open_id = #{webappOpenId},
</if>
<if test="unionid != null and unionid !='' ">
unionid = #{unionid},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateUser" parameterType="com.hwstudio.antaile.entity.AtlUser">
update atl_user
<set>
<if test="nickName != null">
nick_name = #{nickName,jdbcType=VARCHAR},
</if>
<if test="realName != null">
real_name = #{realName,jdbcType=VARCHAR},
</if>
<if test="mobilePhone != null">
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if test="loginPassword != null">
login_password = #{loginPassword,jdbcType=VARCHAR},
</if>
<if test="payPassword != null">
pay_password = #{payPassword,jdbcType=VARCHAR},
</if>
<if test="openId != null">
open_id = #{openId,jdbcType=VARCHAR},
</if>
<if test="avaterImageUrl != null and avaterImageUrl != ''">
avater_image_url = #{avaterImageUrl,jdbcType=VARCHAR},
</if>
<if test="cloudSpaceUsage != null">
cloud_space_usage = #{cloudSpaceUsage,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="birthday != null">
birthday = #{birthday},
</if>
<if test="birthdayType != null">
birthday_type = #{birthdayType},
</if>
<if test="state != null">
state = #{state},
</if>
<if test="signature != null">
signature = #{signature},
</if>
<if test="loginDate != null">
login_date = #{loginDate},
</if>
<if test="officeOpenId != null and officeOpenId !=''">
office_open_id = #{officeOpenId},
</if>
<if test="appletOpenId != null and appletOpenId !=''">
applet_open_id = #{appletOpenId},
</if>
<if test="webappOpenId != null and webappOpenId !=''">
webapp_open_id = #{webappOpenId},
</if>
<if test="unionid != null and unionid !='' ">
unionid = #{unionid},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updatePushStatus" parameterType="com.hwstudio.antaile.entity.AtlUser">
update atl_user
<set>
<if test="isSysPush != null and isSysPush != ''">
is_sys_push = #{isSysPush}
</if>
<if test="isScPush != null and isScPush != ''">
is_sc_push = #{isScPush}
</if>
<if test="isRemPush != null and isRemPush != ''">
is_rem_push = #{isRemPush}
</if>
</set>
where id = #{id}
</update>
<update id="updatePushStatus" parameterType="com.hwstudio.antaile.entity.AtlUser">
update atl_user
<set>
<if test="isSysPush != null and isSysPush != ''">
is_sys_push = #{isSysPush}
</if>
<if test="isScPush != null and isScPush != ''">
is_sc_push = #{isScPush}
</if>
<if test="isRemPush != null and isRemPush != ''">
is_rem_push = #{isRemPush}
</if>
</set>
where id = #{id}
</update>
<select id="getAtlUserInfo" resultType="com.hwstudio.antaile.entity.AtlUser">
<select id="getAtlUserInfo" resultType="com.hwstudio.antaile.entity.AtlUser">
SELECT * FROM atl_user WHERE id = #{userId}
</select>
<select id="isBindingWX" resultType="java.lang.Long">
<select id="isBindingWX" resultType="java.lang.Long">
SELECT count(1) FROM atl_user WHERE mobile_phone = #{mobile} and del_flag = '0'
</select>
<select id="getByOpenId" resultType="com.hwstudio.antaile.entity.AtlUser">
<select id="getByOpenId" resultType="com.hwstudio.antaile.entity.AtlUser">
SELECT * FROM atl_user WHERE open_id = #{openId}
</select>
<select id="getByAppletOpenId" resultType="com.hwstudio.antaile.entity.AtlUser">
<select id="getByAppletOpenId" resultType="com.hwstudio.antaile.entity.AtlUser">
SELECT * FROM atl_user WHERE applet_open_id = #{appletOpenId}
</select>
<select id="getByOfficeOpenId" resultType="com.hwstudio.antaile.entity.AtlUser">
<select id="getByOfficeOpenId" resultType="com.hwstudio.antaile.entity.AtlUser">
SELECT * FROM atl_user WHERE office_open_id = #{officeOpenId}
</select>
<select id="getByWebappOpenId" resultType="com.hwstudio.antaile.entity.AtlUser" parameterType="java.lang.String">
<select id="getByWebappOpenId" resultType="com.hwstudio.antaile.entity.AtlUser" parameterType="java.lang.String">
SELECT * FROM atl_user WHERE webapp_open_id = #{webappOpenId}
</select>
<select id="getByUnionid" resultType="com.hwstudio.antaile.entity.AtlUser" parameterType="java.lang.String">
<select id="getByUnionid" resultType="com.hwstudio.antaile.entity.AtlUser" parameterType="java.lang.String">
SELECT * FROM atl_user WHERE unionid = #{unionid}
</select>
<select id="getByAppleSub" resultType="com.hwstudio.antaile.entity.AtlUser" parameterType="java.lang.String">
<select id="getByAppleSub" resultType="com.hwstudio.antaile.entity.AtlUser" parameterType="java.lang.String">
SELECT * FROM atl_user WHERE apple_sub = #{appleSub}
</select>
<update id="updatePwd">
<update id="updatePwd">
UPDATE atl_user SET
login_password = #{pwd}
WHERE id = #{userId}
</update>
<select id="getPhoneTypeByUserId" resultType="com.hwstudio.antaile.dto.AtlUserPhoneTypeDto">
<select id="getPhoneTypeByUserId" resultType="com.hwstudio.antaile.dto.AtlUserPhoneTypeDto">
SELECT phone_type as phoneType, client_id as clientId FROM atl_user_phone_type WHERE user_id = #{userId}
</select>
<insert id="insertPhoneType" parameterType="AtlUserPhoneType">
<insert id="insertPhoneType" parameterType="AtlUserPhoneType">
INSERT INTO atl_user_phone_type (user_id , phone_type, client_id) VALUES (#{userId}, #{phoneType}, #{clientId})
</insert>
<update id="updatePhoneType" parameterType="AtlUserPhoneType">
<update id="updatePhoneType" parameterType="AtlUserPhoneType">
UPDATE atl_user_phone_type SET
phone_type = #{phoneType},
client_id = #{clientId}
WHERE user_id = #{userId}
</update>
<insert id="insert" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
INSERT INTO atl_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nickName != null">
nick_name,
</if>
<if test="realName != null">
real_name,
</if>
<if test="mobilePhone != null">
mobile_phone,
</if>
<if test="loginPassword != null">
login_password,
</if>
<if test="payPassword != null">
pay_password,
</if>
<if test="openId != null">
open_id,
</if>
<if test="avaterImageUrl != null">
avater_image_url,
</if>
<if test="cloudSpaceUsage != null">
cloud_space_usage,
</if>
<if test="remark != null">
remark,
</if>
<if test="state != null">
state,
</if>
<if test="sex != null">
sex,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="signature != null">
signature,
</if>
<if test="loginDate != null">
login_date,
</if>
<if test="officeOpenId != null and officeOpenId !=''">
office_open_id,
</if>
<if test="appletOpenId != null and appletOpenId !=''">
applet_open_id,
</if>
<if test="webappOpenId != null and webappOpenId !=''">
webapp_open_id,
</if>
<if test="unionid != null and unionid !='' ">
unionid,
</if>
create_time, is_sys_push, is_sc_push, is_rem_push
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nickName != null">
#{nickName},
</if>
<if test="realName != null">
#{realName},
</if>
<if test="mobilePhone != null">
#{mobilePhone},
</if>
<if test="loginPassword != null">
#{loginPassword},
</if>
<if test="payPassword != null">
#{payPassword},
</if>
<if test="openId != null">
#{openId},
</if>
<if test="avaterImageUrl != null">
#{avaterImageUrl},
</if>
<if test="cloudSpaceUsage != null">
#{cloudSpaceUsage},
</if>
<if test="remark != null">
#{remark},
</if>
<if test="state != null">
#{state},
</if>
<if test="sex != null">
#{sex},
</if>
<if test="birthday != null">
#{birthday},
</if>
<if test="signature != null">
#{signature},
</if>
<if test="loginDate != null">
#{loginDate},
</if>
<if test="officeOpenId != null and officeOpenId !='' ">
#{officeOpenId},
</if>
<if test="appletOpenId != null and appletOpenId !='' ">
#{appletOpenId},
</if>
<if test="webappOpenId != null and webappOpenId !=''">
#{webappOpenId},
</if>
<if test="unionid != null and unionid !='' ">
#{unionid},
</if>
NOW(), '0', '0', '0'
</trim>
</insert>
<insert id="insert" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
INSERT INTO atl_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nickName != null">
nick_name,
</if>
<if test="realName != null">
real_name,
</if>
<if test="mobilePhone != null">
mobile_phone,
</if>
<if test="loginPassword != null">
login_password,
</if>
<if test="payPassword != null">
pay_password,
</if>
<if test="openId != null">
open_id,
</if>
<if test="avaterImageUrl != null">
avater_image_url,
</if>
<if test="cloudSpaceUsage != null">
cloud_space_usage,
</if>
<if test="remark != null">
remark,
</if>
<if test="state != null">
state,
</if>
<if test="sex != null">
sex,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="signature != null">
signature,
</if>
<if test="loginDate != null">
login_date,
</if>
<if test="officeOpenId != null and officeOpenId !=''">
office_open_id,
</if>
<if test="appletOpenId != null and appletOpenId !=''">
applet_open_id,
</if>
<if test="webappOpenId != null and webappOpenId !=''">
webapp_open_id,
</if>
<if test="unionid != null and unionid !='' ">
unionid,
</if>
<if test="fromTimeid != null">
from_timeid,
</if>
<if test="fromUserid != null">
from_userid,
</if>
<if test="appleSub != null and appleSub !='' ">
apple_sub,
</if>
create_time, is_sys_push, is_sc_push, is_rem_push
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nickName != null">
#{nickName},
</if>
<if test="realName != null">
#{realName},
</if>
<if test="mobilePhone != null">
#{mobilePhone},
</if>
<if test="loginPassword != null">
#{loginPassword},
</if>
<if test="payPassword != null">
#{payPassword},
</if>
<if test="openId != null">
#{openId},
</if>
<if test="avaterImageUrl != null">
#{avaterImageUrl},
</if>
<if test="cloudSpaceUsage != null">
#{cloudSpaceUsage},
</if>
<if test="remark != null">
#{remark},
</if>
<if test="state != null">
#{state},
</if>
<if test="sex != null">
#{sex},
</if>
<if test="birthday != null">
#{birthday},
</if>
<if test="signature != null">
#{signature},
</if>
<if test="loginDate != null">
#{loginDate},
</if>
<if test="officeOpenId != null and officeOpenId !='' ">
#{officeOpenId},
</if>
<if test="appletOpenId != null and appletOpenId !='' ">
#{appletOpenId},
</if>
<if test="webappOpenId != null and webappOpenId !=''">
#{webappOpenId},
</if>
<if test="unionid != null and unionid !='' ">
#{unionid},
</if>
<if test="fromTimeid != null">
#{fromTimeid},
</if>
<if test="fromUserid != null">
#{fromUserid},
</if>
<if test="appleSub != null and appleSub !='' ">
#{appleSub},
</if>
NOW(), '0', '0', '0'
</trim>
</insert>
<update id="updateOpenId">
<update id="updateOpenId">
UPDATE atl_user
SET open_id = #{openId}
where id = #{id}
</update>
<update id="updateOpenIdInfo">
<update id="updateOpenIdInfo">
UPDATE atl_user
SET
open_id = #{openId},
......@@ -316,109 +335,111 @@
where id = #{id}
</update>
<update id="updateUserLoginDate">
<update id="updateUserLoginDate">
UPDATE atl_user
SET login_date = NOW()
where id = #{userId}
</update>
<update id="updatePhoneAndPwd">
UPDATE atl_user
<set>
<if test="mobilePhone != null">
mobile_phone = #{mobilePhone},
</if>
<if test="loginPassword != null">
login_password = #{loginPassword}
</if>
</set>
WHERE id = #{id}
</update>
<update id="updatePhoneAndPwd">
UPDATE atl_user
<set>
<if test="mobilePhone != null">
mobile_phone = #{mobilePhone},
</if>
<if test="loginPassword != null">
login_password = #{loginPassword}
</if>
</set>
WHERE id = #{id}
</update>
<update id="updateBindWxInf">
UPDATE atl_user
<set>
<if test="sex != null">
sex = #{sex},
</if>
<if test="avaterImageUrl != null and avaterImageUrl != ''">
avater_image_url = #{avaterImageUrl},
</if>
<if test="officeOpenId != null and officeOpenId != ''">
office_open_Id = #{officeOpenId},
</if>
<if test="openId != null and openId != ''">
open_id = #{openId},
</if>
<if test="appletOpenId != null and appletOpenId != ''">
applet_open_id = #{appletOpenId},
</if>
<if test="nickName != null and nickName != ''">
nick_name = #{nickName},
</if>
del_flag = 0
</set>
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="mobilePhone != null and mobilePhone != ''">
and mobile_phone = #{mobilePhone}
</if>
<if test="appletOpenId != null and appletOpenId != ''">
and applet_open_id = #{appletOpenId}
</if>
</where>
</update>
<update id="updateBindWxInf">
UPDATE atl_user
<set>
<if test="sex != null">
sex = #{sex},
</if>
<if test="avaterImageUrl != null and avaterImageUrl != ''">
avater_image_url = #{avaterImageUrl},
</if>
<if test="officeOpenId != null and officeOpenId != ''">
office_open_Id = #{officeOpenId},
</if>
<if test="openId != null and openId != ''">
open_id = #{openId},
</if>
<if test="appletOpenId != null and appletOpenId != ''">
applet_open_id = #{appletOpenId},
</if>
<if test="nickName != null and nickName != ''">
nick_name = #{nickName},
</if>
del_flag = 0
</set>
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="mobilePhone != null and mobilePhone != ''">
and mobile_phone = #{mobilePhone}
</if>
<if test="appletOpenId != null and appletOpenId != ''">
and applet_open_id = #{appletOpenId}
</if>
</where>
</update>
<update id="updateAppletBindWxInf">
UPDATE atl_user
<set>
<if test="sex != null">
sex = #{sex},
</if>
<if test="avaterImageUrl != null and avaterImageUrl != ''">
avater_image_url = #{avaterImageUrl},
</if>
<if test="appletOpenId != null and appletOpenId != ''">
applet_open_id = #{appletOpenId},
</if>
<if test="nickName != null and nickName != ''">
nick_name = #{nickName},
</if>
del_flag = 0
</set>
<where>
mobile_phone = #{mobilePhone}
</where>
</update>
<update id="updateAppletBindWxInf">
UPDATE atl_user
<set>
<if test="sex != null">
sex = #{sex},
</if>
<if test="avaterImageUrl != null and avaterImageUrl != ''">
avater_image_url = #{avaterImageUrl},
</if>
<if test="appletOpenId != null and appletOpenId != ''">
applet_open_id = #{appletOpenId},
</if>
<if test="nickName != null and nickName != ''">
nick_name = #{nickName},
</if>
del_flag = 0
</set>
<where>
mobile_phone = #{mobilePhone}
</where>
</update>
<select id="getCommentCount" resultType="java.lang.Long">
<select id="getCommentCount" resultType="java.lang.Long">
select
count(0) from atl_comment
where create_user_id = #{userId}
</select>
<select id="selectOneUserByMobilePhone" parameterType="java.lang.String" resultType="com.hwstudio.antaile.entity.AtlUser">
<select id="selectOneUserByMobilePhone" parameterType="java.lang.String"
resultType="com.hwstudio.antaile.entity.AtlUser">
SELECT * FROM atl_user WHERE mobile_phone=#{mobilePhone}
</select>
<select id="selectRelationUserListByOther" parameterType="com.hwstudio.antaile.queryparam.QueryRelationUserParam" resultType="com.hwstudio.antaile.dto.RelationUserDTO">
select
a.id,a.nick_name nickName,a.sex,a.login_date loginDate,
a.avater_image_url avaterImageUrl,a.from_timeid fromTimeid,a.from_userid fromUserid,
b.name fromTimeName
from atl_user a
left join atl_time b ON a.from_timeid = b.id
where 1 = 1
<if test="fromTimeid != null">
and a.from_timeid =#{fromTimeid}
</if>
<if test="fromUserid != null">
and a.from_userid =#{fromUserid}
</if>
</select>
<select id="selectRelationUserListByOther" parameterType="com.hwstudio.antaile.queryparam.QueryRelationUserParam"
resultType="com.hwstudio.antaile.dto.RelationUserDTO">
select
a.id,a.nick_name nickName,a.sex,a.login_date loginDate,
a.avater_image_url avaterImageUrl,a.from_timeid fromTimeid,a.from_userid fromUserid,
b.name fromTimeName
from atl_user a
left join atl_time b ON a.from_timeid = b.id
where 1 = 1
<if test="fromTimeid != null">
and a.from_timeid =#{fromTimeid}
</if>
<if test="fromUserid != null">
and a.from_userid =#{fromUserid}
</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment