|  |  | 
 |  |  | import com.baomidou.mybatisplus.annotations.TableId; | 
 |  |  | import com.baomidou.mybatisplus.annotations.TableName; | 
 |  |  | import com.baomidou.mybatisplus.enums.IdType; | 
 |  |  | import com.zy.system.service.HostService; | 
 |  |  | import com.zy.system.service.RoleService; | 
 |  |  | import com.core.common.Cools; | 
 |  |  | import com.core.common.SpringUtils; | 
 |  |  | import com.zy.system.service.HostService; | 
 |  |  | import com.zy.system.service.RoleService; | 
 |  |  |  | 
 |  |  | import java.io.Serializable; | 
 |  |  | import java.text.SimpleDateFormat; | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  | //import com.zy.system.service.RoleService; | 
 |  |  | //import com.zy.sc.system.service.RoleService; | 
 |  |  |  | 
 |  |  | @TableName("sys_user") | 
 |  |  | public class User implements Serializable { | 
 |  |  | 
 |  |  |     @TableField("host_id") | 
 |  |  |     private Long hostId; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 名称 | 
 |  |  |      * 所属部门 | 
 |  |  |      */ | 
 |  |  |     @TableField("dept_id") | 
 |  |  |     private Long deptId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 角色 | 
 |  |  |      */ | 
 |  |  |     @TableField("role_id") | 
 |  |  |     private Long roleId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 账号 | 
 |  |  |      */ | 
 |  |  |     private String username; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 账号 | 
 |  |  |      * 名称 | 
 |  |  |      */ | 
 |  |  |     private String nickname; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 手机号 | 
 |  |  |      */ | 
 |  |  |     private String mobile; | 
 |  |  |  | 
 |  |  | 
 |  |  |     private String password; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 角色 | 
 |  |  |      * 头像 | 
 |  |  |      */ | 
 |  |  |     @TableField("role_id") | 
 |  |  |     private Long roleId; | 
 |  |  |     private String avatar; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 邮箱 | 
 |  |  |      */ | 
 |  |  |     private String email; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 性别 0: 男  1:  女   2:  未知 | 
 |  |  |      */ | 
 |  |  |     private Integer sex; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 注册时间 | 
 |  |  | 
 |  |  |     private Date createTime; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 状态 1: 启用  2: 冻结  3: 删除   | 
 |  |  |      * 状态 1: 启用  0: 禁用 | 
 |  |  |      */ | 
 |  |  |     private Integer status; | 
 |  |  |  | 
 |  |  | 
 |  |  |         this.hostId = hostId; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Long getDeptId() { | 
 |  |  |         return deptId; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getDeptName() { | 
 |  |  | //        DeptService service = SpringUtils.getBean(DeptService.class); | 
 |  |  | //        Dept dept = service.selectById(this.deptId); | 
 |  |  | //        if (!Cools.isEmpty(dept)){ | 
 |  |  | //            return dept.getName(); | 
 |  |  | //        } | 
 |  |  |         return null; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setDeptId(Long deptId) { | 
 |  |  |         this.deptId = deptId; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setUsername(String username) { | 
 |  |  |         this.username = username; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getNickname() { | 
 |  |  |         return nickname; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setNickname(String nickname) { | 
 |  |  |         this.nickname = nickname; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getMobile() { | 
 |  |  | 
 |  |  |  | 
 |  |  |     public void setPassword(String password) { | 
 |  |  |         this.password = password; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getAvatar() { | 
 |  |  |         return avatar; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setAvatar(String avatar) { | 
 |  |  |         this.avatar = avatar; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getEmail() { | 
 |  |  |         return email; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setEmail(String email) { | 
 |  |  |         this.email = email; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Integer getSex() { | 
 |  |  |         return sex; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getSex$(){ | 
 |  |  |         if (null == this.sex){ return null; } | 
 |  |  |         switch (this.sex){ | 
 |  |  |             case 0: | 
 |  |  |                 return "男"; | 
 |  |  |             case 1: | 
 |  |  |                 return "女"; | 
 |  |  |             case 2: | 
 |  |  |                 return "未知"; | 
 |  |  |             default: | 
 |  |  |                 return String.valueOf(this.sex); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setSex(Integer sex) { | 
 |  |  |         this.sex = sex; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Long getRoleId() { | 
 |  |  | 
 |  |  |         switch (this.status){ | 
 |  |  |             case 1: | 
 |  |  |                 return "启用"; | 
 |  |  |             case 2: | 
 |  |  |                 return "冻结"; | 
 |  |  |             case 3: | 
 |  |  |                 return "删除"; | 
 |  |  |             case 0: | 
 |  |  |                 return "禁用"; | 
 |  |  |             default: | 
 |  |  |                 return String.valueOf(this.status); | 
 |  |  |         } |