From 36cc088dbabe4c33a52dcb0e64cf56ade474ccd4 Mon Sep 17 00:00:00 2001 From: panqihua Date: Thu, 12 Jan 2023 02:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9sys=5Fuser=E8=A1=A8=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/SysUser.java | 69 +++++++++++++++++-- .../resources/mapper/system/SysUserMapper.xml | 55 ++++++++------- sql/ttsbg.sql | 9 +++ 3 files changed, 103 insertions(+), 30 deletions(-) create mode 100644 sql/ttsbg.sql diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 8d4d4c5..eddc336 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -1,20 +1,23 @@ package com.ruoyi.common.core.domain.entity; -import java.util.Date; -import java.util.List; -import javax.validation.constraints.*; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel.ColumnType; import com.ruoyi.common.annotation.Excel.Type; import com.ruoyi.common.annotation.Excels; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.xss.Xss; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.util.Date; +import java.util.List; /** * 用户对象 sys_user - * + * * @author ruoyi */ public class SysUser extends BaseEntity @@ -89,6 +92,20 @@ public class SysUser extends BaseEntity /** 角色ID */ private Long roleId; + /** 微信昵称 */ + @Excel(name = "微信昵称") + private String wechatNickName; + + /** 账户余额 */ + @Excel(name = "账户余额") + private Long balance; + + /** 推荐人ID */ + @Excel(name = "推荐人ID") + private Long referrerId; + + private SysUser referrerSysUser; + public SysUser() { @@ -297,6 +314,43 @@ public class SysUser extends BaseEntity this.roleId = roleId; } + public void setWechatNickName(String wechatNickName) + { + this.wechatNickName = wechatNickName; + } + + public String getWechatNickName() + { + return wechatNickName; + } + public void setBalance(Long balance) + { + this.balance = balance; + } + + public Long getBalance() + { + return balance; + } + + public void setReferrerId(Long referrerId) + { + this.referrerId = referrerId; + } + + public Long getReferrerId() + { + return referrerId; + } + + public SysUser getReferrerSysUser() { + return referrerSysUser; + } + + public void setReferrerSysUser(SysUser referrerSysUser) { + this.referrerSysUser = referrerSysUser; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -319,6 +373,9 @@ public class SysUser extends BaseEntity .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .append("dept", getDept()) + .append("wechatNickName", getWechatNickName()) + .append("balance", getBalance()) + .append("referrerSysUser", getReferrerSysUser()) .toString(); } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 3c1c6c5..4420d2f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -23,10 +23,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + + + + + - + @@ -36,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -45,9 +51,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u @@ -55,10 +61,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sys_user_role ur on u.user_id = ur.user_id left join sys_role r on r.role_id = ur.role_id - + - + - + - + - + - + - + - + - + insert into sys_user( user_id, @@ -173,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sysdate() ) - + update sys_user @@ -194,28 +201,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where user_id = #{userId} - + update sys_user set status = #{status} where user_id = #{userId} - + update sys_user set avatar = #{avatar} where user_name = #{userName} - + update sys_user set password = #{password} where user_name = #{userName} - + update sys_user set del_flag = '2' where user_id = #{userId} - + update sys_user set del_flag = '2' where user_id in #{userId} - + - - \ No newline at end of file + + diff --git a/sql/ttsbg.sql b/sql/ttsbg.sql new file mode 100644 index 0000000..8543506 --- /dev/null +++ b/sql/ttsbg.sql @@ -0,0 +1,9 @@ +alter table sys_user + add wechat_nick_name varchar(30) null comment '微信昵称'; +alter table sys_user + add balance float null comment '账户余额'; +alter table sys_user + add referrer_id bigint null comment '推荐人ID'; +alter table sys_user + add constraint sys_user_sys_user_user_id_fk + foreign key (referrer_id) references sys_user (user_id);