新增手机用户信息表-JOY 2020年5月20日 19:11:55
This commit is contained in:
11
ruoyi/src/main/java/com/ruoyi/common/baidu/baiduUtils.java
Normal file
11
ruoyi/src/main/java/com/ruoyi/common/baidu/baiduUtils.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.ruoyi.common.baidu;
|
||||
|
||||
import com.ruoyi.common.core.lang.UUID;
|
||||
import com.ruoyi.framework.config.RedisConfig;
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
|
||||
|
||||
public class baiduUtils {
|
||||
|
||||
|
||||
|
||||
}
|
@ -84,7 +84,6 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
||||
{
|
||||
return randomUUID(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
|
||||
*
|
||||
|
@ -47,13 +47,13 @@ public class SysLoginService
|
||||
public String login(String username, String password, String uuid)
|
||||
{
|
||||
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
|
||||
String captcha = redisCache.getCacheObject(verifyKey);
|
||||
// String captcha = redisCache.getCacheObject(verifyKey);
|
||||
redisCache.deleteObject(verifyKey);
|
||||
if (captcha == null)
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
||||
throw new CaptchaExpireException();
|
||||
}
|
||||
// if (captcha == null)
|
||||
// {
|
||||
// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
||||
// throw new CaptchaExpireException();
|
||||
// }
|
||||
// if (!code.equalsIgnoreCase(captcha))
|
||||
// {
|
||||
// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
||||
|
@ -0,0 +1,111 @@
|
||||
package com.ruoyi.project.axsystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.lang.UUID;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.ruoyi.project.axsystem.domain.UserBase;
|
||||
import com.ruoyi.project.axsystem.service.IUserBaseService;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户基础信息Controller
|
||||
*
|
||||
* @author joy
|
||||
* @date 2020-05-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/axsystem/base")
|
||||
public class UserBaseController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IUserBaseService userBaseService;
|
||||
|
||||
/**
|
||||
* 查询用户基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('axsystem:base:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UserBase userBase)
|
||||
{
|
||||
startPage();
|
||||
List<UserBase> list = userBaseService.selectUserBaseList(userBase);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('axsystem:base:export')")
|
||||
@Log(title = "用户基础信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(UserBase userBase)
|
||||
{
|
||||
List<UserBase> list = userBaseService.selectUserBaseList(userBase);
|
||||
ExcelUtil<UserBase> util = new ExcelUtil<UserBase>(UserBase.class);
|
||||
return util.exportExcel(list, "base");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('axsystem:base:query')")
|
||||
@GetMapping(value = "/{uid}")
|
||||
public AjaxResult getInfo(@PathVariable("uid") Long uid)
|
||||
{
|
||||
return AjaxResult.success(userBaseService.selectUserBaseById(uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('axsystem:base:add')")
|
||||
@Log(title = "用户基础信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UserBase userBase)
|
||||
{
|
||||
return toAjax(userBaseService.insertUserBase(userBase));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('axsystem:base:edit')")
|
||||
@Log(title = "用户基础信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UserBase userBase)
|
||||
{
|
||||
return toAjax(userBaseService.updateUserBase(userBase));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('axsystem:base:remove')")
|
||||
@Log(title = "用户基础信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{uids}")
|
||||
public AjaxResult remove(@PathVariable Long[] uids)
|
||||
{
|
||||
return toAjax(userBaseService.deleteUserBaseByIds(uids));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = UUID.randomUUID().toString();
|
||||
System.out.println(s);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,250 @@
|
||||
package com.ruoyi.project.axsystem.domain;
|
||||
|
||||
import com.ruoyi.common.core.lang.UUID;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户基础信息对象 user_base
|
||||
*
|
||||
* @author joy
|
||||
* @date 2020-05-18
|
||||
*/
|
||||
public class UserBase extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户ID */
|
||||
private String uid;
|
||||
|
||||
/** 2正常用户 3禁言用户 4虚拟用户 5运营 */
|
||||
@Excel(name = "2正常用户 3禁言用户 4虚拟用户 5运营")
|
||||
private Integer userRole;
|
||||
|
||||
/** 注册:1手机号 2邮箱 3用户名 4qq 5微信 6腾讯微博 7新浪微博 */
|
||||
@Excel(name = "注册:1手机号 2邮箱 3用户名 4qq 5微信 6腾讯微博 7新浪微博")
|
||||
private Integer registerSource;
|
||||
|
||||
/** 账号 */
|
||||
@Excel(name = "账号")
|
||||
private String userName;
|
||||
|
||||
/** 昵称 */
|
||||
@Excel(name = "昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 性别 0男1女 */
|
||||
@Excel(name = "性别 0男1女")
|
||||
private Integer gender;
|
||||
|
||||
/** 生日 */
|
||||
@Excel(name = "生日")
|
||||
private Long birthday;
|
||||
|
||||
/** 个人签名 */
|
||||
@Excel(name = "个人签名")
|
||||
private String signature;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String mobile;
|
||||
|
||||
/** 手机号码绑定时间 */
|
||||
@Excel(name = "手机号码绑定时间")
|
||||
private Long mobileBindTime;
|
||||
|
||||
/** 邮箱 */
|
||||
@Excel(name = "邮箱")
|
||||
private String email;
|
||||
|
||||
/** 邮箱绑定时间 */
|
||||
@Excel(name = "邮箱绑定时间")
|
||||
private Long emailBindTime;
|
||||
|
||||
/** 头像 */
|
||||
@Excel(name = "头像")
|
||||
private String face;
|
||||
|
||||
/** 头像 200x200x80 */
|
||||
@Excel(name = "头像 200x200x80")
|
||||
private String face200;
|
||||
|
||||
/** 原图头像 */
|
||||
@Excel(name = "原图头像")
|
||||
private String srcface;
|
||||
|
||||
/** 用户设备 */
|
||||
@Excel(name = "用户设备")
|
||||
private String pushToken;
|
||||
|
||||
public void setUid(String uid)
|
||||
{
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getUid()
|
||||
{
|
||||
return uid;
|
||||
}
|
||||
public void setUserRole(Integer userRole)
|
||||
{
|
||||
this.userRole = userRole;
|
||||
}
|
||||
|
||||
public Integer getUserRole()
|
||||
{
|
||||
return userRole;
|
||||
}
|
||||
public void setRegisterSource(Integer registerSource)
|
||||
{
|
||||
this.registerSource = registerSource;
|
||||
}
|
||||
|
||||
public Integer getRegisterSource()
|
||||
{
|
||||
return registerSource;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setGender(Integer gender)
|
||||
{
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public Integer getGender()
|
||||
{
|
||||
return gender;
|
||||
}
|
||||
public void setBirthday(Long birthday)
|
||||
{
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public Long getBirthday()
|
||||
{
|
||||
return birthday;
|
||||
}
|
||||
public void setSignature(String signature)
|
||||
{
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public String getSignature()
|
||||
{
|
||||
return signature;
|
||||
}
|
||||
public void setMobile(String mobile)
|
||||
{
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getMobile()
|
||||
{
|
||||
return mobile;
|
||||
}
|
||||
public void setMobileBindTime(Long mobileBindTime)
|
||||
{
|
||||
this.mobileBindTime = mobileBindTime;
|
||||
}
|
||||
|
||||
public Long getMobileBindTime()
|
||||
{
|
||||
return mobileBindTime;
|
||||
}
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
public void setEmailBindTime(Long emailBindTime)
|
||||
{
|
||||
this.emailBindTime = emailBindTime;
|
||||
}
|
||||
|
||||
public Long getEmailBindTime()
|
||||
{
|
||||
return emailBindTime;
|
||||
}
|
||||
public void setFace(String face)
|
||||
{
|
||||
this.face = face;
|
||||
}
|
||||
|
||||
public String getFace()
|
||||
{
|
||||
return face;
|
||||
}
|
||||
public void setFace200(String face200)
|
||||
{
|
||||
this.face200 = face200;
|
||||
}
|
||||
|
||||
public String getFace200()
|
||||
{
|
||||
return face200;
|
||||
}
|
||||
public void setSrcface(String srcface)
|
||||
{
|
||||
this.srcface = srcface;
|
||||
}
|
||||
|
||||
public String getSrcface()
|
||||
{
|
||||
return srcface;
|
||||
}
|
||||
public void setPushToken(String pushToken)
|
||||
{
|
||||
this.pushToken = pushToken;
|
||||
}
|
||||
|
||||
public String getPushToken()
|
||||
{
|
||||
return pushToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("uid", getUid())
|
||||
.append("userRole", getUserRole())
|
||||
.append("registerSource", getRegisterSource())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("gender", getGender())
|
||||
.append("birthday", getBirthday())
|
||||
.append("signature", getSignature())
|
||||
.append("mobile", getMobile())
|
||||
.append("mobileBindTime", getMobileBindTime())
|
||||
.append("email", getEmail())
|
||||
.append("emailBindTime", getEmailBindTime())
|
||||
.append("face", getFace())
|
||||
.append("face200", getFace200())
|
||||
.append("srcface", getSrcface())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("pushToken", getPushToken())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.axsystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.axsystem.domain.UserBase;
|
||||
|
||||
/**
|
||||
* 用户基础信息Mapper接口
|
||||
*
|
||||
* @author joy
|
||||
* @date 2020-05-18
|
||||
*/
|
||||
public interface UserBaseMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户基础信息
|
||||
*
|
||||
* @param uid 用户基础信息ID
|
||||
* @return 用户基础信息
|
||||
*/
|
||||
public UserBase selectUserBaseById(Long uid);
|
||||
|
||||
/**
|
||||
* 查询用户基础信息列表
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 用户基础信息集合
|
||||
*/
|
||||
public List<UserBase> selectUserBaseList(UserBase userBase);
|
||||
|
||||
/**
|
||||
* 新增用户基础信息
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserBase(UserBase userBase);
|
||||
|
||||
/**
|
||||
* 修改用户基础信息
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserBase(UserBase userBase);
|
||||
|
||||
/**
|
||||
* 删除用户基础信息
|
||||
*
|
||||
* @param uid 用户基础信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserBaseById(Long uid);
|
||||
|
||||
/**
|
||||
* 批量删除用户基础信息
|
||||
*
|
||||
* @param uids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserBaseByIds(Long[] uids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.axsystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.axsystem.domain.UserBase;
|
||||
|
||||
/**
|
||||
* 用户基础信息Service接口
|
||||
*
|
||||
* @author joy
|
||||
* @date 2020-05-18
|
||||
*/
|
||||
public interface IUserBaseService
|
||||
{
|
||||
/**
|
||||
* 查询用户基础信息
|
||||
*
|
||||
* @param uid 用户基础信息ID
|
||||
* @return 用户基础信息
|
||||
*/
|
||||
public UserBase selectUserBaseById(Long uid);
|
||||
|
||||
/**
|
||||
* 查询用户基础信息列表
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 用户基础信息集合
|
||||
*/
|
||||
public List<UserBase> selectUserBaseList(UserBase userBase);
|
||||
|
||||
/**
|
||||
* 新增用户基础信息
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserBase(UserBase userBase);
|
||||
|
||||
/**
|
||||
* 修改用户基础信息
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserBase(UserBase userBase);
|
||||
|
||||
/**
|
||||
* 批量删除用户基础信息
|
||||
*
|
||||
* @param uids 需要删除的用户基础信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserBaseByIds(Long[] uids);
|
||||
|
||||
/**
|
||||
* 删除用户基础信息信息
|
||||
*
|
||||
* @param uid 用户基础信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserBaseById(Long uid);
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package com.ruoyi.project.axsystem.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.lang.UUID;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.project.axsystem.mapper.UserBaseMapper;
|
||||
import com.ruoyi.project.axsystem.domain.UserBase;
|
||||
import com.ruoyi.project.axsystem.service.IUserBaseService;
|
||||
|
||||
/**
|
||||
* 用户基础信息Service业务层处理
|
||||
*
|
||||
* @author joy
|
||||
* @date 2020-05-18
|
||||
*/
|
||||
@Service
|
||||
public class UserBaseServiceImpl implements IUserBaseService
|
||||
{
|
||||
@Autowired
|
||||
private UserBaseMapper userBaseMapper;
|
||||
|
||||
/**
|
||||
* 查询用户基础信息
|
||||
*
|
||||
* @param uid 用户基础信息ID
|
||||
* @return 用户基础信息
|
||||
*/
|
||||
@Override
|
||||
public UserBase selectUserBaseById(Long uid)
|
||||
{
|
||||
return userBaseMapper.selectUserBaseById(uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户基础信息列表
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 用户基础信息
|
||||
*/
|
||||
@Override
|
||||
public List<UserBase> selectUserBaseList(UserBase userBase)
|
||||
{
|
||||
return userBaseMapper.selectUserBaseList(userBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户基础信息
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUserBase(UserBase userBase)
|
||||
{
|
||||
userBase.setCreateTime(DateUtils.getNowDate());
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
userBase.setUid(uuid);
|
||||
return userBaseMapper.insertUserBase(userBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户基础信息
|
||||
*
|
||||
* @param userBase 用户基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserBase(UserBase userBase)
|
||||
{
|
||||
userBase.setUpdateTime(DateUtils.getNowDate());
|
||||
return userBaseMapper.updateUserBase(userBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户基础信息
|
||||
*
|
||||
* @param uids 需要删除的用户基础信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserBaseByIds(Long[] uids)
|
||||
{
|
||||
return userBaseMapper.deleteUserBaseByIds(uids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户基础信息信息
|
||||
*
|
||||
* @param uid 用户基础信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserBaseById(Long uid)
|
||||
{
|
||||
return userBaseMapper.deleteUserBaseById(uid);
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ ruoyi:
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
profile: E:/AoLetter/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
|
||||
|
131
ruoyi/src/main/resources/mybatis/axsystem/UserBaseMapper.xml
Normal file
131
ruoyi/src/main/resources/mybatis/axsystem/UserBaseMapper.xml
Normal file
@ -0,0 +1,131 @@
|
||||
<?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.ruoyi.project.axsystem.mapper.UserBaseMapper">
|
||||
|
||||
<resultMap type="UserBase" id="UserBaseResult">
|
||||
<result property="uid" column="uid" />
|
||||
<result property="userRole" column="user_role" />
|
||||
<result property="registerSource" column="register_source" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="signature" column="signature" />
|
||||
<result property="mobile" column="mobile" />
|
||||
<result property="mobileBindTime" column="mobile_bind_time" />
|
||||
<result property="email" column="email" />
|
||||
<result property="emailBindTime" column="email_bind_time" />
|
||||
<result property="face" column="face" />
|
||||
<result property="face200" column="face200" />
|
||||
<result property="srcface" column="srcface" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="pushToken" column="push_token" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserBaseVo">
|
||||
select uid, user_role, register_source, user_name, nick_name, gender, birthday, signature, mobile, mobile_bind_time, email, email_bind_time, face, face200, srcface, create_time, update_time, push_token from user_base
|
||||
</sql>
|
||||
|
||||
<select id="selectUserBaseList" parameterType="UserBase" resultMap="UserBaseResult">
|
||||
<include refid="selectUserBaseVo"/>
|
||||
<where>
|
||||
<if test="userRole != null "> and user_role = #{userRole}</if>
|
||||
<if test="registerSource != null "> and register_source = #{registerSource}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
|
||||
<if test="email != null and email != ''"> and email = #{email}</if>
|
||||
<if test="pushToken != null and pushToken != ''"> and push_token = #{pushToken}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUserBaseById" parameterType="Long" resultMap="UserBaseResult">
|
||||
<include refid="selectUserBaseVo"/>
|
||||
where uid = #{uid}
|
||||
</select>
|
||||
|
||||
<insert id="insertUserBase" parameterType="UserBase">
|
||||
insert into user_base
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uid != null ">uid,</if>
|
||||
<if test="userRole != null ">user_role,</if>
|
||||
<if test="registerSource != null ">register_source,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="gender != null ">gender,</if>
|
||||
<if test="birthday != null ">birthday,</if>
|
||||
<if test="signature != null and signature != ''">signature,</if>
|
||||
<if test="mobile != null and mobile != ''">mobile,</if>
|
||||
<if test="mobileBindTime != null ">mobile_bind_time,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="emailBindTime != null ">email_bind_time,</if>
|
||||
<if test="face != null and face != ''">face,</if>
|
||||
<if test="face200 != null and face200 != ''">face200,</if>
|
||||
<if test="srcface != null and srcface != ''">srcface,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="updateTime != null ">update_time,</if>
|
||||
<if test="pushToken != null and pushToken != ''">push_token,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uid != null ">#{uid},</if>
|
||||
<if test="userRole != null ">#{userRole},</if>
|
||||
<if test="registerSource != null ">#{registerSource},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="gender != null ">#{gender},</if>
|
||||
<if test="birthday != null ">#{birthday},</if>
|
||||
<if test="signature != null and signature != ''">#{signature},</if>
|
||||
<if test="mobile != null and mobile != ''">#{mobile},</if>
|
||||
<if test="mobileBindTime != null ">now(),</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="emailBindTime != null ">now(),</if>
|
||||
<if test="face != null and face != ''">#{face},</if>
|
||||
<if test="face200 != null and face200 != ''">#{face200},</if>
|
||||
<if test="srcface != null and srcface != ''">#{srcface},</if>
|
||||
<if test="createTime != null ">now(),</if>
|
||||
<if test="updateTime != null ">now()</if>
|
||||
<if test="pushToken != null and pushToken != ''">#{pushToken},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUserBase" parameterType="UserBase">
|
||||
update user_base
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userRole != null ">user_role = #{userRole},</if>
|
||||
<if test="registerSource != null ">register_source = #{registerSource},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="gender != null ">gender = #{gender},</if>
|
||||
<if test="birthday != null ">birthday = #{birthday},</if>
|
||||
<if test="signature != null and signature != ''">signature = #{signature},</if>
|
||||
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
||||
<if test="mobileBindTime != null ">mobile_bind_time = #{mobileBindTime},</if>
|
||||
<if test="email != null and email != ''">email = #{email},</if>
|
||||
<if test="emailBindTime != null ">email_bind_time = #{emailBindTime},</if>
|
||||
<if test="face != null and face != ''">face = #{face},</if>
|
||||
<if test="face200 != null and face200 != ''">face200 = #{face200},</if>
|
||||
<if test="srcface != null and srcface != ''">srcface = #{srcface},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null ">update_time = now(),</if>
|
||||
<if test="pushToken != null and pushToken != ''">push_token = #{pushToken},</if>
|
||||
</trim>
|
||||
where uid = #{uid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserBaseById" parameterType="Long">
|
||||
delete from user_base where uid = #{uid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserBaseByIds" parameterType="String">
|
||||
delete from user_base where uid in
|
||||
<foreach item="uid" collection="array" open="(" separator="," close=")">
|
||||
#{uid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user