Commit f940da5a by fengshuonan

更新数据库小写

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