Commit f940da5a by fengshuonan

更新数据库小写

parent 6010c9e9
......@@ -11,7 +11,7 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_dept")
public class Dept implements Serializable {
......@@ -23,56 +23,67 @@ public class Dept implements Serializable {
*/
@TableId(value = "dept_id", type = IdType.ID_WORKER)
private Long deptId;
/**
* 父部门id
*/
@TableField("pid")
private Long pid;
/**
* 父级ids
*/
@TableField("pids")
private String pids;
/**
* 简称
*/
@TableField("simple_name")
private String simpleName;
/**
* 全称
*/
@TableField("full_name")
private String fullName;
/**
* 描述
*/
@TableField("description")
private String description;
/**
* 版本(乐观锁保留字段)
*/
@TableField("version")
private Integer version;
/**
* 排序
*/
@TableField("sort")
private Integer sort;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建人
*/
@TableField(value = "create_user", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改人
*/
......@@ -179,7 +190,7 @@ public class Dept implements Serializable {
@Override
public String toString() {
return "Dept{" +
", deptId=" + deptId +
"deptId=" + deptId +
", pid=" + pid +
", pids=" + pids +
", simpleName=" + simpleName +
......
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;
......@@ -15,10 +11,9 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2019-03-13
* @since 2019-04-01
*/
@TableName("sys_dict")
@Data
public class Dict implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -26,7 +21,7 @@ public class Dict implements Serializable {
/**
* 字典id
*/
@TableId("dict_id")
@TableId(value = "dict_id", type = IdType.ID_WORKER)
private Long dictId;
/**
......@@ -54,7 +49,7 @@ public class Dict implements Serializable {
private Long parentId;
/**
* 所有上级代码id
* 所有上级id
*/
@TableField("parent_ids")
private String parentIds;
......@@ -66,18 +61,18 @@ public class Dict implements Serializable {
private String status;
/**
* 字典的描述
*/
@TableField("description")
private String description;
/**
* 排序
*/
@TableField("sort")
private Integer sort;
/**
* 字典的描述
*/
@TableField("description")
private String description;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
......@@ -101,4 +96,127 @@ public class Dict implements Serializable {
@TableField(value = "update_user", fill = FieldFill.UPDATE)
private Long updateUser;
public Long getDictId() {
return dictId;
}
public void setDictId(Long dictId) {
this.dictId = dictId;
}
public Long getDictTypeId() {
return dictTypeId;
}
public void setDictTypeId(Long dictTypeId) {
this.dictTypeId = dictTypeId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getParentIds() {
return parentIds;
}
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "Dict{" +
"dictId=" + dictId +
", dictTypeId=" + dictTypeId +
", code=" + code +
", name=" + name +
", parentId=" + parentId +
", parentIds=" + parentIds +
", status=" + status +
", sort=" + sort +
", description=" + description +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;
......@@ -15,10 +11,9 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2019-03-13
* @since 2019-04-01
*/
@TableName("sys_dict_type")
@Data
public class DictType implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -26,16 +21,10 @@ public class DictType implements Serializable {
/**
* 字典类型id
*/
@TableId("dict_type_id")
@TableId(value = "dict_type_id", type = IdType.ID_WORKER)
private Long dictTypeId;
/**
* 是否是系统字典,Y-是,N-否
*/
@TableField("system_flag")
private String systemFlag;
/**
* 字典类型编码
*/
@TableField("code")
......@@ -54,6 +43,12 @@ public class DictType implements Serializable {
private String description;
/**
* 是否是系统字典,Y-是,N-否
*/
@TableField("system_flag")
private String systemFlag;
/**
* 状态(字典)
*/
@TableField("status")
......@@ -89,4 +84,109 @@ public class DictType implements Serializable {
@TableField(value = "update_user", fill = FieldFill.UPDATE)
private Long updateUser;
public Long getDictTypeId() {
return dictTypeId;
}
public void setDictTypeId(Long dictTypeId) {
this.dictTypeId = dictTypeId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "DictType{" +
"dictTypeId=" + dictTypeId +
", code=" + code +
", name=" + name +
", description=" + description +
", systemFlag=" + systemFlag +
", status=" + status +
", sort=" + sort +
", createTime=" + createTime +
", createUser=" + createUser +
", updateTime=" + updateTime +
", updateUser=" + updateUser +
"}";
}
}
......@@ -8,11 +8,10 @@ import java.util.Date;
/**
* <p>
* 文件信息表
*
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_file_info")
public class FileInfo implements Serializable {
......@@ -22,28 +21,33 @@ public class FileInfo implements Serializable {
/**
* 主键id
*/
@TableId(value = "file_id", type = IdType.ID_WORKER_STR)
@TableId(value = "file_id", type = IdType.ID_WORKER)
private String fileId;
/**
* base64编码的文件
*/
@TableField("file_data")
private String fileData;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建用户
*/
@TableField(value = "create_user", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改用户
*/
......@@ -102,12 +106,12 @@ public class FileInfo implements Serializable {
@Override
public String toString() {
return "FileInfo{" +
", fileId=" + fileId +
", fileData=" + fileData +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
"fileId=" + fileId +
", fileData=" + fileData +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
......@@ -11,7 +11,7 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_login_log")
public class LoginLog implements Serializable {
......@@ -23,37 +23,44 @@ public class LoginLog implements Serializable {
*/
@TableId(value = "login_log_id", type = IdType.ID_WORKER)
private Long loginLogId;
/**
* 日志名称
*/
@TableField("log_name")
private String logName;
/**
* 管理员id
*/
@TableField("user_id")
private Long userId;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 是否执行成功
*/
@TableField("succeed")
private String succeed;
/**
* 具体消息
*/
@TableField("message")
private String message;
/**
* 登录ip
*/
@TableField("ip_address")
private String ipAddress;
public Long getLoginLogId() {
return loginLogId;
}
......@@ -113,13 +120,13 @@ public class LoginLog implements Serializable {
@Override
public String toString() {
return "LoginLog{" +
", loginLogId=" + loginLogId +
", logName=" + logName +
", userId=" + userId +
", createTime=" + createTime +
", succeed=" + succeed +
", message=" + message +
", ipAddress=" + ipAddress +
"}";
"loginLogId=" + loginLogId +
", logName=" + logName +
", userId=" + userId +
", createTime=" + createTime +
", succeed=" + succeed +
", message=" + message +
", ipAddress=" + ipAddress +
"}";
}
}
......@@ -11,7 +11,7 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_menu")
public class Menu implements Serializable {
......@@ -23,86 +23,103 @@ public class Menu implements Serializable {
*/
@TableId(value = "menu_id", type = IdType.ID_WORKER)
private Long menuId;
/**
* 菜单编号
*/
@TableField("code")
private String code;
/**
* 菜单父编号
*/
@TableField("pcode")
private String pcode;
/**
* 当前菜单的所有父菜单编号
*/
@TableField("pcodes")
private String pcodes;
/**
* 菜单名称
*/
@TableField("name")
private String name;
/**
* 菜单图标
*/
@TableField("icon")
private String icon;
/**
* url地址
*/
@TableField("url")
private String url;
/**
* 菜单排序号
*/
@TableField("sort")
private Integer sort;
/**
* 菜单层级
*/
@TableField("levels")
private Integer levels;
/**
* 是否是菜单(字典)
*/
@TableField("menu_flag")
private String menuFlag;
/**
* 备注
*/
@TableField("description")
private String description;
/**
* 菜单状态(字典)
*/
@TableField("status")
private String status;
/**
* 是否打开新页面的标识(字典)
*/
@TableField("new_page_flag")
private String newPageFlag;
/**
* 是否打开(字典)
*/
@TableField("open_flag")
private String openFlag;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建人
*/
@TableField(value = "create_user", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改人
*/
......@@ -257,24 +274,24 @@ public class Menu implements Serializable {
@Override
public String toString() {
return "Menu{" +
", menuId=" + menuId +
", code=" + code +
", pcode=" + pcode +
", pcodes=" + pcodes +
", name=" + name +
", icon=" + icon +
", url=" + url +
", sort=" + sort +
", levels=" + levels +
", menuFlag=" + menuFlag +
", description=" + description +
", status=" + status +
", newPageFlag=" + newPageFlag +
", openFlag=" + openFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
"menuId=" + menuId +
", code=" + code +
", pcode=" + pcode +
", pcodes=" + pcodes +
", name=" + name +
", icon=" + icon +
", url=" + url +
", sort=" + sort +
", levels=" + levels +
", menuFlag=" + menuFlag +
", description=" + description +
", status=" + status +
", newPageFlag=" + newPageFlag +
", openFlag=" + openFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
......@@ -11,7 +11,7 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_notice")
public class Notice implements Serializable {
......@@ -23,31 +23,37 @@ public class Notice implements Serializable {
*/
@TableId(value = "notice_id", type = IdType.ID_WORKER)
private Long noticeId;
/**
* 标题
*/
@TableField("title")
private String title;
/**
* 内容
*/
@TableField("content")
private String content;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 创建人
*/
@TableField(value = "create_user", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 修改人
*/
......@@ -114,13 +120,13 @@ public class Notice implements Serializable {
@Override
public String toString() {
return "Notice{" +
", noticeId=" + noticeId +
", title=" + title +
", content=" + content +
", createTime=" + createTime +
", createUser=" + createUser +
", updateTime=" + updateTime +
", updateUser=" + updateUser +
"}";
"noticeId=" + noticeId +
", title=" + title +
", content=" + content +
", createTime=" + createTime +
", createUser=" + createUser +
", updateTime=" + updateTime +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
/**
* <p>
......@@ -11,7 +14,7 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_operation_log")
public class OperationLog implements Serializable {
......@@ -23,41 +26,49 @@ public class OperationLog implements Serializable {
*/
@TableId(value = "operation_log_id", type = IdType.ID_WORKER)
private Long operationLogId;
/**
* 日志类型(字典)
*/
@TableField("log_type")
private String logType;
/**
* 日志名称
*/
@TableField("log_name")
private String logName;
/**
* 用户id
*/
@TableField("user_id")
private Long userId;
/**
* 类名称
*/
@TableField("class_name")
private String className;
/**
* 方法名称
*/
@TableField("method")
private String method;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 是否成功(字典)
*/
@TableField("succeed")
private String succeed;
/**
* 备注
*/
......@@ -140,15 +151,15 @@ public class OperationLog implements Serializable {
@Override
public String toString() {
return "OperationLog{" +
", operationLogId=" + operationLogId +
", logType=" + logType +
", logName=" + logName +
", userId=" + userId +
", className=" + className +
", method=" + method +
", createTime=" + createTime +
", succeed=" + succeed +
", message=" + message +
"}";
"operationLogId=" + operationLogId +
", logType=" + logType +
", logName=" + logName +
", userId=" + userId +
", className=" + className +
", method=" + method +
", createTime=" + createTime +
", succeed=" + succeed +
", message=" + message +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import static com.baomidou.mybatisplus.annotation.IdType.ID_WORKER;
/**
* <p>
* 角色和菜单关联表
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_relation")
public class Relation implements Serializable {
......@@ -24,13 +22,15 @@ public class Relation implements Serializable {
/**
* 主键
*/
@TableId(value = "relation_id", type = ID_WORKER)
@TableId(value = "relation_id", type = IdType.ID_WORKER)
private Long relationId;
/**
* 菜单id
*/
@TableField("menu_id")
private Long menuId;
/**
* 角色id
*/
......@@ -65,9 +65,9 @@ public class Relation implements Serializable {
@Override
public String toString() {
return "Relation{" +
", relationId=" + relationId +
", menuId=" + menuId +
", roleId=" + roleId +
"}";
"relationId=" + relationId +
", menuId=" + menuId +
", roleId=" + roleId +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
/**
* <p>
......@@ -11,7 +14,7 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_role")
public class Role implements Serializable {
......@@ -23,46 +26,55 @@ public class Role implements Serializable {
*/
@TableId(value = "role_id", type = IdType.ID_WORKER)
private Long roleId;
/**
* 父角色id
*/
@TableField("pid")
private Long pid;
/**
* 角色名称
*/
@TableField("name")
private String name;
/**
* 提示
*/
@TableField("description")
private String description;
/**
* 序号
*/
@TableField("sort")
private Integer sort;
/**
* 乐观锁
*/
@TableField("version")
private Integer version;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建用户
*/
@TableField(value = "create_user", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改用户
*/
......@@ -153,16 +165,16 @@ public class Role implements Serializable {
@Override
public String toString() {
return "Role{" +
", roleId=" + roleId +
", pid=" + pid +
", name=" + name +
", description=" + description +
", sort=" + sort +
", version=" + version +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
"roleId=" + roleId +
", pid=" + pid +
", name=" + name +
", description=" + description +
", sort=" + sort +
", version=" + version +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
......@@ -12,10 +11,9 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2018-12-07
* @since 2019-04-01
*/
@TableName("sys_user")
@Data
public class User implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -25,90 +23,275 @@ public class User implements Serializable {
*/
@TableId(value = "user_id", type = IdType.ID_WORKER)
private Long userId;
/**
* 头像
*/
@TableField("avatar")
private String avatar;
/**
* 账号
*/
@TableField("account")
private String account;
/**
* 密码
*/
@TableField("password")
private String password;
/**
* md5密码盐
*/
@TableField("salt")
private String salt;
/**
* 名字
*/
@TableField("name")
private String name;
/**
* 生日
*/
@TableField("birthday")
private Date birthday;
/**
* 性别(字典)
*/
@TableField("sex")
private String sex;
/**
* 电子邮件
*/
@TableField("email")
private String email;
/**
* 电话
*/
@TableField("phone")
private String phone;
/**
* 角色id(多个逗号隔开)
*/
@TableField("role_id")
private String roleId;
/**
* 部门id(多个逗号隔开)
*/
@TableField("dept_id")
private Long deptId;
/**
* 状态(字典)
*/
@TableField("status")
private String status;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 创建人
*/
@TableField(value = "create_user", fill = FieldFill.INSERT)
private Long createUser;
/**
* 更新时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 更新人
*/
@TableField(value = "update_user", fill = FieldFill.UPDATE)
private Long updateUser;
/**
* 乐观锁
*/
@TableField("version")
private Integer version;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getRoleId() {
return roleId;
}
public void setRoleId(String roleId) {
this.roleId = roleId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
@Override
public String toString() {
return "User{" +
"userId=" + userId +
", avatar=" + avatar +
", account=" + account +
", password=" + password +
", salt=" + salt +
", name=" + name +
", birthday=" + birthday +
", sex=" + sex +
", email=" + email +
", phone=" + phone +
", roleId=" + roleId +
", deptId=" + deptId +
", status=" + status +
", createTime=" + createTime +
", createUser=" + createUser +
", updateTime=" + updateTime +
", updateUser=" + updateUser +
", version=" + version +
"}";
}
}
......@@ -4,30 +4,30 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Dept">
<id column="DEPT_ID" property="deptId"/>
<result column="PID" property="pid"/>
<result column="PIDS" property="pids"/>
<result column="SIMPLE_NAME" property="simpleName"/>
<result column="FULL_NAME" property="fullName"/>
<result column="DESCRIPTION" property="description"/>
<result column="VERSION" property="version"/>
<result column="SORT" property="sort"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
<id column="dept_id" property="deptId" />
<result column="pid" property="pid" />
<result column="pids" property="pids" />
<result column="simple_name" property="simpleName" />
<result column="full_name" property="fullName" />
<result column="description" property="description" />
<result column="version" property="version" />
<result column="sort" property="sort" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user" property="createUser" />
<result column="update_user" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DEPT_ID AS deptId, PID AS pid, PIDS AS pids, SIMPLE_NAME AS simpleName, FULL_NAME AS fullName, DESCRIPTION AS description, VERSION AS version, SORT AS sort, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
dept_id AS deptId, pid AS pid, pids AS pids, simple_name AS simpleName, full_name AS fullName, description AS description, version AS version, sort AS sort, create_time AS createTime, update_time AS updateTime, create_user AS createUser, update_user AS updateUser
</sql>
<select id="tree" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select DEPT_ID AS id, PID as pId, SIMPLE_NAME as name,
select dept_id AS id, pid as pId, simple_name as name,
(
CASE
WHEN (PID = 0 OR PID IS NULL) THEN
WHEN (pid = 0 OR pid IS NULL) THEN
'true'
ELSE
'false'
......@@ -40,16 +40,16 @@
<include refid="Base_Column_List"/>
from sys_dept where 1 = 1
<if test="condition != null and condition != ''">
and SIMPLE_NAME like CONCAT('%',#{condition},'%') or FULL_NAME like CONCAT('%',#{condition},'%')
and simple_name like CONCAT('%',#{condition},'%') or full_name like CONCAT('%',#{condition},'%')
</if>
<if test="deptId != null and deptId != ''">
and (DEPT_ID = #{deptId} or DEPT_ID in ( select DEPT_ID from sys_dept where PIDS like CONCAT('%[', #{deptId}, ']%') ))
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like CONCAT('%[', #{deptId}, ']%') ))
</if>
order by SORT ASC
order by sort ASC
</select>
<select id="treeviewNodes" resultType="cn.stylefeng.guns.core.common.node.TreeviewNode">
select DEPT_ID AS tags, PID as parentId, SIMPLE_NAME as text from sys_dept
select dept_id AS tags, pid as parentId, simple_name as text from sys_dept
</select>
<select id="likePids" resultType="cn.stylefeng.guns.modular.system.entity.Dept">
......@@ -57,7 +57,7 @@
<include refid="Base_Column_List"/>
from sys_dept
<where>
PIDS LIKE CONCAT('%$[',#{deptId},'$]%') escape '$'
pids LIKE CONCAT('%$[',#{deptId},'$]%') escape '$'
</where>
</select>
......
......@@ -4,35 +4,36 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Dict">
<id column="DICT_ID" property="dictId"/>
<result column="DICT_TYPE_ID" property="dictTypeId"/>
<result column="CODE" property="code"/>
<result column="NAME" property="name"/>
<result column="PARENT_ID" property="parentId"/>
<result column="PARENT_IDS" property="parentIds"/>
<result column="STATUS" property="status"/>
<result column="DESCRIPTION" property="description"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
<id column="dict_id" property="dictId" />
<result column="dict_type_id" property="dictTypeId" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="parent_id" property="parentId" />
<result column="parent_ids" property="parentIds" />
<result column="status" property="status" />
<result column="sort" property="sort" />
<result column="description" property="description" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user" property="createUser" />
<result column="update_user" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
base.DICT_ID AS dictId, base.DICT_TYPE_ID AS dictTypeId, base.CODE AS code, base.NAME AS name, base.PARENT_ID AS parentId, base.STATUS AS status, base.DESCRIPTION AS description, base.CREATE_TIME AS createTime, base.UPDATE_TIME AS updateTime, base.CREATE_USER AS createUser, base.UPDATE_USER AS updateUser
dict_id AS dictId, dict_type_id AS dictTypeId, code AS code, name AS name, parent_id AS parentId, parent_ids AS parentIds, status AS status, sort AS sort, description AS description, create_time AS createTime, update_time AS updateTime, create_user AS createUser, update_user AS updateUser
</sql>
<select id="dictTree" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select DICT_ID AS id, PARENT_ID as pId, NAME as name,
select dict_id AS id, parent_id as pId, name as name,
(
CASE
WHEN (PARENT_ID = 0 OR PARENT_ID IS NULL) THEN
WHEN (parent_id = 0 OR parent_id IS NULL) THEN
'true'
ELSE
'false'
END
) as 'open' from sys_dict where DICT_TYPE_ID = #{dictTypeId}
) as 'open' from sys_dict where dict_type_id = #{dictTypeId}
</select>
<select id="likeParentIds" resultType="cn.stylefeng.guns.modular.system.entity.Dict">
......@@ -40,7 +41,7 @@
<include refid="Base_Column_List"></include>
from sys_dict as base
<where>
PARENT_IDS LIKE CONCAT('%$[',#{dictId},'$]%') escape '$'
parent_ids LIKE CONCAT('%$[',#{dictId},'$]%') escape '$'
</where>
</select>
......
......@@ -4,21 +4,22 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.DictType">
<id column="DICT_TYPE_ID" property="dictTypeId"/>
<result column="SYSTEM_FLAG" property="systemFlag"/>
<result column="CODE" property="code"/>
<result column="NAME" property="name"/>
<result column="DESCRIPTION" property="description"/>
<result column="STATUS" property="status"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="UPDATE_USER" property="updateUser"/>
<id column="dict_type_id" property="dictTypeId" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="description" property="description" />
<result column="system_flag" property="systemFlag" />
<result column="status" property="status" />
<result column="sort" property="sort" />
<result column="create_time" property="createTime" />
<result column="create_user" property="createUser" />
<result column="update_time" property="updateTime" />
<result column="update_user" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
base.DICT_TYPE_ID AS dictTypeId, base.SYSTEM_FLAG AS systemFlag, base.CODE AS code, base.NAME AS name, base.DESCRIPTION AS description, base.STATUS AS status, base.CREATE_TIME AS createTime, base.CREATE_USER AS createUser, base.UPDATE_TIME AS updateTime, base.UPDATE_USER AS updateUser
base.dict_type_id AS dictTypeId, base.code AS code, base.name AS name, base.description AS description, base.system_flag AS systemFlag, base.status AS status, base.sort AS sort, base.create_time AS createTime, base.create_user AS createUser, base.update_time AS updateTime, base.update_user AS updateUser
</sql>
</mapper>
......@@ -4,17 +4,17 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.FileInfo">
<id column="FILE_ID" property="fileId" />
<result column="FILE_DATA" property="fileData" />
<result column="CREATE_TIME" property="createTime" />
<result column="UPDATE_TIME" property="updateTime" />
<result column="CREATE_USER" property="createUser" />
<result column="UPDATE_USER" property="updateUser" />
<id column="file_id" property="fileId" />
<result column="file_data" property="fileData" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user" property="createUser" />
<result column="update_user" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
FILE_ID AS fileId, FILE_DATA AS fileData, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
base.file_id AS fileId, base.file_data AS fileData, base.create_time AS createTime, base.update_time AS updateTime, base.create_user AS createUser, base.update_user AS updateUser
</sql>
</mapper>
......@@ -4,29 +4,30 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.LoginLog">
<id column="LOGIN_LOG_ID" property="loginLogId"/>
<result column="LOG_NAME" property="logName"/>
<result column="USER_ID" property="userId"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="SUCCEED" property="succeed"/>
<result column="MESSAGE" property="message"/>
<result column="IP_ADDRESS" property="ipAddress"/>
<id column="login_log_id" property="loginLogId" />
<result column="log_name" property="logName" />
<result column="user_id" property="userId" />
<result column="create_time" property="createTime" />
<result column="succeed" property="succeed" />
<result column="message" property="message" />
<result column="ip_address" property="ipAddress" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
LOGIN_LOG_ID AS loginLogId, LOG_NAME AS logName, USER_ID AS userId, CREATE_TIME AS createTime, SUCCEED AS succeed, MESSAGE AS message, IP_ADDRESS AS ipAddress
login_log_id AS loginLogId, log_name AS logName, user_id AS userId, create_time AS createTime, succeed AS succeed, message AS message, ip_address AS ipAddress
</sql>
<select id="getLoginLogs" resultType="map" parameterType="com.baomidou.mybatisplus.extension.plugins.pagination.Page">
select
<include refid="Base_Column_List"/>
from sys_login_log where 1 = 1
from sys_login_log
where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
and (create_time between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and LOG_NAME like CONCAT('%',#{logName},'%')
and log_name like CONCAT('%',#{logName},'%')
</if>
</select>
......
......@@ -4,68 +4,68 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Menu">
<id column="MENU_ID" property="menuId"/>
<result column="CODE" property="code"/>
<result column="PCODE" property="pcode"/>
<result column="PCODES" property="pcodes"/>
<result column="NAME" property="name"/>
<result column="ICON" property="icon"/>
<result column="URL" property="url"/>
<result column="SORT" property="sort"/>
<result column="LEVELS" property="levels"/>
<result column="MENU_FLAG" property="menuFlag"/>
<result column="DESCRIPTION" property="description"/>
<result column="STATUS" property="status"/>
<result column="NEW_PAGE_FLAG" property="newPageFlag"/>
<result column="OPEN_FLAG" property="openFlag"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
<id column="menu_id" property="menuId" />
<result column="code" property="code" />
<result column="pcode" property="pcode" />
<result column="pcodes" property="pcodes" />
<result column="name" property="name" />
<result column="icon" property="icon" />
<result column="url" property="url" />
<result column="sort" property="sort" />
<result column="levels" property="levels" />
<result column="menu_flag" property="menuFlag" />
<result column="description" property="description" />
<result column="status" property="status" />
<result column="new_page_flag" property="newPageFlag" />
<result column="open_flag" property="openFlag" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user" property="createUser" />
<result column="update_user" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
MENU_ID AS menuId, CODE AS code, PCODE AS pcode, PCODES AS pcodes, NAME AS name, ICON AS icon, URL AS url, SORT AS sort, LEVELS AS levels, MENU_FLAG AS menuFlag, DESCRIPTION AS description, STATUS AS status, NEW_PAGE_FLAG AS newPageFlag, OPEN_FLAG AS openFlag, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
menu_id AS menuId, code AS code, pcode AS pcode, pcodes AS pcodes, name AS name, icon AS icon, url AS url, sort AS sort, levels AS levels, menu_flag AS menuFlag, description AS description, status AS status, new_page_flag AS newPageFlag, open_flag AS openFlag, create_time AS createTime, update_time AS updateTime, create_user AS createUser, update_user AS updateUser
</sql>
<select id="selectMenus" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_menu
where STATUS = 'ENABLE'
where status = 'ENABLE'
<if test="condition != null and condition != ''">
and (NAME like CONCAT('%',#{condition},'%') or CODE like CONCAT('%',#{condition},'%'))
and (name like CONCAT('%',#{condition},'%') or code like CONCAT('%',#{condition},'%'))
</if>
<if test="level != null and level != ''">
and LEVELS = #{level}
and levels = #{level}
</if>
<if test="menuId != null and menuId != 0">
and (MENU_ID = #{menuId} or MENU_ID in ( select MENU_ID from sys_menu where PCODES like CONCAT('%[', #{code}, ']%') ))
and (menu_id = #{menuId} or menu_id in ( select menu_id from sys_menu where pcodes like CONCAT('%[', #{code}, ']%') ))
</if>
</select>
<select id="getMenuIdsByRoleId" resultType="long">
select MENU_ID from
sys_relation where ROLE_ID = #{roleId}
select menu_id from
sys_relation where role_id = #{roleId}
</select>
<select id="menuTreeList" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
m1.MENU_ID AS id,
m1.menu_id AS id,
(
CASE
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
WHEN (m2.menu_id = 0 OR m2.menu_id IS NULL) THEN
0
ELSE
m2.MENU_ID
m2.menu_id
END
) AS pId,
m1.NAME
AS NAME,
m1.name
AS name,
(
CASE
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
WHEN (m2.menu_id = 0 OR m2.menu_id IS NULL) THEN
'true'
ELSE
'false'
......@@ -73,26 +73,26 @@
) as 'open'
FROM
sys_menu m1
LEFT join sys_menu m2 ON m1.PCODE = m2.CODE
LEFT join sys_menu m2 ON m1.pcode = m2.code
ORDER BY
m1.MENU_ID ASC
m1.menu_id ASC
</select>
<select id="menuTreeListByMenuIds" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
m1.MENU_ID AS id,
m1.menu_id AS id,
(
CASE
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
WHEN (m2.menu_id = 0 OR m2.menu_id IS NULL) THEN
0
ELSE
m2.MENU_ID
m2.menu_id
END
) AS pId,
m1.NAME AS name,
m1.name AS name,
(
CASE
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS
WHEN (m2.menu_id = 0 OR m2.menu_id IS
NULL) THEN
'true'
ELSE
......@@ -101,7 +101,7 @@
) as 'open',
(
CASE
WHEN (m3.MENU_ID = 0 OR m3.MENU_ID
WHEN (m3.menu_id = 0 OR m3.menu_id
IS NULL) THEN
'false'
ELSE
......@@ -112,86 +112,86 @@
sys_menu m1
LEFT JOIN
sys_menu m2
ON m1.PCODE = m2.CODE
ON m1.pcode = m2.code
left join (
SELECT
MENU_ID
menu_id
FROM
sys_menu
WHERE
MENU_ID IN
menu_id IN
<foreach collection="list" index="index" item="i" open="("
separator="," close=")">
#{i}
</foreach>
) m3 on m1.MENU_ID = m3.MENU_ID
) m3 on m1.menu_id = m3.menu_id
ORDER BY
m1.MENU_ID ASC
m1.menu_id ASC
</select>
<delete id="deleteRelationByMenu">
delete from sys_relation where MENU_ID = #{menuId}
delete from sys_relation where menu_id = #{menuId}
</delete>
<select id="getResUrlsByRoleId" resultType="string">
select URL from
sys_relation rel
inner join sys_menu m on rel.MENU_ID = m.MENU_ID
where rel.ROLE_ID = #{roleId}
inner join sys_menu m on rel.menu_id = m.menu_id
where rel.role_id = #{roleId}
</select>
<select id="getMenusByRoleIds" resultType="cn.stylefeng.guns.core.common.node.MenuNode">
SELECT
m1.MENU_ID AS id,
m1.ICON AS icon,
m1.menu_id AS id,
m1.icon AS icon,
(
CASE
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
WHEN (m2.menu_id = 0 OR m2.menu_id IS NULL) THEN
0
ELSE
m2.MENU_ID
m2.menu_id
END
) AS parentId,
m1.NAME as name,
m1.URL as url,
m1.LEVELS as levels,
m1.MENU_FLAG as ismenu,
m1.SORT as num
m1.name as name,
m1.url as url,
m1.levels as levels,
m1.menu_flag as ismenu,
m1.sort as num
FROM
sys_menu m1
LEFT join sys_menu m2 ON m1.PCODE = m2.CODE
LEFT join sys_menu m2 ON m1.pcode = m2.code
INNER JOIN (
SELECT
MENU_ID
menu_id
FROM
sys_menu
WHERE
MENU_ID IN (
menu_id IN (
SELECT
MENU_ID
menu_id
FROM
sys_relation rela
WHERE
rela.ROLE_ID IN
rela.role_id IN
<foreach collection="list" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
)
) m3 ON m1.MENU_ID = m3.MENU_ID
where m1.MENU_FLAG = 'Y'
order by LEVELS,m1.SORT asc
) m3 ON m1.menu_id = m3.menu_id
where m1.menu_flag = 'Y'
order by levels,m1.sort asc
</select>
<select id="selectMenuTree" resultType="java.util.Map">
select
<include refid="Base_Column_List"/>
from sys_menu
where STATUS = 'ENABLE'
where status = 'ENABLE'
<if test="condition != null and condition != ''">
and (NAME like CONCAT('%',#{condition},'%') or CODE like CONCAT('%',#{condition},'%'))
and (name like CONCAT('%',#{condition},'%') or code like CONCAT('%',#{condition},'%'))
</if>
<if test="level != null and level != ''">
and LEVELS = #{level}
and levels = #{level}
</if>
</select>
......@@ -200,7 +200,7 @@
<include refid="Base_Column_List"></include>
from sys_menu
<where>
PCODES LIKE CONCAT('%$[',#{code},'$]%') escape '$'
pcodes LIKE CONCAT('%$[',#{code},'$]%') escape '$'
</where>
</select>
......
......@@ -4,18 +4,18 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Notice">
<id column="NOTICE_ID" property="noticeId" />
<result column="TITLE" property="title" />
<result column="CONTENT" property="content" />
<result column="CREATE_TIME" property="createTime" />
<result column="CREATE_USER" property="createUser" />
<result column="UPDATE_TIME" property="updateTime" />
<result column="UPDATE_USER" property="updateUser" />
<id column="notice_id" property="noticeId" />
<result column="title" property="title" />
<result column="content" property="content" />
<result column="create_time" property="createTime" />
<result column="create_user" property="createUser" />
<result column="update_time" property="updateTime" />
<result column="update_user" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
NOTICE_ID AS noticeId, TITLE AS title, CONTENT AS content, CREATE_TIME AS createTime, CREATE_USER AS createUser, UPDATE_TIME AS updateTime, UPDATE_USER AS updateUser
notice_id AS noticeId, title AS title, content AS content, create_time AS createTime, create_user AS createUser, update_time AS updateTime, update_user AS updateUser
</sql>
<select id="list" resultType="map">
......@@ -23,8 +23,8 @@
<include refid="Base_Column_List"></include>
from sys_notice
<if test="condition != null and condition != ''">
where TITLE like CONCAT('%',#{condition},'%') or CONTENT like CONCAT('%',#{condition},'%')
where title like CONCAT('%',#{condition},'%') or content like CONCAT('%',#{condition},'%')
</if>
order by CREATE_TIME DESC
order by create_time DESC
</select>
</mapper>
......@@ -4,20 +4,20 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.OperationLog">
<id column="OPERATION_LOG_ID" property="operationLogId"/>
<result column="LOG_TYPE" property="logType"/>
<result column="LOG_NAME" property="logName"/>
<result column="USER_ID" property="userId"/>
<result column="CLASS_NAME" property="className"/>
<result column="METHOD" property="method"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="SUCCEED" property="succeed"/>
<result column="MESSAGE" property="message"/>
<id column="operation_log_id" property="operationLogId" />
<result column="log_type" property="logType" />
<result column="log_name" property="logName" />
<result column="user_id" property="userId" />
<result column="class_name" property="className" />
<result column="method" property="method" />
<result column="create_time" property="createTime" />
<result column="succeed" property="succeed" />
<result column="message" property="message" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
OPERATION_LOG_ID AS operationLogId, LOG_TYPE AS logType, LOG_NAME AS logName, USER_ID AS userId, CLASS_NAME AS className, METHOD AS method, CREATE_TIME AS createTime, SUCCEED AS succeed, MESSAGE AS message
operation_log_id AS operationLogId, log_type AS logType, log_name AS logName, user_id AS userId, class_name AS className, method AS method, create_time AS createTime, succeed AS succeed, message AS message
</sql>
<select id="getOperationLogs" resultType="map">
......@@ -25,13 +25,13 @@
<include refid="Base_Column_List"/>
from sys_operation_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
and (create_time between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and LOG_NAME like CONCAT('%',#{logName},'%')
and log_name like CONCAT('%',#{logName},'%')
</if>
<if test="logType != null and logType !=''">
and LOG_TYPE like CONCAT('%',#{logType},'%')
and log_type like CONCAT('%',#{logType},'%')
</if>
</select>
......
......@@ -4,14 +4,14 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Relation">
<id column="RELATION_ID" property="relationId" />
<result column="MENU_ID" property="menuId" />
<result column="ROLE_ID" property="roleId" />
<id column="relation_id" property="relationId" />
<result column="menu_id" property="menuId" />
<result column="role_id" property="roleId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
RELATION_ID AS relationId, MENU_ID AS menuId, ROLE_ID AS roleId
base.relation_id AS relationId, base.menu_id AS menuId, base.role_id AS roleId
</sql>
</mapper>
......@@ -4,21 +4,21 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Role">
<id column="ROLE_ID" property="roleId"/>
<result column="PID" property="pid"/>
<result column="NAME" property="name"/>
<result column="DESCRIPTION" property="description"/>
<result column="SORT" property="sort"/>
<result column="VERSION" property="version"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
<id column="role_id" property="roleId" />
<result column="pid" property="pid" />
<result column="name" property="name" />
<result column="description" property="description" />
<result column="sort" property="sort" />
<result column="version" property="version" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user" property="createUser" />
<result column="update_user" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ROLE_ID AS roleId, PID AS pid, NAME AS name, DESCRIPTION AS description, SORT AS sort, VERSION AS version, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
role_id AS roleId, pid AS pid, name AS name, description AS description, sort AS sort, version AS version, create_time AS createTime, update_time AS updateTime, create_user AS createUser, update_user AS updateUser
</sql>
<select id="selectRoles" resultType="map">
......@@ -26,29 +26,29 @@
<include refid="Base_Column_List"/>
from sys_role
<if test="condition != null">
where NAME like CONCAT('%',#{condition},'%')
where name like CONCAT('%',#{condition},'%')
</if>
order by SORT asc
order by sort asc
</select>
<delete id="deleteRolesById">
delete from sys_relation where ROLE_ID = #{roleId}
delete from sys_relation where role_id = #{roleId}
</delete>
<select id="roleTreeList" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select ROLE_ID AS id, PID as pId,
NAME as name, (case when (PID = 0 or PID is null) then 'true'
select role_id AS id, pid as pId,
name as name, (case when (pid = 0 or pid is null) then 'true'
else 'false' end) as 'open' from sys_role
</select>
<select id="roleTreeListByRoleId" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
r.ROLE_ID as id,
PID as pId,
NAME AS 'name',
r.role_id as id,
pid as pId,
name AS 'name',
(
CASE
WHEN (PID = 0 OR PID IS NULL) THEN
WHEN (pid = 0 OR pid IS NULL) THEN
'true'
ELSE
'false'
......@@ -56,7 +56,7 @@
) as 'open',
(
CASE
WHEN (r1.ROLE_ID = 0 OR r1.ROLE_ID IS NULL) THEN
WHEN (r1.role_id = 0 OR r1.role_id IS NULL) THEN
'false'
ELSE
'true'
......@@ -66,18 +66,18 @@
sys_role r
LEFT JOIN (
SELECT
ROLE_ID
role_id
FROM
sys_role
WHERE
ROLE_ID IN
role_id IN
<foreach collection="array" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
) r1 ON r.ROLE_ID = r1.ROLE_ID
ORDER BY PID,SORT ASC
) r1 ON r.role_id = r1.role_id
ORDER BY pid,sort ASC
</select>
</mapper>
......@@ -4,76 +4,73 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.User">
<id column="USER_ID" property="userId"/>
<result column="AVATAR" property="avatar"/>
<result column="ACCOUNT" property="account"/>
<result column="PASSWORD" property="password"/>
<result column="SALT" property="salt"/>
<result column="NAME" property="name"/>
<result column="BIRTHDAY" property="birthday"/>
<result column="SEX" property="sex"/>
<result column="EMAIL" property="email"/>
<result column="PHONE" property="phone"/>
<result column="ROLE_ID" property="roleId"/>
<result column="DEPT_ID" property="deptId"/>
<result column="STATUS" property="status"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="VERSION" property="version"/>
<id column="user_id" property="userId" />
<result column="avatar" property="avatar" />
<result column="account" property="account" />
<result column="password" property="password" />
<result column="salt" property="salt" />
<result column="name" property="name" />
<result column="birthday" property="birthday" />
<result column="sex" property="sex" />
<result column="email" property="email" />
<result column="phone" property="phone" />
<result column="role_id" property="roleId" />
<result column="dept_id" property="deptId" />
<result column="status" property="status" />
<result column="create_time" property="createTime" />
<result column="create_user" property="createUser" />
<result column="update_time" property="updateTime" />
<result column="update_user" property="updateUser" />
<result column="version" property="version" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
USER_ID AS userId, AVATAR AS avatar, ACCOUNT AS account,
NAME AS name, BIRTHDAY AS birthday, SEX AS sex, EMAIL AS email, PHONE AS phone,
ROLE_ID AS roleId, DEPT_ID AS deptId, STATUS AS status, CREATE_TIME AS createTime, CREATE_USER AS createUser,
UPDATE_TIME AS updateTime, UPDATE_USER AS updateUser, VERSION AS version
user_id AS userId, avatar AS avatar, account AS account, password AS password, salt AS salt, name AS name, birthday AS birthday, sex AS sex, email AS email, phone AS phone, role_id AS roleId, dept_id AS deptId, status AS status, create_time AS createTime, create_user AS createUser, update_time AS updateTime, update_user AS updateUser, version AS version
</sql>
<sql id="Base_Column_List_With_Pwd">
USER_ID AS userId, AVATAR AS avatar, ACCOUNT AS account, PASSWORD AS password,
SALT AS salt, NAME AS name, BIRTHDAY AS birthday, SEX AS sex, EMAIL AS email, PHONE AS phone,
ROLE_ID AS roleId, DEPT_ID AS deptId, STATUS AS status, CREATE_TIME AS createTime, CREATE_USER AS createUser,
UPDATE_TIME AS updateTime, UPDATE_USER AS updateUser, VERSION AS version
user_id AS userId, avatar AS avatar, account AS account, password AS password,
salt AS salt, name AS name, birthday AS birthday, sex AS sex, email AS email, phone AS phone,
role_id AS roleId, dept_id AS deptId, status AS status, create_time AS createTime, create_user AS createUser,
update_time AS updateTime, update_user AS updateUser, version AS version
</sql>
<select id="selectUsers" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_user
where STATUS != 'DELETED'
where status != 'DELETED'
<if test="name != null and name != ''">
and (PHONE like CONCAT('%',#{name},'%')
or ACCOUNT like CONCAT('%',#{name},'%')
or NAME like CONCAT('%',#{name},'%'))
and (phone like CONCAT('%',#{name},'%')
or account like CONCAT('%',#{name},'%')
or name like CONCAT('%',#{name},'%'))
</if>
<if test="deptId != null and deptId != 0">
and (DEPT_ID = #{deptId} or DEPT_ID in ( select DEPT_ID from sys_dept where PIDS like CONCAT('%[', #{deptId}, ']%') ))
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like CONCAT('%[', #{deptId}, ']%') ))
</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
and (create_time between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
</select>
<update id="setStatus">
update sys_user set STATUS = #{status} where USER_ID = #{userId}
update sys_user set status = #{status} where user_id = #{userId}
</update>
<update id="changePwd">
update sys_user set PASSWORD = #{pwd} where USER_ID = #{userId}
update sys_user set password = #{pwd} where user_id = #{userId}
</update>
<update id="setRoles">
update sys_user set ROLE_ID = #{roleIds} where USER_ID =
update sys_user set role_id = #{roleIds} where user_id =
#{userId}
</update>
<select id="getByAccount" resultType="cn.stylefeng.guns.modular.system.entity.User">
select
<include refid="Base_Column_List_With_Pwd"/>
from sys_user where ACCOUNT = #{account} and STATUS != 'DELETED'
from sys_user where account = #{account} and status != 'DELETED'
</select>
</mapper>
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