Commit c9f9a6d6 by fengshuonan

整理了所有的数据库字段,初步修改完成

parent fa60bb4c
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<dependency> <dependency>
<groupId>cn.stylefeng.roses</groupId> <groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-core</artifactId> <artifactId>kernel-core</artifactId>
<version>1.1.0</version> <version>1.1.1</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package cn.stylefeng.guns; package cn.stylefeng.guns;
import cn.stylefeng.guns.generator.config.GeneratorAutoConfiguration;
import cn.stylefeng.roses.core.config.WebAutoConfiguration; import cn.stylefeng.roses.core.config.WebAutoConfiguration;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -27,7 +28,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -27,7 +28,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author stylefeng * @author stylefeng
* @Date 2017/5/21 12:06 * @Date 2017/5/21 12:06
*/ */
@SpringBootApplication(exclude = WebAutoConfiguration.class) @SpringBootApplication(exclude = {WebAutoConfiguration.class, GeneratorAutoConfiguration.class})
public class GunsApplication { public class GunsApplication {
private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class); private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class);
...@@ -35,5 +36,16 @@ public class GunsApplication { ...@@ -35,5 +36,16 @@ public class GunsApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(GunsApplication.class, args); SpringApplication.run(GunsApplication.class, args);
logger.info("GunsApplication is success!"); logger.info("GunsApplication is success!");
// GenerateParams generateParams = new GenerateParams();
//
// generateParams.setRemoveTablePrefix(new String[]{"sys_"});
// generateParams.setAuthor("stylefeng");
// generateParams.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/guns?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT");
// generateParams.setGeneratorInterface(false);
// generateParams.setParentPackage("cn.stylefeng.guns.modular.system");
// generateParams.setGeneratorInterface(false);
//
// SimpleGenerator.doGeneration(generateParams);
} }
} }
...@@ -44,7 +44,7 @@ import java.util.HashMap; ...@@ -44,7 +44,7 @@ import java.util.HashMap;
@Configuration @Configuration
@ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "true") @ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "true")
@EnableTransactionManagement(order = 2, proxyTargetClass = true) @EnableTransactionManagement(order = 2, proxyTargetClass = true)
@MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.dao", "cn.stylefeng.guns.multi.mapper"}) @MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.mapper", "cn.stylefeng.guns.multi.mapper"})
public class MultiDataSourceConfig { public class MultiDataSourceConfig {
/** /**
......
...@@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration @Configuration
@ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "false", matchIfMissing = true) @ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "false", matchIfMissing = true)
@EnableTransactionManagement @EnableTransactionManagement
@MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.dao"}) @MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.mapper"})
public class SingleDataSourceConfig { public class SingleDataSourceConfig {
/** /**
......
...@@ -40,12 +40,12 @@ public interface Const { ...@@ -40,12 +40,12 @@ public interface Const {
/** /**
* 管理员id * 管理员id
*/ */
Integer ADMIN_ID = 1; Long ADMIN_ID = 1L;
/** /**
* 超级管理员角色id * 超级管理员角色id
*/ */
Integer ADMIN_ROLE_ID = 1; Long ADMIN_ROLE_ID = 1L;
/** /**
* 接口文档的菜单名 * 接口文档的菜单名
......
...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.cache.CacheKey; ...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.cache.CacheKey;
import cn.stylefeng.guns.core.common.constant.state.ManagerStatus; import cn.stylefeng.guns.core.common.constant.state.ManagerStatus;
import cn.stylefeng.guns.core.common.constant.state.MenuStatus; import cn.stylefeng.guns.core.common.constant.state.MenuStatus;
import cn.stylefeng.guns.core.log.LogObjectHolder; import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.dao.*; import cn.stylefeng.guns.modular.system.entity.*;
import cn.stylefeng.guns.modular.system.model.*; import cn.stylefeng.guns.modular.system.mapper.*;
import cn.stylefeng.roses.core.util.SpringContextHolder; import cn.stylefeng.roses.core.util.SpringContextHolder;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
...@@ -63,7 +63,7 @@ public class ConstantFactory implements IConstantFactory { ...@@ -63,7 +63,7 @@ public class ConstantFactory implements IConstantFactory {
* @Date 2017/5/9 23:41 * @Date 2017/5/9 23:41
*/ */
@Override @Override
public String getUserNameById(Integer userId) { public String getUserNameById(Long userId) {
User user = userMapper.selectById(userId); User user = userMapper.selectById(userId);
if (user != null) { if (user != null) {
return user.getName(); return user.getName();
...@@ -79,7 +79,7 @@ public class ConstantFactory implements IConstantFactory { ...@@ -79,7 +79,7 @@ public class ConstantFactory implements IConstantFactory {
* @date 2017年5月16日21:55:371 * @date 2017年5月16日21:55:371
*/ */
@Override @Override
public String getUserAccountById(Integer userId) { public String getUserAccountById(Long userId) {
User user = userMapper.selectById(userId); User user = userMapper.selectById(userId);
if (user != null) { if (user != null) {
return user.getAccount(); return user.getAccount();
...@@ -113,7 +113,7 @@ public class ConstantFactory implements IConstantFactory { ...@@ -113,7 +113,7 @@ public class ConstantFactory implements IConstantFactory {
*/ */
@Override @Override
@Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_NAME + "'+#roleId") @Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_NAME + "'+#roleId")
public String getSingleRoleName(Integer roleId) { public String getSingleRoleName(Long roleId) {
if (0 == roleId) { if (0 == roleId) {
return "--"; return "--";
} }
...@@ -129,13 +129,13 @@ public class ConstantFactory implements IConstantFactory { ...@@ -129,13 +129,13 @@ public class ConstantFactory implements IConstantFactory {
*/ */
@Override @Override
@Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_TIP + "'+#roleId") @Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_TIP + "'+#roleId")
public String getSingleRoleTip(Integer roleId) { public String getSingleRoleTip(Long roleId) {
if (0 == roleId) { if (0 == roleId) {
return "--"; return "--";
} }
Role roleObj = roleMapper.selectById(roleId); Role roleObj = roleMapper.selectById(roleId);
if (ToolUtil.isNotEmpty(roleObj) && ToolUtil.isNotEmpty(roleObj.getName())) { if (ToolUtil.isNotEmpty(roleObj) && ToolUtil.isNotEmpty(roleObj.getName())) {
return roleObj.getTips(); return roleObj.getDescription();
} }
return ""; return "";
} }
...@@ -145,10 +145,10 @@ public class ConstantFactory implements IConstantFactory { ...@@ -145,10 +145,10 @@ public class ConstantFactory implements IConstantFactory {
*/ */
@Override @Override
@Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.DEPT_NAME + "'+#deptId") @Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.DEPT_NAME + "'+#deptId")
public String getDeptName(Integer deptId) { public String getDeptName(Long deptId) {
Dept dept = deptMapper.selectById(deptId); Dept dept = deptMapper.selectById(deptId);
if (ToolUtil.isNotEmpty(dept) && ToolUtil.isNotEmpty(dept.getFullname())) { if (ToolUtil.isNotEmpty(dept) && ToolUtil.isNotEmpty(dept.getFullName())) {
return dept.getFullname(); return dept.getFullName();
} }
return ""; return "";
} }
...@@ -209,7 +209,7 @@ public class ConstantFactory implements IConstantFactory { ...@@ -209,7 +209,7 @@ public class ConstantFactory implements IConstantFactory {
* 获取字典名称 * 获取字典名称
*/ */
@Override @Override
public String getDictName(Integer dictId) { public String getDictName(Long dictId) {
if (ToolUtil.isEmpty(dictId)) { if (ToolUtil.isEmpty(dictId)) {
return ""; return "";
} else { } else {
...@@ -226,7 +226,7 @@ public class ConstantFactory implements IConstantFactory { ...@@ -226,7 +226,7 @@ public class ConstantFactory implements IConstantFactory {
* 获取通知标题 * 获取通知标题
*/ */
@Override @Override
public String getNoticeTitle(Integer dictId) { public String getNoticeTitle(Long dictId) {
if (ToolUtil.isEmpty(dictId)) { if (ToolUtil.isEmpty(dictId)) {
return ""; return "";
} else { } else {
...@@ -243,7 +243,7 @@ public class ConstantFactory implements IConstantFactory { ...@@ -243,7 +243,7 @@ public class ConstantFactory implements IConstantFactory {
* 根据字典名称和字典中的值获取对应的名称 * 根据字典名称和字典中的值获取对应的名称
*/ */
@Override @Override
public String getDictsByName(String name, Integer val) { public String getDictsByName(String name, String code) {
Dict temp = new Dict(); Dict temp = new Dict();
temp.setName(name); temp.setName(name);
Dict dict = dictMapper.selectOne(temp); Dict dict = dictMapper.selectOne(temp);
...@@ -251,10 +251,10 @@ public class ConstantFactory implements IConstantFactory { ...@@ -251,10 +251,10 @@ public class ConstantFactory implements IConstantFactory {
return ""; return "";
} else { } else {
Wrapper<Dict> wrapper = new EntityWrapper<>(); Wrapper<Dict> wrapper = new EntityWrapper<>();
wrapper = wrapper.eq("pid", dict.getId()); wrapper = wrapper.eq("PID", dict.getDictId());
List<Dict> dicts = dictMapper.selectList(wrapper); List<Dict> dicts = dictMapper.selectList(wrapper);
for (Dict item : dicts) { for (Dict item : dicts) {
if (item.getNum() != null && item.getNum().equals(val)) { if (item.getCode() != null && item.getCode().equals(code)) {
return item.getName(); return item.getName();
} }
} }
...@@ -266,36 +266,36 @@ public class ConstantFactory implements IConstantFactory { ...@@ -266,36 +266,36 @@ public class ConstantFactory implements IConstantFactory {
* 获取性别名称 * 获取性别名称
*/ */
@Override @Override
public String getSexName(Integer sex) { public String getSexName(String sexCode) {
return getDictsByName("性别", sex); return getDictsByName("性别", sexCode);
} }
/** /**
* 获取用户登录状态 * 获取用户登录状态
*/ */
@Override @Override
public String getStatusName(Integer status) { public String getStatusName(String status) {
return ManagerStatus.valueOf(status); return ManagerStatus.getDescription(status);
} }
/** /**
* 获取菜单状态 * 获取菜单状态
*/ */
@Override @Override
public String getMenuStatusName(Integer status) { public String getMenuStatusName(String status) {
return MenuStatus.valueOf(status); return MenuStatus.getDescription(status);
} }
/** /**
* 查询字典 * 查询字典
*/ */
@Override @Override
public List<Dict> findInDict(Integer id) { public List<Dict> findInDict(Long id) {
if (ToolUtil.isEmpty(id)) { if (ToolUtil.isEmpty(id)) {
return null; return null;
} else { } else {
EntityWrapper<Dict> wrapper = new EntityWrapper<>(); EntityWrapper<Dict> wrapper = new EntityWrapper<>();
List<Dict> dicts = dictMapper.selectList(wrapper.eq("pid", id)); List<Dict> dicts = dictMapper.selectList(wrapper.eq("PID", id));
if (dicts == null || dicts.size() == 0) { if (dicts == null || dicts.size() == 0) {
return null; return null;
} else { } else {
...@@ -316,16 +316,16 @@ public class ConstantFactory implements IConstantFactory { ...@@ -316,16 +316,16 @@ public class ConstantFactory implements IConstantFactory {
* 获取子部门id * 获取子部门id
*/ */
@Override @Override
public List<Integer> getSubDeptId(Integer deptid) { public List<Long> getSubDeptId(Long deptid) {
Wrapper<Dept> wrapper = new EntityWrapper<>(); Wrapper<Dept> wrapper = new EntityWrapper<>();
wrapper = wrapper.like("pids", "%[" + deptid + "]%"); wrapper = wrapper.like("PIDS", "%[" + deptid + "]%");
List<Dept> depts = this.deptMapper.selectList(wrapper); List<Dept> depts = this.deptMapper.selectList(wrapper);
ArrayList<Integer> deptids = new ArrayList<>(); ArrayList<Long> deptids = new ArrayList<>();
if (depts != null && depts.size() > 0) { if (depts != null && depts.size() > 0) {
for (Dept dept : depts) { for (Dept dept : depts) {
deptids.add(dept.getId()); deptids.add(dept.getDeptId());
} }
} }
...@@ -336,13 +336,13 @@ public class ConstantFactory implements IConstantFactory { ...@@ -336,13 +336,13 @@ public class ConstantFactory implements IConstantFactory {
* 获取所有父部门id * 获取所有父部门id
*/ */
@Override @Override
public List<Integer> getParentDeptIds(Integer deptid) { public List<Long> getParentDeptIds(Long deptid) {
Dept dept = deptMapper.selectById(deptid); Dept dept = deptMapper.selectById(deptid);
String pids = dept.getPids(); String pids = dept.getPids();
String[] split = pids.split(","); String[] split = pids.split(",");
ArrayList<Integer> parentDeptIds = new ArrayList<>(); ArrayList<Long> parentDeptIds = new ArrayList<>();
for (String s : split) { for (String s : split) {
parentDeptIds.add(Integer.valueOf(StrUtil.removeSuffix(StrUtil.removePrefix(s, "["), "]"))); parentDeptIds.add(Long.valueOf(StrUtil.removeSuffix(StrUtil.removePrefix(s, "["), "]")));
} }
return parentDeptIds; return parentDeptIds;
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package cn.stylefeng.guns.core.common.constant.factory; package cn.stylefeng.guns.core.common.constant.factory;
import cn.stylefeng.guns.modular.system.model.Dict; import cn.stylefeng.guns.modular.system.entity.Dict;
import java.util.List; import java.util.List;
...@@ -33,7 +33,7 @@ public interface IConstantFactory { ...@@ -33,7 +33,7 @@ public interface IConstantFactory {
* @author stylefeng * @author stylefeng
* @Date 2017/5/9 23:41 * @Date 2017/5/9 23:41
*/ */
String getUserNameById(Integer userId); String getUserNameById(Long userId);
/** /**
* 根据用户id获取用户账号 * 根据用户id获取用户账号
...@@ -41,7 +41,7 @@ public interface IConstantFactory { ...@@ -41,7 +41,7 @@ public interface IConstantFactory {
* @author stylefeng * @author stylefeng
* @date 2017年5月16日21:55:371 * @date 2017年5月16日21:55:371
*/ */
String getUserAccountById(Integer userId); String getUserAccountById(Long userId);
/** /**
* 通过角色ids获取角色名称 * 通过角色ids获取角色名称
...@@ -51,17 +51,17 @@ public interface IConstantFactory { ...@@ -51,17 +51,17 @@ public interface IConstantFactory {
/** /**
* 通过角色id获取角色名称 * 通过角色id获取角色名称
*/ */
String getSingleRoleName(Integer roleId); String getSingleRoleName(Long roleId);
/** /**
* 通过角色id获取角色英文名称 * 通过角色id获取角色英文名称
*/ */
String getSingleRoleTip(Integer roleId); String getSingleRoleTip(Long roleId);
/** /**
* 获取部门名称 * 获取部门名称
*/ */
String getDeptName(Integer deptId); String getDeptName(Long deptId);
/** /**
* 获取菜单的名称们(多个) * 获取菜单的名称们(多个)
...@@ -81,37 +81,37 @@ public interface IConstantFactory { ...@@ -81,37 +81,37 @@ public interface IConstantFactory {
/** /**
* 获取字典名称 * 获取字典名称
*/ */
String getDictName(Integer dictId); String getDictName(Long dictId);
/** /**
* 获取通知标题 * 获取通知标题
*/ */
String getNoticeTitle(Integer dictId); String getNoticeTitle(Long dictId);
/** /**
* 根据字典名称和字典中的值获取对应的名称 * 根据字典名称和字典中的值获取对应的名称
*/ */
String getDictsByName(String name, Integer val); String getDictsByName(String name, String code);
/** /**
* 获取性别名称 * 获取性别名称
*/ */
String getSexName(Integer sex); String getSexName(String sexCode);
/** /**
* 获取用户登录状态 * 获取用户登录状态
*/ */
String getStatusName(Integer status); String getStatusName(String status);
/** /**
* 获取菜单状态 * 获取菜单状态
*/ */
String getMenuStatusName(Integer status); String getMenuStatusName(String status);
/** /**
* 查询字典 * 查询字典
*/ */
List<Dict> findInDict(Integer id); List<Dict> findInDict(Long id);
/** /**
* 获取被缓存的对象(用户删除业务) * 获取被缓存的对象(用户删除业务)
...@@ -121,11 +121,11 @@ public interface IConstantFactory { ...@@ -121,11 +121,11 @@ public interface IConstantFactory {
/** /**
* 获取子部门id * 获取子部门id
*/ */
List<Integer> getSubDeptId(Integer deptid); List<Long> getSubDeptId(Long deptid);
/** /**
* 获取所有父部门id * 获取所有父部门id
*/ */
List<Integer> getParentDeptIds(Integer deptid); List<Long> getParentDeptIds(Long deptid);
} }
...@@ -15,46 +15,33 @@ ...@@ -15,46 +15,33 @@
*/ */
package cn.stylefeng.guns.core.common.constant.state; package cn.stylefeng.guns.core.common.constant.state;
import lombok.Getter;
/** /**
* 管理员的状态 * 管理员的状态
* *
* @author fengshuonan * @author fengshuonan
* @Date 2017年1月10日 下午9:54:13 * @Date 2017年1月10日 下午9:54:13
*/ */
@Getter
public enum ManagerStatus { public enum ManagerStatus {
OK(1, "启用"), FREEZED(2, "冻结"), DELETED(3, "被删除"); OK("ENABLE", "启用"), FREEZED("LOCKED", "冻结"), DELETED("DELETED", "被删除");
int code; String code;
String message; String message;
ManagerStatus(int code, String message) { ManagerStatus(String code, String message) {
this.code = code; this.code = code;
this.message = message; this.message = message;
} }
public int getCode() { public static String getDescription(String value) {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public static String valueOf(Integer value) {
if (value == null) { if (value == null) {
return ""; return "";
} else { } else {
for (ManagerStatus ms : ManagerStatus.values()) { for (ManagerStatus ms : ManagerStatus.values()) {
if (ms.getCode() == value) { if (ms.getCode().equals(value)) {
return ms.getMessage(); return ms.getMessage();
} }
} }
......
...@@ -15,47 +15,34 @@ ...@@ -15,47 +15,34 @@
*/ */
package cn.stylefeng.guns.core.common.constant.state; package cn.stylefeng.guns.core.common.constant.state;
import lombok.Getter;
/** /**
* 菜单的状态 * 菜单的状态
* *
* @author fengshuonan * @author fengshuonan
* @Date 2017年1月22日 下午12:14:59 * @Date 2017年1月22日 下午12:14:59
*/ */
@Getter
public enum MenuStatus { public enum MenuStatus {
ENABLE(1, "启用"), ENABLE("ENABLE", "启用"),
DISABLE(0, "禁用"); DISABLE("DISABLE", "禁用");
int code; String code;
String message; String message;
MenuStatus(int code, String message) { MenuStatus(String code, String message) {
this.code = code; this.code = code;
this.message = message; this.message = message;
} }
public int getCode() { public static String getDescription(String status) {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public static String valueOf(Integer status) {
if (status == null) { if (status == null) {
return ""; return "";
} else { } else {
for (MenuStatus s : MenuStatus.values()) { for (MenuStatus s : MenuStatus.values()) {
if (s.getCode() == status) { if (s.getCode().equals(status)) {
return s.getMessage(); return s.getMessage();
} }
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package cn.stylefeng.guns.core.common.node; package cn.stylefeng.guns.core.common.node;
import cn.stylefeng.roses.kernel.model.enums.YesOrNotEnum; import cn.stylefeng.roses.kernel.model.enums.YesOrNotEnum;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.*; import java.util.*;
...@@ -25,6 +26,7 @@ import java.util.*; ...@@ -25,6 +26,7 @@ import java.util.*;
* @Description 菜单的节点 * @Description 菜单的节点
* @date 2016年12月6日 上午11:34:17 * @date 2016年12月6日 上午11:34:17
*/ */
@Data
public class MenuNode implements Comparable, Serializable { public class MenuNode implements Comparable, Serializable {
/** /**
...@@ -48,9 +50,9 @@ public class MenuNode implements Comparable, Serializable { ...@@ -48,9 +50,9 @@ public class MenuNode implements Comparable, Serializable {
private Integer levels; private Integer levels;
/** /**
* 按钮级别 * 按钮级别(Y N)
*/ */
private Integer ismenu; private String ismenu;
/** /**
* 按钮的排序 * 按钮的排序
...@@ -75,7 +77,7 @@ public class MenuNode implements Comparable, Serializable { ...@@ -75,7 +77,7 @@ public class MenuNode implements Comparable, Serializable {
/** /**
* 查询子节点时候的临时集合 * 查询子节点时候的临时集合
*/ */
private List<MenuNode> linkedList = new ArrayList<MenuNode>(); private List<MenuNode> linkedList = new ArrayList<>();
public MenuNode() { public MenuNode() {
super(); super();
...@@ -87,97 +89,6 @@ public class MenuNode implements Comparable, Serializable { ...@@ -87,97 +89,6 @@ public class MenuNode implements Comparable, Serializable {
this.parentId = parentId; this.parentId = parentId;
} }
public Integer getLevels() {
return levels;
}
public void setLevels(Integer levels) {
this.levels = levels;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public static MenuNode createRoot() {
return new MenuNode(0L, -1L);
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public List<MenuNode> getChildren() {
return children;
}
public void setChildren(List<MenuNode> children) {
this.children = children;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getIsmenu() {
return ismenu;
}
public void setIsmenu(Integer ismenu) {
this.ismenu = ismenu;
}
@Override
public String toString() {
return "MenuNode{" +
"id=" + id +
", parentId=" + parentId +
", name='" + name + '\'' +
", levels=" + levels +
", num=" + num +
", url='" + url + '\'' +
", icon='" + icon + '\'' +
", children=" + children +
", linkedList=" + linkedList +
'}';
}
/** /**
* 重写排序比较接口,首先根据等级排序,然后更具排序字段排序 * 重写排序比较接口,首先根据等级排序,然后更具排序字段排序
* *
...@@ -210,8 +121,10 @@ public class MenuNode implements Comparable, Serializable { ...@@ -210,8 +121,10 @@ public class MenuNode implements Comparable, Serializable {
if (nodes.size() <= 0) { if (nodes.size() <= 0) {
return nodes; return nodes;
} }
//剔除非菜单 //剔除非菜单
nodes.removeIf(node -> !node.getIsmenu().equals(YesOrNotEnum.Y.getCode())); nodes.removeIf(node -> !node.getIsmenu().equals(YesOrNotEnum.Y.name()));
//对菜单排序,返回列表按菜单等级,序号的排序方式排列 //对菜单排序,返回列表按菜单等级,序号的排序方式排列
Collections.sort(nodes); Collections.sort(nodes);
return mergeList(nodes, nodes.get(nodes.size() - 1).getLevels(), null); return mergeList(nodes, nodes.get(nodes.size() - 1).getLevels(), null);
......
...@@ -17,8 +17,8 @@ package cn.stylefeng.guns.core.log.factory; ...@@ -17,8 +17,8 @@ package cn.stylefeng.guns.core.log.factory;
import cn.stylefeng.guns.core.common.constant.state.LogSucceed; import cn.stylefeng.guns.core.common.constant.state.LogSucceed;
import cn.stylefeng.guns.core.common.constant.state.LogType; import cn.stylefeng.guns.core.common.constant.state.LogType;
import cn.stylefeng.guns.modular.system.model.LoginLog; import cn.stylefeng.guns.modular.system.entity.LoginLog;
import cn.stylefeng.guns.modular.system.model.OperationLog; import cn.stylefeng.guns.modular.system.entity.OperationLog;
import java.util.Date; import java.util.Date;
...@@ -33,14 +33,14 @@ public class LogFactory { ...@@ -33,14 +33,14 @@ public class LogFactory {
/** /**
* 创建操作日志 * 创建操作日志
*/ */
public static OperationLog createOperationLog(LogType logType, Integer userId, String bussinessName, String clazzName, String methodName, String msg, LogSucceed succeed) { public static OperationLog createOperationLog(LogType logType, Long userId, String bussinessName, String clazzName, String methodName, String msg, LogSucceed succeed) {
OperationLog operationLog = new OperationLog(); OperationLog operationLog = new OperationLog();
operationLog.setLogtype(logType.getMessage()); operationLog.setLogType(logType.getMessage());
operationLog.setLogname(bussinessName); operationLog.setLogName(bussinessName);
operationLog.setUserid(userId); operationLog.setUserId(userId);
operationLog.setClassname(clazzName); operationLog.setClassName(clazzName);
operationLog.setMethod(methodName); operationLog.setMethod(methodName);
operationLog.setCreatetime(new Date()); operationLog.setCreateTime(new Date());
operationLog.setSucceed(succeed.getMessage()); operationLog.setSucceed(succeed.getMessage());
operationLog.setMessage(msg); operationLog.setMessage(msg);
return operationLog; return operationLog;
...@@ -49,13 +49,13 @@ public class LogFactory { ...@@ -49,13 +49,13 @@ public class LogFactory {
/** /**
* 创建登录日志 * 创建登录日志
*/ */
public static LoginLog createLoginLog(LogType logType, Integer userId, String msg, String ip) { public static LoginLog createLoginLog(LogType logType, Long userId, String msg, String ip) {
LoginLog loginLog = new LoginLog(); LoginLog loginLog = new LoginLog();
loginLog.setLogname(logType.getMessage()); loginLog.setLogName(logType.getMessage());
loginLog.setUserid(userId); loginLog.setUserId(userId);
loginLog.setCreatetime(new Date()); loginLog.setCreateTime(new Date());
loginLog.setSucceed(LogSucceed.SUCCESS.getMessage()); loginLog.setSucceed(LogSucceed.SUCCESS.getMessage());
loginLog.setIp(ip); loginLog.setIpAddress(ip);
loginLog.setMessage(msg); loginLog.setMessage(msg);
return loginLog; return loginLog;
} }
......
...@@ -18,10 +18,10 @@ package cn.stylefeng.guns.core.log.factory; ...@@ -18,10 +18,10 @@ package cn.stylefeng.guns.core.log.factory;
import cn.stylefeng.guns.core.common.constant.state.LogSucceed; import cn.stylefeng.guns.core.common.constant.state.LogSucceed;
import cn.stylefeng.guns.core.common.constant.state.LogType; import cn.stylefeng.guns.core.common.constant.state.LogType;
import cn.stylefeng.guns.core.log.LogManager; import cn.stylefeng.guns.core.log.LogManager;
import cn.stylefeng.guns.modular.system.dao.LoginLogMapper; import cn.stylefeng.guns.modular.system.entity.LoginLog;
import cn.stylefeng.guns.modular.system.dao.OperationLogMapper; import cn.stylefeng.guns.modular.system.entity.OperationLog;
import cn.stylefeng.guns.modular.system.model.LoginLog; import cn.stylefeng.guns.modular.system.mapper.LoginLogMapper;
import cn.stylefeng.guns.modular.system.model.OperationLog; import cn.stylefeng.guns.modular.system.mapper.OperationLogMapper;
import cn.stylefeng.roses.core.util.SpringContextHolder; import cn.stylefeng.roses.core.util.SpringContextHolder;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -41,7 +41,7 @@ public class LogTaskFactory { ...@@ -41,7 +41,7 @@ public class LogTaskFactory {
private static LoginLogMapper loginLogMapper = SpringContextHolder.getBean(LoginLogMapper.class); private static LoginLogMapper loginLogMapper = SpringContextHolder.getBean(LoginLogMapper.class);
private static OperationLogMapper operationLogMapper = SpringContextHolder.getBean(OperationLogMapper.class); private static OperationLogMapper operationLogMapper = SpringContextHolder.getBean(OperationLogMapper.class);
public static TimerTask loginLog(final Integer userId, final String ip) { public static TimerTask loginLog(final Long userId, final String ip) {
return new TimerTask() { return new TimerTask() {
@Override @Override
public void run() { public void run() {
...@@ -70,7 +70,7 @@ public class LogTaskFactory { ...@@ -70,7 +70,7 @@ public class LogTaskFactory {
}; };
} }
public static TimerTask exitLog(final Integer userId, final String ip) { public static TimerTask exitLog(final Long userId, final String ip) {
return new TimerTask() { return new TimerTask() {
@Override @Override
public void run() { public void run() {
...@@ -84,7 +84,7 @@ public class LogTaskFactory { ...@@ -84,7 +84,7 @@ public class LogTaskFactory {
}; };
} }
public static TimerTask bussinessLog(final Integer userId, final String bussinessName, final String clazzName, final String methodName, final String msg) { public static TimerTask bussinessLog(final Long userId, final String bussinessName, final String clazzName, final String methodName, final String msg) {
return new TimerTask() { return new TimerTask() {
@Override @Override
public void run() { public void run() {
...@@ -99,7 +99,7 @@ public class LogTaskFactory { ...@@ -99,7 +99,7 @@ public class LogTaskFactory {
}; };
} }
public static TimerTask exceptionLog(final Integer userId, final Exception exception) { public static TimerTask exceptionLog(final Long userId, final Exception exception) {
return new TimerTask() { return new TimerTask() {
@Override @Override
public void run() { public void run() {
......
...@@ -17,7 +17,7 @@ package cn.stylefeng.guns.core.shiro; ...@@ -17,7 +17,7 @@ package cn.stylefeng.guns.core.shiro;
import cn.stylefeng.guns.core.shiro.service.UserAuthService; import cn.stylefeng.guns.core.shiro.service.UserAuthService;
import cn.stylefeng.guns.core.shiro.service.impl.UserAuthServiceServiceImpl; import cn.stylefeng.guns.core.shiro.service.impl.UserAuthServiceServiceImpl;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationInfo;
...@@ -56,12 +56,12 @@ public class ShiroDbRealm extends AuthorizingRealm { ...@@ -56,12 +56,12 @@ public class ShiroDbRealm extends AuthorizingRealm {
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
UserAuthService shiroFactory = UserAuthServiceServiceImpl.me(); UserAuthService shiroFactory = UserAuthServiceServiceImpl.me();
ShiroUser shiroUser = (ShiroUser) principals.getPrimaryPrincipal(); ShiroUser shiroUser = (ShiroUser) principals.getPrimaryPrincipal();
List<Integer> roleList = shiroUser.getRoleList(); List<Long> roleList = shiroUser.getRoleList();
Set<String> permissionSet = new HashSet<>(); Set<String> permissionSet = new HashSet<>();
Set<String> roleNameSet = new HashSet<>(); Set<String> roleNameSet = new HashSet<>();
for (Integer roleId : roleList) { for (Long roleId : roleList) {
List<String> permissions = shiroFactory.findPermissionsByRoleId(roleId); List<String> permissions = shiroFactory.findPermissionsByRoleId(roleId);
if (permissions != null) { if (permissions != null) {
for (String permission : permissions) { for (String permission : permissions) {
......
...@@ -17,7 +17,7 @@ package cn.stylefeng.guns.core.shiro; ...@@ -17,7 +17,7 @@ package cn.stylefeng.guns.core.shiro;
import cn.stylefeng.guns.core.common.constant.Const; import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory; import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.crypto.hash.Md5Hash; import org.apache.shiro.crypto.hash.Md5Hash;
...@@ -259,9 +259,9 @@ public class ShiroKit { ...@@ -259,9 +259,9 @@ public class ShiroKit {
/** /**
* 获取当前用户的部门数据范围的集合 * 获取当前用户的部门数据范围的集合
*/ */
public static List<Integer> getDeptDataScope() { public static List<Long> getDeptDataScope() {
Integer deptId = getUser().getDeptId(); Long deptId = getUser().getDeptId();
List<Integer> subDeptIds = ConstantFactory.me().getSubDeptId(deptId); List<Long> subDeptIds = ConstantFactory.me().getSubDeptId(deptId);
subDeptIds.add(deptId); subDeptIds.add(deptId);
return subDeptIds; return subDeptIds;
} }
...@@ -270,8 +270,8 @@ public class ShiroKit { ...@@ -270,8 +270,8 @@ public class ShiroKit {
* 判断当前用户是否是超级管理员 * 判断当前用户是否是超级管理员
*/ */
public static boolean isAdmin() { public static boolean isAdmin() {
List<Integer> roleList = ShiroKit.getUser().getRoleList(); List<Long> roleList = ShiroKit.getUser().getRoleList();
for (Integer integer : roleList) { for (Long integer : roleList) {
String singleRoleTip = ConstantFactory.me().getSingleRoleTip(integer); String singleRoleTip = ConstantFactory.me().getSingleRoleTip(integer);
if (singleRoleTip.equals(Const.ADMIN_NAME)) { if (singleRoleTip.equals(Const.ADMIN_NAME)) {
return true; return true;
...@@ -290,10 +290,10 @@ public class ShiroKit { ...@@ -290,10 +290,10 @@ public class ShiroKit {
return shiroUser; return shiroUser;
} }
shiroUser.setId(user.getId()); shiroUser.setId(user.getUserId());
shiroUser.setAccount(user.getAccount()); shiroUser.setAccount(user.getAccount());
shiroUser.setDeptId(user.getDeptid()); shiroUser.setDeptId(user.getDeptId());
shiroUser.setDeptName(ConstantFactory.me().getDeptName(user.getDeptid())); shiroUser.setDeptName(ConstantFactory.me().getDeptName(user.getDeptId()));
shiroUser.setName(user.getName()); shiroUser.setName(user.getName());
shiroUser.setEmail(user.getEmail()); shiroUser.setEmail(user.getEmail());
shiroUser.setAvatar(user.getAvatar()); shiroUser.setAvatar(user.getAvatar());
......
...@@ -35,7 +35,7 @@ public class ShiroUser implements Serializable { ...@@ -35,7 +35,7 @@ public class ShiroUser implements Serializable {
/** /**
* 用户主键ID * 用户主键ID
*/ */
private Integer id; private Long id;
/** /**
* 账号 * 账号
...@@ -60,12 +60,12 @@ public class ShiroUser implements Serializable { ...@@ -60,12 +60,12 @@ public class ShiroUser implements Serializable {
/** /**
* 部门id * 部门id
*/ */
private Integer deptId; private Long deptId;
/** /**
* 角色集 * 角色集
*/ */
private List<Integer> roleList; private List<Long> roleList;
/** /**
* 部门名称 * 部门名称
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
package cn.stylefeng.guns.core.shiro.service; package cn.stylefeng.guns.core.shiro.service;
import cn.stylefeng.guns.core.shiro.ShiroUser; import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.entity.User;
import org.apache.shiro.authc.SimpleAuthenticationInfo; import org.apache.shiro.authc.SimpleAuthenticationInfo;
import java.util.List; import java.util.List;
...@@ -48,14 +48,14 @@ public interface UserAuthService { ...@@ -48,14 +48,14 @@ public interface UserAuthService {
* *
* @param roleId 角色id * @param roleId 角色id
*/ */
List<String> findPermissionsByRoleId(Integer roleId); List<String> findPermissionsByRoleId(Long roleId);
/** /**
* 根据角色id获取角色名称 * 根据角色id获取角色名称
* *
* @param roleId 角色id * @param roleId 角色id
*/ */
String findRoleNameByRoleId(Integer roleId); String findRoleNameByRoleId(Long roleId);
/** /**
* 获取shiro的认证信息 * 获取shiro的认证信息
......
...@@ -21,10 +21,10 @@ import cn.stylefeng.guns.core.common.constant.state.ManagerStatus; ...@@ -21,10 +21,10 @@ import cn.stylefeng.guns.core.common.constant.state.ManagerStatus;
import cn.stylefeng.guns.core.shiro.ShiroKit; import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser; import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.core.shiro.service.UserAuthService; import cn.stylefeng.guns.core.shiro.service.UserAuthService;
import cn.stylefeng.guns.modular.system.dao.MenuMapper; import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.dao.UserMapper; import cn.stylefeng.guns.modular.system.mapper.MenuMapper;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.mapper.UserMapper;
import cn.stylefeng.guns.modular.system.service.IUserService; import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.roses.core.util.SpringContextHolder; import cn.stylefeng.roses.core.util.SpringContextHolder;
import org.apache.shiro.authc.CredentialsException; import org.apache.shiro.authc.CredentialsException;
import org.apache.shiro.authc.LockedAccountException; import org.apache.shiro.authc.LockedAccountException;
...@@ -51,7 +51,7 @@ public class UserAuthServiceServiceImpl implements UserAuthService { ...@@ -51,7 +51,7 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
private MenuMapper menuMapper; private MenuMapper menuMapper;
@Autowired @Autowired
private IUserService userService; private UserService userService;
public static UserAuthService me() { public static UserAuthService me() {
return SpringContextHolder.getBean(UserAuthService.class); return SpringContextHolder.getBean(UserAuthService.class);
...@@ -67,7 +67,7 @@ public class UserAuthServiceServiceImpl implements UserAuthService { ...@@ -67,7 +67,7 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
throw new CredentialsException(); throw new CredentialsException();
} }
// 账号被冻结 // 账号被冻结
if (user.getStatus() != ManagerStatus.OK.getCode()) { if (!user.getStatus().equals(ManagerStatus.OK.getCode())) {
throw new LockedAccountException(); throw new LockedAccountException();
} }
return user; return user;
...@@ -79,12 +79,12 @@ public class UserAuthServiceServiceImpl implements UserAuthService { ...@@ -79,12 +79,12 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
ShiroUser shiroUser = ShiroKit.createShiroUser(user); ShiroUser shiroUser = ShiroKit.createShiroUser(user);
//用户角色数组 //用户角色数组
Integer[] roleArray = Convert.toIntArray(user.getRoleid()); Long[] roleArray = Convert.toLongArray(user.getRoleId());
//获取用户角色列表 //获取用户角色列表
List<Integer> roleList = new ArrayList<>(); List<Long> roleList = new ArrayList<>();
List<String> roleNameList = new ArrayList<>(); List<String> roleNameList = new ArrayList<>();
for (int roleId : roleArray) { for (Long roleId : roleArray) {
roleList.add(roleId); roleList.add(roleId);
roleNameList.add(ConstantFactory.me().getSingleRoleName(roleId)); roleNameList.add(ConstantFactory.me().getSingleRoleName(roleId));
} }
...@@ -98,12 +98,12 @@ public class UserAuthServiceServiceImpl implements UserAuthService { ...@@ -98,12 +98,12 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
} }
@Override @Override
public List<String> findPermissionsByRoleId(Integer roleId) { public List<String> findPermissionsByRoleId(Long roleId) {
return menuMapper.getResUrlsByRoleId(roleId); return menuMapper.getResUrlsByRoleId(roleId);
} }
@Override @Override
public String findRoleNameByRoleId(Integer roleId) { public String findRoleNameByRoleId(Long roleId) {
return ConstantFactory.me().getSingleRoleTip(roleId); return ConstantFactory.me().getSingleRoleTip(roleId);
} }
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
package cn.stylefeng.guns.core.tag; package cn.stylefeng.guns.core.tag;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum; import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.modular.system.model.Dict; import cn.stylefeng.guns.modular.system.entity.Dict;
import cn.stylefeng.guns.modular.system.service.IDictService; import cn.stylefeng.guns.modular.system.service.DictService;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException; import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import org.beetl.core.Tag; import org.beetl.core.Tag;
...@@ -40,7 +40,7 @@ import java.util.Map; ...@@ -40,7 +40,7 @@ import java.util.Map;
public class DictSelectorTag extends Tag { public class DictSelectorTag extends Tag {
@Autowired @Autowired
IDictService iDictService; DictService dictService;
@Override @Override
public void render() { public void render() {
...@@ -79,7 +79,7 @@ public class DictSelectorTag extends Tag { ...@@ -79,7 +79,7 @@ public class DictSelectorTag extends Tag {
//searchnum 下拉选项数量达到多少启用搜索,默认10 //searchnum 下拉选项数量达到多少启用搜索,默认10
int searchnum = ToolUtil.isNum(attrs.get("searchnum")) ? Integer.parseInt(attrs.get("searchnum").toString()) : 10; int searchnum = ToolUtil.isNum(attrs.get("searchnum")) ? Integer.parseInt(attrs.get("searchnum").toString()) : 10;
//根据code查询字典数据 //根据code查询字典数据
List<Dict> list = iDictService.selectByParentCode(code); List<Dict> list = dictService.selectByParentCode(code);
StringBuffer html = new StringBuffer(); StringBuffer html = new StringBuffer();
html.append("<div class=\"form-group\">\r\n"); html.append("<div class=\"form-group\">\r\n");
......
...@@ -18,8 +18,8 @@ package cn.stylefeng.guns.modular.api; ...@@ -18,8 +18,8 @@ package cn.stylefeng.guns.modular.api;
import cn.stylefeng.guns.core.shiro.ShiroKit; import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser; import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.core.util.JwtTokenUtil; import cn.stylefeng.guns.core.util.JwtTokenUtil;
import cn.stylefeng.guns.modular.system.dao.UserMapper; import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.mapper.UserMapper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ErrorResponseData; import cn.stylefeng.roses.core.reqres.response.ErrorResponseData;
import org.apache.shiro.authc.SimpleAuthenticationInfo; import org.apache.shiro.authc.SimpleAuthenticationInfo;
...@@ -76,7 +76,7 @@ public class ApiController extends BaseController { ...@@ -76,7 +76,7 @@ public class ApiController extends BaseController {
if (passwordTrueFlag) { if (passwordTrueFlag) {
HashMap<String, Object> result = new HashMap<>(); HashMap<String, Object> result = new HashMap<>();
result.put("token", JwtTokenUtil.generateToken(String.valueOf(user.getId()))); result.put("token", JwtTokenUtil.generateToken(String.valueOf(user.getUserId())));
return result; return result;
} else { } else {
return new ErrorResponseData(500, "账号密码错误!"); return new ErrorResponseData(500, "账号密码错误!");
......
...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory; ...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum; import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode; import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder; import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Dept; import cn.stylefeng.guns.modular.system.entity.Dept;
import cn.stylefeng.guns.modular.system.service.IDeptService; import cn.stylefeng.guns.modular.system.service.DeptService;
import cn.stylefeng.guns.modular.system.warpper.DeptWarpper; import cn.stylefeng.guns.modular.system.warpper.DeptWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
...@@ -52,7 +52,7 @@ public class DeptController extends BaseController { ...@@ -52,7 +52,7 @@ public class DeptController extends BaseController {
private String PREFIX = "/system/dept/"; private String PREFIX = "/system/dept/";
@Autowired @Autowired
private IDeptService deptService; private DeptService deptService;
/** /**
* 跳转到部门管理首页 * 跳转到部门管理首页
...@@ -75,7 +75,7 @@ public class DeptController extends BaseController { ...@@ -75,7 +75,7 @@ public class DeptController extends BaseController {
*/ */
@Permission @Permission
@RequestMapping("/dept_update/{deptId}") @RequestMapping("/dept_update/{deptId}")
public String deptUpdate(@PathVariable Integer deptId, Model model) { public String deptUpdate(@PathVariable Long deptId, Model model) {
Dept dept = deptService.selectById(deptId); Dept dept = deptService.selectById(deptId);
model.addAttribute(dept); model.addAttribute(dept);
model.addAttribute("pName", ConstantFactory.me().getDeptName(dept.getPid())); model.addAttribute("pName", ConstantFactory.me().getDeptName(dept.getPid()));
...@@ -102,9 +102,10 @@ public class DeptController extends BaseController { ...@@ -102,9 +102,10 @@ public class DeptController extends BaseController {
@Permission @Permission
@ResponseBody @ResponseBody
public Object add(Dept dept) { public Object add(Dept dept) {
if (ToolUtil.isOneEmpty(dept, dept.getSimplename())) { if (ToolUtil.isOneEmpty(dept, dept.getSimpleName())) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
//完善pids,根据pid拿到pid的pids //完善pids,根据pid拿到pid的pids
deptSetPids(dept); deptSetPids(dept);
return this.deptService.insert(dept); return this.deptService.insert(dept);
...@@ -127,7 +128,7 @@ public class DeptController extends BaseController { ...@@ -127,7 +128,7 @@ public class DeptController extends BaseController {
@RequestMapping(value = "/detail/{deptId}") @RequestMapping(value = "/detail/{deptId}")
@Permission @Permission
@ResponseBody @ResponseBody
public Object detail(@PathVariable("deptId") Integer deptId) { public Object detail(@PathVariable("deptId") Long deptId) {
return deptService.selectById(deptId); return deptService.selectById(deptId);
} }
...@@ -139,7 +140,7 @@ public class DeptController extends BaseController { ...@@ -139,7 +140,7 @@ public class DeptController extends BaseController {
@Permission @Permission
@ResponseBody @ResponseBody
public Object update(Dept dept) { public Object update(Dept dept) {
if (ToolUtil.isEmpty(dept) || dept.getId() == null) { if (ToolUtil.isEmpty(dept) || dept.getDeptId() == null) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
deptSetPids(dept); deptSetPids(dept);
...@@ -154,7 +155,7 @@ public class DeptController extends BaseController { ...@@ -154,7 +155,7 @@ public class DeptController extends BaseController {
@RequestMapping(value = "/delete") @RequestMapping(value = "/delete")
@Permission @Permission
@ResponseBody @ResponseBody
public Object delete(@RequestParam Integer deptId) { public Object delete(@RequestParam Long deptId) {
//缓存被删除的部门名称 //缓存被删除的部门名称
LogObjectHolder.me().set(ConstantFactory.me().getDeptName(deptId)); LogObjectHolder.me().set(ConstantFactory.me().getDeptName(deptId));
...@@ -165,11 +166,11 @@ public class DeptController extends BaseController { ...@@ -165,11 +166,11 @@ public class DeptController extends BaseController {
} }
private void deptSetPids(Dept dept) { private void deptSetPids(Dept dept) {
if (ToolUtil.isEmpty(dept.getPid()) || dept.getPid().equals(0)) { if (ToolUtil.isEmpty(dept.getPid()) || dept.getPid().equals(0L)) {
dept.setPid(0); dept.setPid(0L);
dept.setPids("[0],"); dept.setPids("[0],");
} else { } else {
int pid = dept.getPid(); Long pid = dept.getPid();
Dept temp = deptService.selectById(pid); Dept temp = deptService.selectById(pid);
String pids = temp.getPids(); String pids = temp.getPids();
dept.setPid(pid); dept.setPid(pid);
......
...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.dictmap.DictMap; ...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.dictmap.DictMap;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory; import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum; import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.log.LogObjectHolder; import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Dict; import cn.stylefeng.guns.modular.system.entity.Dict;
import cn.stylefeng.guns.modular.system.service.IDictService; import cn.stylefeng.guns.modular.system.service.DictService;
import cn.stylefeng.guns.modular.system.warpper.DictWarpper; import cn.stylefeng.guns.modular.system.warpper.DictWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
...@@ -53,7 +53,7 @@ public class DictController extends BaseController { ...@@ -53,7 +53,7 @@ public class DictController extends BaseController {
private String PREFIX = "/system/dict/"; private String PREFIX = "/system/dict/";
@Autowired @Autowired
private IDictService dictService; private DictService dictService;
/** /**
* 跳转到字典管理首页 * 跳转到字典管理首页
...@@ -79,7 +79,7 @@ public class DictController extends BaseController { ...@@ -79,7 +79,7 @@ public class DictController extends BaseController {
public String deptUpdate(@PathVariable Integer dictId, Model model) { public String deptUpdate(@PathVariable Integer dictId, Model model) {
Dict dict = dictService.selectById(dictId); Dict dict = dictService.selectById(dictId);
model.addAttribute("dict", dict); model.addAttribute("dict", dict);
List<Dict> subDicts = dictService.selectList(new EntityWrapper<Dict>().eq("pid", dictId)); List<Dict> subDicts = dictService.selectList(new EntityWrapper<Dict>().eq("PID", dictId));
model.addAttribute("subDicts", subDicts); model.addAttribute("subDicts", subDicts);
LogObjectHolder.me().set(dict); LogObjectHolder.me().set(dict);
return PREFIX + "dict_edit.html"; return PREFIX + "dict_edit.html";
...@@ -130,7 +130,7 @@ public class DictController extends BaseController { ...@@ -130,7 +130,7 @@ public class DictController extends BaseController {
@RequestMapping(value = "/update") @RequestMapping(value = "/update")
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public Object update(Integer dictId, String dictCode, String dictName, String dictTips, String dictValues) { public Object update(Long dictId, String dictCode, String dictName, String dictTips, String dictValues) {
if (ToolUtil.isOneEmpty(dictId, dictCode, dictName, dictValues)) { if (ToolUtil.isOneEmpty(dictId, dictCode, dictName, dictValues)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -145,12 +145,13 @@ public class DictController extends BaseController { ...@@ -145,12 +145,13 @@ public class DictController extends BaseController {
@RequestMapping(value = "/delete") @RequestMapping(value = "/delete")
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public Object delete(@RequestParam Integer dictId) { public Object delete(@RequestParam Long dictId) {
//缓存被删除的名称 //缓存被删除的名称
LogObjectHolder.me().set(ConstantFactory.me().getDictName(dictId)); LogObjectHolder.me().set(ConstantFactory.me().getDictName(dictId));
this.dictService.delteDict(dictId); this.dictService.delteDict(dictId);
return SUCCESS_TIP; return SUCCESS_TIP;
} }
......
...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.Const; ...@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.PageFactory; import cn.stylefeng.guns.core.common.constant.factory.PageFactory;
import cn.stylefeng.guns.core.common.constant.state.BizLogType; import cn.stylefeng.guns.core.common.constant.state.BizLogType;
import cn.stylefeng.guns.core.common.page.PageInfoBT; import cn.stylefeng.guns.core.common.page.PageInfoBT;
import cn.stylefeng.guns.modular.system.model.OperationLog; import cn.stylefeng.guns.modular.system.entity.OperationLog;
import cn.stylefeng.guns.modular.system.service.IOperationLogService; import cn.stylefeng.guns.modular.system.service.OperationLogService;
import cn.stylefeng.guns.modular.system.warpper.LogWarpper; import cn.stylefeng.guns.modular.system.warpper.LogWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner; import com.baomidou.mybatisplus.mapper.SqlRunner;
...@@ -51,7 +51,7 @@ public class LogController extends BaseController { ...@@ -51,7 +51,7 @@ public class LogController extends BaseController {
private static String PREFIX = "/system/log/"; private static String PREFIX = "/system/log/";
@Autowired @Autowired
private IOperationLogService operationLogService; private OperationLogService operationLogService;
/** /**
* 跳转到日志管理的首页 * 跳转到日志管理的首页
...@@ -80,7 +80,7 @@ public class LogController extends BaseController { ...@@ -80,7 +80,7 @@ public class LogController extends BaseController {
@RequestMapping("/detail/{id}") @RequestMapping("/detail/{id}")
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public Object detail(@PathVariable Integer id) { public Object detail(@PathVariable Long id) {
OperationLog operationLog = operationLogService.selectById(id); OperationLog operationLog = operationLogService.selectById(id);
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(operationLog); Map<String, Object> stringObjectMap = BeanUtil.beanToMap(operationLog);
return super.warpObject(new LogWarpper(stringObjectMap)); return super.warpObject(new LogWarpper(stringObjectMap));
......
...@@ -21,7 +21,7 @@ import cn.stylefeng.guns.core.log.factory.LogTaskFactory; ...@@ -21,7 +21,7 @@ import cn.stylefeng.guns.core.log.factory.LogTaskFactory;
import cn.stylefeng.guns.core.shiro.ShiroKit; import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser; import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.core.util.KaptchaUtil; import cn.stylefeng.guns.core.util.KaptchaUtil;
import cn.stylefeng.guns.modular.system.service.INoticeService; import cn.stylefeng.guns.modular.system.service.NoticeService;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
import com.google.code.kaptcha.Constants; import com.google.code.kaptcha.Constants;
...@@ -48,7 +48,7 @@ import static cn.stylefeng.roses.core.util.HttpContext.getIp; ...@@ -48,7 +48,7 @@ import static cn.stylefeng.roses.core.util.HttpContext.getIp;
public class LoginController extends BaseController { public class LoginController extends BaseController {
@Autowired @Autowired
private INoticeService noticeService; private NoticeService noticeService;
/** /**
* 跳转到主页 * 跳转到主页
...@@ -56,7 +56,7 @@ public class LoginController extends BaseController { ...@@ -56,7 +56,7 @@ public class LoginController extends BaseController {
@RequestMapping(value = "/", method = RequestMethod.GET) @RequestMapping(value = "/", method = RequestMethod.GET)
public String index(Model model) { public String index(Model model) {
List<Integer> roleList = ShiroKit.getUser().getRoleList(); List<Long> roleList = ShiroKit.getUser().getRoleList();
if (roleList == null || roleList.size() == 0) { if (roleList == null || roleList.size() == 0) {
ShiroKit.getSubject().logout(); ShiroKit.getSubject().logout();
model.addAttribute("tips", "该用户没有角色,无法登陆"); model.addAttribute("tips", "该用户没有角色,无法登陆");
......
...@@ -20,8 +20,8 @@ import cn.stylefeng.guns.core.common.annotion.Permission; ...@@ -20,8 +20,8 @@ import cn.stylefeng.guns.core.common.annotion.Permission;
import cn.stylefeng.guns.core.common.constant.Const; import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.PageFactory; import cn.stylefeng.guns.core.common.constant.factory.PageFactory;
import cn.stylefeng.guns.core.common.page.PageInfoBT; import cn.stylefeng.guns.core.common.page.PageInfoBT;
import cn.stylefeng.guns.modular.system.model.LoginLog; import cn.stylefeng.guns.modular.system.entity.LoginLog;
import cn.stylefeng.guns.modular.system.service.ILoginLogService; import cn.stylefeng.guns.modular.system.service.LoginLogService;
import cn.stylefeng.guns.modular.system.warpper.LogWarpper; import cn.stylefeng.guns.modular.system.warpper.LogWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner; import com.baomidou.mybatisplus.mapper.SqlRunner;
...@@ -48,7 +48,7 @@ public class LoginLogController extends BaseController { ...@@ -48,7 +48,7 @@ public class LoginLogController extends BaseController {
private static String PREFIX = "/system/log/"; private static String PREFIX = "/system/log/";
@Autowired @Autowired
private ILoginLogService loginLogService; private LoginLogService loginLogService;
/** /**
* 跳转到日志管理的首页 * 跳转到日志管理的首页
......
...@@ -25,8 +25,8 @@ import cn.stylefeng.guns.core.common.constant.state.MenuStatus; ...@@ -25,8 +25,8 @@ import cn.stylefeng.guns.core.common.constant.state.MenuStatus;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum; import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode; import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder; import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Menu; import cn.stylefeng.guns.modular.system.entity.Menu;
import cn.stylefeng.guns.modular.system.service.IMenuService; import cn.stylefeng.guns.modular.system.service.MenuService;
import cn.stylefeng.guns.modular.system.warpper.MenuWarpper; import cn.stylefeng.guns.modular.system.warpper.MenuWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData; import cn.stylefeng.roses.core.reqres.response.ResponseData;
...@@ -59,7 +59,7 @@ public class MenuController extends BaseController { ...@@ -59,7 +59,7 @@ public class MenuController extends BaseController {
private static String PREFIX = "/system/menu/"; private static String PREFIX = "/system/menu/";
@Autowired @Autowired
private IMenuService menuService; private MenuService menuService;
/** /**
* 跳转到菜单列表列表页面 * 跳转到菜单列表列表页面
...@@ -98,7 +98,7 @@ public class MenuController extends BaseController { ...@@ -98,7 +98,7 @@ public class MenuController extends BaseController {
menu.setPcode("0"); menu.setPcode("0");
} else { } else {
//设置父级菜单的code为父级菜单的id //设置父级菜单的code为父级菜单的id
menu.setPcode(String.valueOf(pMenu.getId())); menu.setPcode(String.valueOf(pMenu.getMenuId()));
} }
Map<String, Object> menuMap = BeanUtil.beanToMap(menu); Map<String, Object> menuMap = BeanUtil.beanToMap(menu);
...@@ -220,7 +220,7 @@ public class MenuController extends BaseController { ...@@ -220,7 +220,7 @@ public class MenuController extends BaseController {
*/ */
@RequestMapping(value = "/menuTreeListByRoleId/{roleId}") @RequestMapping(value = "/menuTreeListByRoleId/{roleId}")
@ResponseBody @ResponseBody
public List<ZTreeNode> menuTreeListByRoleId(@PathVariable Integer roleId) { public List<ZTreeNode> menuTreeListByRoleId(@PathVariable Long roleId) {
List<Long> menuIds = this.menuService.getMenuIdsByRoleId(roleId); List<Long> menuIds = this.menuService.getMenuIdsByRoleId(roleId);
if (ToolUtil.isEmpty(menuIds)) { if (ToolUtil.isEmpty(menuIds)) {
return this.menuService.menuTreeList(); return this.menuService.menuTreeList();
......
...@@ -21,8 +21,8 @@ import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory; ...@@ -21,8 +21,8 @@ import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum; import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.log.LogObjectHolder; import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.shiro.ShiroKit; import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.modular.system.model.Notice; import cn.stylefeng.guns.modular.system.entity.Notice;
import cn.stylefeng.guns.modular.system.service.INoticeService; import cn.stylefeng.guns.modular.system.service.NoticeService;
import cn.stylefeng.guns.modular.system.warpper.NoticeWrapper; import cn.stylefeng.guns.modular.system.warpper.NoticeWrapper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
...@@ -52,7 +52,7 @@ public class NoticeController extends BaseController { ...@@ -52,7 +52,7 @@ public class NoticeController extends BaseController {
private String PREFIX = "/system/notice/"; private String PREFIX = "/system/notice/";
@Autowired @Autowired
private INoticeService noticeService; private NoticeService noticeService;
/** /**
* 跳转到通知列表首页 * 跳转到通知列表首页
...@@ -74,7 +74,7 @@ public class NoticeController extends BaseController { ...@@ -74,7 +74,7 @@ public class NoticeController extends BaseController {
* 跳转到修改通知 * 跳转到修改通知
*/ */
@RequestMapping("/notice_update/{noticeId}") @RequestMapping("/notice_update/{noticeId}")
public String noticeUpdate(@PathVariable Integer noticeId, Model model) { public String noticeUpdate(@PathVariable Long noticeId, Model model) {
Notice notice = this.noticeService.selectById(noticeId); Notice notice = this.noticeService.selectById(noticeId);
model.addAttribute("notice", notice); model.addAttribute("notice", notice);
LogObjectHolder.me().set(notice); LogObjectHolder.me().set(notice);
...@@ -111,9 +111,9 @@ public class NoticeController extends BaseController { ...@@ -111,9 +111,9 @@ public class NoticeController extends BaseController {
if (ToolUtil.isOneEmpty(notice, notice.getTitle(), notice.getContent())) { if (ToolUtil.isOneEmpty(notice, notice.getTitle(), notice.getContent())) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
notice.setCreater(ShiroKit.getUser().getId()); notice.setCreateUser(ShiroKit.getUser().getId());
notice.setCreatetime(new Date()); notice.setCreateTime(new Date());
notice.insert(); this.noticeService.insert(notice);
return SUCCESS_TIP; return SUCCESS_TIP;
} }
...@@ -123,7 +123,7 @@ public class NoticeController extends BaseController { ...@@ -123,7 +123,7 @@ public class NoticeController extends BaseController {
@RequestMapping(value = "/delete") @RequestMapping(value = "/delete")
@ResponseBody @ResponseBody
@BussinessLog(value = "删除通知", key = "noticeId", dict = NoticeMap.class) @BussinessLog(value = "删除通知", key = "noticeId", dict = NoticeMap.class)
public Object delete(@RequestParam Integer noticeId) { public Object delete(@RequestParam Long noticeId) {
//缓存通知名称 //缓存通知名称
LogObjectHolder.me().set(ConstantFactory.me().getNoticeTitle(noticeId)); LogObjectHolder.me().set(ConstantFactory.me().getNoticeTitle(noticeId));
...@@ -140,13 +140,13 @@ public class NoticeController extends BaseController { ...@@ -140,13 +140,13 @@ public class NoticeController extends BaseController {
@ResponseBody @ResponseBody
@BussinessLog(value = "修改通知", key = "title", dict = NoticeMap.class) @BussinessLog(value = "修改通知", key = "title", dict = NoticeMap.class)
public Object update(Notice notice) { public Object update(Notice notice) {
if (ToolUtil.isOneEmpty(notice, notice.getId(), notice.getTitle(), notice.getContent())) { if (ToolUtil.isOneEmpty(notice, notice.getNoticeId(), notice.getTitle(), notice.getContent())) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
Notice old = this.noticeService.selectById(notice.getId()); Notice old = this.noticeService.selectById(notice.getNoticeId());
old.setTitle(notice.getTitle()); old.setTitle(notice.getTitle());
old.setContent(notice.getContent()); old.setContent(notice.getContent());
old.updateById(); this.noticeService.updateById(old);
return SUCCESS_TIP; return SUCCESS_TIP;
} }
......
...@@ -26,10 +26,10 @@ import cn.stylefeng.guns.core.common.exception.BizExceptionEnum; ...@@ -26,10 +26,10 @@ import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode; import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder; import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.util.CacheUtil; import cn.stylefeng.guns.core.util.CacheUtil;
import cn.stylefeng.guns.modular.system.model.Role; import cn.stylefeng.guns.modular.system.entity.Role;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.service.IRoleService; import cn.stylefeng.guns.modular.system.service.RoleService;
import cn.stylefeng.guns.modular.system.service.IUserService; import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.guns.modular.system.warpper.RoleWarpper; import cn.stylefeng.guns.modular.system.warpper.RoleWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData; import cn.stylefeng.roses.core.reqres.response.ResponseData;
...@@ -61,10 +61,10 @@ public class RoleController extends BaseController { ...@@ -61,10 +61,10 @@ public class RoleController extends BaseController {
private static String PREFIX = "/system/role"; private static String PREFIX = "/system/role";
@Autowired @Autowired
private IUserService userService; private UserService userService;
@Autowired @Autowired
private IRoleService roleService; private RoleService roleService;
/** /**
* 跳转到角色列表页面 * 跳转到角色列表页面
...@@ -94,7 +94,6 @@ public class RoleController extends BaseController { ...@@ -94,7 +94,6 @@ public class RoleController extends BaseController {
Role role = this.roleService.selectById(roleId); Role role = this.roleService.selectById(roleId);
model.addAttribute(role); model.addAttribute(role);
model.addAttribute("pName", ConstantFactory.me().getSingleRoleName(role.getPid())); model.addAttribute("pName", ConstantFactory.me().getSingleRoleName(role.getPid()));
model.addAttribute("deptName", ConstantFactory.me().getDeptName(role.getDeptid()));
LogObjectHolder.me().set(role); LogObjectHolder.me().set(role);
return PREFIX + "/role_edit.html"; return PREFIX + "/role_edit.html";
} }
...@@ -104,7 +103,7 @@ public class RoleController extends BaseController { ...@@ -104,7 +103,7 @@ public class RoleController extends BaseController {
*/ */
@Permission @Permission
@RequestMapping(value = "/role_assign/{roleId}") @RequestMapping(value = "/role_assign/{roleId}")
public String roleAssign(@PathVariable("roleId") Integer roleId, Model model) { public String roleAssign(@PathVariable("roleId") Long roleId, Model model) {
if (ToolUtil.isEmpty(roleId)) { if (ToolUtil.isEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -135,7 +134,7 @@ public class RoleController extends BaseController { ...@@ -135,7 +134,7 @@ public class RoleController extends BaseController {
if (result.hasErrors()) { if (result.hasErrors()) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
role.setId(null); role.setRoleId(null);
this.roleService.insert(role); this.roleService.insert(role);
return SUCCESS_TIP; return SUCCESS_TIP;
} }
...@@ -165,7 +164,7 @@ public class RoleController extends BaseController { ...@@ -165,7 +164,7 @@ public class RoleController extends BaseController {
@BussinessLog(value = "删除角色", key = "roleId", dict = RoleDict.class) @BussinessLog(value = "删除角色", key = "roleId", dict = RoleDict.class)
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public ResponseData remove(@RequestParam Integer roleId) { public ResponseData remove(@RequestParam Long roleId) {
if (ToolUtil.isEmpty(roleId)) { if (ToolUtil.isEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -190,20 +189,17 @@ public class RoleController extends BaseController { ...@@ -190,20 +189,17 @@ public class RoleController extends BaseController {
*/ */
@RequestMapping(value = "/view/{roleId}") @RequestMapping(value = "/view/{roleId}")
@ResponseBody @ResponseBody
public ResponseData view(@PathVariable Integer roleId) { public ResponseData view(@PathVariable Long roleId) {
if (ToolUtil.isEmpty(roleId)) { if (ToolUtil.isEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
Role role = this.roleService.selectById(roleId); Role role = this.roleService.selectById(roleId);
Map<String, Object> roleMap = BeanUtil.beanToMap(role); Map<String, Object> roleMap = BeanUtil.beanToMap(role);
Integer pid = role.getPid(); Long pid = role.getPid();
String pName = ConstantFactory.me().getSingleRoleName(pid); String pName = ConstantFactory.me().getSingleRoleName(pid);
roleMap.put("pName", pName); roleMap.put("pName", pName);
String deptName = ConstantFactory.me().getDeptName(role.getDeptid());
roleMap.put("deptName", deptName);
return ResponseData.success(roleMap); return ResponseData.success(roleMap);
} }
...@@ -214,7 +210,7 @@ public class RoleController extends BaseController { ...@@ -214,7 +210,7 @@ public class RoleController extends BaseController {
@BussinessLog(value = "配置权限", key = "roleId,ids", dict = RoleDict.class) @BussinessLog(value = "配置权限", key = "roleId,ids", dict = RoleDict.class)
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public ResponseData setAuthority(@RequestParam("roleId") Integer roleId, @RequestParam("ids") String ids) { public ResponseData setAuthority(@RequestParam("roleId") Long roleId, @RequestParam("ids") String ids) {
if (ToolUtil.isOneEmpty(roleId)) { if (ToolUtil.isOneEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -238,9 +234,9 @@ public class RoleController extends BaseController { ...@@ -238,9 +234,9 @@ public class RoleController extends BaseController {
*/ */
@RequestMapping(value = "/roleTreeListByUserId/{userId}") @RequestMapping(value = "/roleTreeListByUserId/{userId}")
@ResponseBody @ResponseBody
public List<ZTreeNode> roleTreeListByUserId(@PathVariable Integer userId) { public List<ZTreeNode> roleTreeListByUserId(@PathVariable Long userId) {
User theUser = this.userService.selectById(userId); User theUser = this.userService.selectById(userId);
String roleid = theUser.getRoleid(); String roleid = theUser.getRoleId();
if (ToolUtil.isEmpty(roleid)) { if (ToolUtil.isEmpty(roleid)) {
return this.roleService.roleTreeList(); return this.roleService.roleTreeList();
} else { } else {
......
...@@ -21,11 +21,11 @@ import cn.stylefeng.guns.core.common.constant.DefaultAvatar; ...@@ -21,11 +21,11 @@ import cn.stylefeng.guns.core.common.constant.DefaultAvatar;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory; import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.shiro.ShiroKit; import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser; import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.modular.system.entity.FileInfo;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.factory.UserFactory; import cn.stylefeng.guns.modular.system.factory.UserFactory;
import cn.stylefeng.guns.modular.system.model.FileInfo; import cn.stylefeng.guns.modular.system.service.FileInfoService;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.guns.modular.system.service.IFileInfoService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData; import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
...@@ -61,10 +61,10 @@ public class SystemController extends BaseController { ...@@ -61,10 +61,10 @@ public class SystemController extends BaseController {
private String PREFIX = "/common/"; private String PREFIX = "/common/";
@Autowired @Autowired
private IUserService userService; private UserService userService;
@Autowired @Autowired
private IFileInfoService fileInfoService; private FileInfoService fileInfoService;
/** /**
* 通用的树列表选择器 * 通用的树列表选择器
...@@ -132,9 +132,9 @@ public class SystemController extends BaseController { ...@@ -132,9 +132,9 @@ public class SystemController extends BaseController {
avatar = DefaultAvatar.BASE_64_AVATAR; avatar = DefaultAvatar.BASE_64_AVATAR;
} else { } else {
FileInfo fileInfo = fileInfoService.selectById(avatar); FileInfo fileInfo = fileInfoService.selectById(avatar);
if(fileInfo == null){ if (fileInfo == null) {
avatar = DefaultAvatar.BASE_64_AVATAR; avatar = DefaultAvatar.BASE_64_AVATAR;
}else{ } else {
avatar = fileInfo.getFileData(); avatar = fileInfo.getFileData();
} }
} }
...@@ -169,8 +169,8 @@ public class SystemController extends BaseController { ...@@ -169,8 +169,8 @@ public class SystemController extends BaseController {
HashMap<Object, Object> hashMap = CollectionUtil.newHashMap(); HashMap<Object, Object> hashMap = CollectionUtil.newHashMap();
hashMap.putAll(map); hashMap.putAll(map);
hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleid())); hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleId()));
hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptid())); hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptId()));
return ResponseData.success(hashMap); return ResponseData.success(hashMap);
} }
......
...@@ -28,9 +28,9 @@ import cn.stylefeng.guns.core.common.exception.BizExceptionEnum; ...@@ -28,9 +28,9 @@ import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.log.LogObjectHolder; import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.shiro.ShiroKit; import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser; import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.factory.UserFactory; import cn.stylefeng.guns.modular.system.factory.UserFactory;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.transfer.UserDto; import cn.stylefeng.guns.modular.system.transfer.UserDto;
import cn.stylefeng.guns.modular.system.warpper.UserWarpper; import cn.stylefeng.guns.modular.system.warpper.UserWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.core.base.controller.BaseController;
...@@ -70,7 +70,7 @@ public class UserMgrController extends BaseController { ...@@ -70,7 +70,7 @@ public class UserMgrController extends BaseController {
private GunsProperties gunsProperties; private GunsProperties gunsProperties;
@Autowired @Autowired
private IUserService userService; private UserService userService;
/** /**
* 跳转到查看管理员列表的页面 * 跳转到查看管理员列表的页面
...@@ -93,11 +93,11 @@ public class UserMgrController extends BaseController { ...@@ -93,11 +93,11 @@ public class UserMgrController extends BaseController {
*/ */
@Permission @Permission
@RequestMapping("/role_assign") @RequestMapping("/role_assign")
public String roleAssign(@RequestParam Integer userId, Model model) { public String roleAssign(@RequestParam Long userId, Model model) {
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
User user = this.userService.selectOne(new EntityWrapper<User>().eq("id", userId)); User user = this.userService.selectOne(new EntityWrapper<User>().eq("USER_ID", userId));
model.addAttribute("userId", userId); model.addAttribute("userId", userId);
model.addAttribute("userAccount", user.getAccount()); model.addAttribute("userAccount", user.getAccount());
return PREFIX + "user_roleassign.html"; return PREFIX + "user_roleassign.html";
...@@ -122,14 +122,14 @@ public class UserMgrController extends BaseController { ...@@ -122,14 +122,14 @@ public class UserMgrController extends BaseController {
*/ */
@RequestMapping("/user_info") @RequestMapping("/user_info")
public String userInfo(Model model) { public String userInfo(Model model) {
Integer userId = ShiroKit.getUser().getId(); Long userId = ShiroKit.getUser().getId();
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
User user = this.userService.selectById(userId); User user = this.userService.selectById(userId);
model.addAllAttributes(BeanUtil.beanToMap(user)); model.addAllAttributes(BeanUtil.beanToMap(user));
model.addAttribute("roleName", ConstantFactory.me().getRoleName(user.getRoleid())); model.addAttribute("roleName", ConstantFactory.me().getRoleName(user.getRoleId()));
model.addAttribute("deptName", ConstantFactory.me().getDeptName(user.getDeptid())); model.addAttribute("deptName", ConstantFactory.me().getDeptName(user.getDeptId()));
LogObjectHolder.me().set(user); LogObjectHolder.me().set(user);
return PREFIX + "user_view.html"; return PREFIX + "user_view.html";
} }
...@@ -147,7 +147,7 @@ public class UserMgrController extends BaseController { ...@@ -147,7 +147,7 @@ public class UserMgrController extends BaseController {
*/ */
@RequestMapping("/getUserInfo") @RequestMapping("/getUserInfo")
@ResponseBody @ResponseBody
public Object getUserInfo(@RequestParam Integer userId) { public Object getUserInfo(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new RequestEmptyException(); throw new RequestEmptyException();
} }
...@@ -157,8 +157,8 @@ public class UserMgrController extends BaseController { ...@@ -157,8 +157,8 @@ public class UserMgrController extends BaseController {
HashMap<Object, Object> hashMap = CollectionUtil.newHashMap(); HashMap<Object, Object> hashMap = CollectionUtil.newHashMap();
hashMap.putAll(map); hashMap.putAll(map);
hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleid())); hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleId()));
hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptid())); hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptId()));
return ResponseData.success(hashMap); return ResponseData.success(hashMap);
} }
...@@ -172,13 +172,13 @@ public class UserMgrController extends BaseController { ...@@ -172,13 +172,13 @@ public class UserMgrController extends BaseController {
if (ToolUtil.isOneEmpty(oldPassword, newPassword)) { if (ToolUtil.isOneEmpty(oldPassword, newPassword)) {
throw new RequestEmptyException(); throw new RequestEmptyException();
} }
Integer userId = ShiroKit.getUser().getId(); Long userId = ShiroKit.getUser().getId();
User user = userService.selectById(userId); User user = userService.selectById(userId);
String oldMd5 = ShiroKit.md5(oldPassword, user.getSalt()); String oldMd5 = ShiroKit.md5(oldPassword, user.getSalt());
if (user.getPassword().equals(oldMd5)) { if (user.getPassword().equals(oldMd5)) {
String newMd5 = ShiroKit.md5(newPassword, user.getSalt()); String newMd5 = ShiroKit.md5(newPassword, user.getSalt());
user.setPassword(newMd5); user.setPassword(newMd5);
user.updateById(); this.userService.updateById(user);
return SUCCESS_TIP; return SUCCESS_TIP;
} else { } else {
throw new ServiceException(BizExceptionEnum.OLD_PWD_NOT_RIGHT); throw new ServiceException(BizExceptionEnum.OLD_PWD_NOT_RIGHT);
...@@ -193,7 +193,7 @@ public class UserMgrController extends BaseController { ...@@ -193,7 +193,7 @@ public class UserMgrController extends BaseController {
@ResponseBody @ResponseBody
public Object list(@RequestParam(required = false) String name, public Object list(@RequestParam(required = false) String name,
@RequestParam(required = false) String timeLimit, @RequestParam(required = false) String timeLimit,
@RequestParam(required = false) Integer deptid) { @RequestParam(required = false) Long deptid) {
//拼接查询条件 //拼接查询条件
String beginTime = ""; String beginTime = "";
...@@ -276,7 +276,7 @@ public class UserMgrController extends BaseController { ...@@ -276,7 +276,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "删除管理员", key = "userId", dict = UserDict.class) @BussinessLog(value = "删除管理员", key = "userId", dict = UserDict.class)
@Permission @Permission
@ResponseBody @ResponseBody
public ResponseData delete(@RequestParam Integer userId) { public ResponseData delete(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -294,7 +294,7 @@ public class UserMgrController extends BaseController { ...@@ -294,7 +294,7 @@ public class UserMgrController extends BaseController {
*/ */
@RequestMapping("/view/{userId}") @RequestMapping("/view/{userId}")
@ResponseBody @ResponseBody
public User view(@PathVariable Integer userId) { public User view(@PathVariable Long userId) {
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -309,7 +309,7 @@ public class UserMgrController extends BaseController { ...@@ -309,7 +309,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "重置管理员密码", key = "userId", dict = UserDict.class) @BussinessLog(value = "重置管理员密码", key = "userId", dict = UserDict.class)
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public ResponseData reset(@RequestParam Integer userId) { public ResponseData reset(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -328,7 +328,7 @@ public class UserMgrController extends BaseController { ...@@ -328,7 +328,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "冻结用户", key = "userId", dict = UserDict.class) @BussinessLog(value = "冻结用户", key = "userId", dict = UserDict.class)
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public ResponseData freeze(@RequestParam Integer userId) { public ResponseData freeze(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -348,7 +348,7 @@ public class UserMgrController extends BaseController { ...@@ -348,7 +348,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "解除冻结用户", key = "userId", dict = UserDict.class) @BussinessLog(value = "解除冻结用户", key = "userId", dict = UserDict.class)
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public ResponseData unfreeze(@RequestParam Integer userId) { public ResponseData unfreeze(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) { if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -364,7 +364,7 @@ public class UserMgrController extends BaseController { ...@@ -364,7 +364,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "分配角色", key = "userId,roleIds", dict = UserDict.class) @BussinessLog(value = "分配角色", key = "userId,roleIds", dict = UserDict.class)
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public ResponseData setRole(@RequestParam("userId") Integer userId, @RequestParam("roleIds") String roleIds) { public ResponseData setRole(@RequestParam("userId") Long userId, @RequestParam("roleIds") String roleIds) {
if (ToolUtil.isOneEmpty(userId, roleIds)) { if (ToolUtil.isOneEmpty(userId, roleIds)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL); throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
} }
...@@ -397,13 +397,13 @@ public class UserMgrController extends BaseController { ...@@ -397,13 +397,13 @@ public class UserMgrController extends BaseController {
/** /**
* 判断当前登录的用户是否有操作这个用户的权限 * 判断当前登录的用户是否有操作这个用户的权限
*/ */
private void assertAuth(Integer userId) { private void assertAuth(Long userId) {
if (ShiroKit.isAdmin()) { if (ShiroKit.isAdmin()) {
return; return;
} }
List<Integer> deptDataScope = ShiroKit.getDeptDataScope(); List<Long> deptDataScope = ShiroKit.getDeptDataScope();
User user = this.userService.selectById(userId); User user = this.userService.selectById(userId);
Integer deptid = user.getDeptid(); Long deptid = user.getDeptId();
if (deptDataScope.contains(deptid)) { if (deptDataScope.contains(deptid)) {
return; return;
} else { } else {
......
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.Expense;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 报销表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-12-04
*/
public interface ExpenseMapper extends BaseMapper<Expense> {
}
\ No newline at end of file
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.FileInfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 文件信息 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-07-11
*/
public interface FileInfoMapper extends BaseMapper<FileInfo> {
}
\ No newline at end of file
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.Relation;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 角色和菜单关联表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-07-11
*/
public interface RelationMapper extends BaseMapper<Relation> {
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.DeptMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Dept">
<id column="id" property="id"/>
<result column="num" property="num"/>
<result column="pid" property="pid"/>
<result column="pids" property="pids"/>
<result column="simplename" property="simplename"/>
<result column="fullname" property="fullname"/>
<result column="tips" property="tips"/>
<result column="version" property="version"/>
</resultMap>
<select id="tree" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select id,pid as pId,simplename as name,
(
CASE
WHEN (pId = 0 OR pId IS NULL) THEN
'true'
ELSE
'false'
END
) as isOpen from sys_dept
</select>
<select id="list" resultType="map">
select * from sys_dept
<if test="condition != null and condition != ''">
where simplename like CONCAT('%',#{condition},'%') or fullname like CONCAT('%',#{condition},'%')
</if>
order by num ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.DictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Dict">
<id column="id" property="id"/>
<result column="num" property="num"/>
<result column="pid" property="pid"/>
<result column="name" property="name"/>
<result column="code" property="code"/>
<result column="tips" property="tips"/>
</resultMap>
<sql id="Base_Column_List">
id, num, pid, name,code,tips
</sql>
<select id="selectByCode" resultType="cn.stylefeng.guns.modular.system.model.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where code = #{code}
</select>
<select id="selectByParentCode" resultType="cn.stylefeng.guns.modular.system.model.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where pid in(select id from sys_dict where code = #{code}) order by num asc
</select>
<select id="list" resultType="map">
select * from sys_dict
where pid = 0
<if test="condition != null and condition != ''">
AND name like CONCAT('%',#{condition},'%')
</if>
order by id ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.NoticeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Notice">
<id column="id" property="id"/>
<result column="title" property="title"/>
<result column="type" property="type"/>
<result column="content" property="content"/>
<result column="createtime" property="createtime"/>
<result column="creater" property="creater"/>
</resultMap>
<select id="list" resultType="map">
select * from sys_notice
<if test="condition != null and condition != ''">
where title like CONCAT('%',#{condition},'%') or content like CONCAT('%',#{condition},'%')
</if>
order by createtime DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.RelationMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Relation">
<id column="id" property="id" />
<result column="menuid" property="menuid" />
<result column="roleid" property="roleid" />
</resultMap>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.UserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.User">
<id column="id" property="id" />
<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="roleid" property="roleid" />
<result column="deptid" property="deptid" />
<result column="status" property="status" />
<result column="createtime" property="createtime" />
<result column="version" property="version" />
</resultMap>
<sql id="Base_Column_List">
id, account, name, birthday, sex, email, avatar,
phone, roleid,
deptid, status,
createtime, version
</sql>
<sql id="Base_Column_List_With_Pwd">
id, account, name, birthday,password, sex, email, avatar,
phone, roleid,salt,
deptid, status,
createtime, version
</sql>
<select id="selectUsers" resultType="map">
select
<include refid="Base_Column_List" />
from sys_user
where status != 3
<if test="name != null and 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 (deptid = #{deptid} or deptid in ( select id from sys_dept where pids like CONCAT('%[', #{deptid}, ']%') ))
</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
</select>
<update id="setStatus">
update sys_user set status = #{status} where id =
#{userId}
</update>
<update id="changePwd">
update sys_user set password = #{pwd} where id =
#{userId}
</update>
<update id="setRoles">
update sys_user set roleid = #{roleIds} where id =
#{userId}
</update>
<select id="getByAccount" resultType="cn.stylefeng.guns.modular.system.model.User">
select
<include refid="Base_Column_List_With_Pwd" />
from sys_user where account = #{account} and status != 3
</select>
</mapper>
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 数据库链接信息
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("code_dbinfo")
public class CodeDbinfo implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "DB_ID", type = IdType.AUTO)
private Long dbId;
/**
* 别名
*/
@TableField("NAME")
private String name;
/**
* 数据库驱动
*/
@TableField("DB_DRIVER")
private String dbDriver;
/**
* 数据库地址
*/
@TableField("DB_URL")
private String dbUrl;
/**
* 数据库账户
*/
@TableField("DB_USER_NAME")
private String dbUserName;
/**
* 连接密码
*/
@TableField("DB_PASSWORD")
private String dbPassword;
/**
* 数据库类型(字典)
*/
@TableField("DB_TYPE")
private String dbType;
/**
* 创建时间
*/
@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;
/**
* 修改用户
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Long getDbId() {
return dbId;
}
public void setDbId(Long dbId) {
this.dbId = dbId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDbDriver() {
return dbDriver;
}
public void setDbDriver(String dbDriver) {
this.dbDriver = dbDriver;
}
public String getDbUrl() {
return dbUrl;
}
public void setDbUrl(String dbUrl) {
this.dbUrl = dbUrl;
}
public String getDbUserName() {
return dbUserName;
}
public void setDbUserName(String dbUserName) {
this.dbUserName = dbUserName;
}
public String getDbPassword() {
return dbPassword;
}
public void setDbPassword(String dbPassword) {
this.dbPassword = dbPassword;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
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 "CodeDbinfo{" +
", dbId=" + dbId +
", name=" + name +
", dbDriver=" + dbDriver +
", dbUrl=" + dbUrl +
", dbUserName=" + dbUserName +
", dbPassword=" + dbPassword +
", dbType=" + dbType +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.model; package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* <p> * <p>
...@@ -13,69 +15,88 @@ import java.io.Serializable; ...@@ -13,69 +15,88 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
@TableName("sys_dept") @TableName("sys_dept")
public class Dept extends Model<Dept> { public class Dept implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键id * 主键id
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "DEPT_ID", type = IdType.AUTO)
private Integer id; private Long deptId;
/**
* 排序
*/
private Integer num;
/** /**
* 父部门id * 父部门id
*/ */
private Integer pid; @TableField("PID")
private Long pid;
/** /**
* 父级ids * 父级ids
*/ */
@TableField("PIDS")
private String pids; private String pids;
/** /**
* 简称 * 简称
*/ */
private String simplename; @TableField("SIMPLE_NAME")
private String simpleName;
/** /**
* 全称 * 全称
*/ */
private String fullname; @TableField("FULL_NAME")
private String fullName;
/** /**
* 提示 * 描述
*/ */
private String tips; @TableField("DESCRIPTION")
private String description;
/** /**
* 版本(乐观锁保留字段) * 版本(乐观锁保留字段)
*/ */
@TableField("VERSION")
private Integer 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;
/**
* 修改人
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Integer getId() { public Long getDeptId() {
return id; return deptId;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getNum() {
return num;
} }
public void setNum(Integer num) { public void setDeptId(Long deptId) {
this.num = num; this.deptId = deptId;
} }
public Integer getPid() { public Long getPid() {
return pid; return pid;
} }
public void setPid(Integer pid) { public void setPid(Long pid) {
this.pid = pid; this.pid = pid;
} }
...@@ -87,28 +108,28 @@ public class Dept extends Model<Dept> { ...@@ -87,28 +108,28 @@ public class Dept extends Model<Dept> {
this.pids = pids; this.pids = pids;
} }
public String getSimplename() { public String getSimpleName() {
return simplename; return simpleName;
} }
public void setSimplename(String simplename) { public void setSimpleName(String simpleName) {
this.simplename = simplename; this.simpleName = simpleName;
} }
public String getFullname() { public String getFullName() {
return fullname; return fullName;
} }
public void setFullname(String fullname) { public void setFullName(String fullName) {
this.fullname = fullname; this.fullName = fullName;
} }
public String getTips() { public String getDescription() {
return tips; return description;
} }
public void setTips(String tips) { public void setDescription(String description) {
this.tips = tips; this.description = description;
} }
public Integer getVersion() { public Integer getVersion() {
...@@ -119,22 +140,61 @@ public class Dept extends Model<Dept> { ...@@ -119,22 +140,61 @@ public class Dept extends Model<Dept> {
this.version = version; this.version = version;
} }
@Override public Integer getSort() {
protected Serializable pkVal() { return sort;
return this.id; }
public void setSort(Integer sort) {
this.sort = sort;
}
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 @Override
public String toString() { public String toString() {
return "Dept{" + return "Dept{" +
"id=" + id + ", deptId=" + deptId +
", num=" + num + ", pid=" + pid +
", pid=" + pid + ", pids=" + pids +
", pids=" + pids + ", simpleName=" + simpleName +
", simplename=" + simplename + ", fullName=" + fullName +
", fullname=" + fullname + ", description=" + description +
", tips=" + tips + ", version=" + version +
", version=" + version + ", sort=" + sort +
"}"; ", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
} }
} }
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 字典表
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("sys_dict")
public class Dict implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "DICT_ID", type = IdType.AUTO)
private Long dictId;
/**
* 父级字典id
*/
@TableField("PID")
private Long pid;
/**
* 字典名称
*/
@TableField("NAME")
private String name;
/**
* 字典的编码
*/
@TableField("CODE")
private String code;
/**
* 字典描述
*/
@TableField("DESCRIPTION")
private String description;
/**
* 排序
*/
@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;
/**
* 修改人
*/
@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 getPid() {
return pid;
}
public void setPid(Long pid) {
this.pid = pid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
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 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 +
", pid=" + pid +
", name=" + name +
", code=" + code +
", description=" + description +
", sort=" + sort +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 文件信息表
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("sys_file_info")
public class FileInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId("FILE_ID")
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;
/**
* 修改用户
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileData() {
return fileData;
}
public void setFileData(String fileData) {
this.fileData = fileData;
}
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 "FileInfo{" +
", fileId=" + fileId +
", fileData=" + fileData +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.model; package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
...@@ -14,74 +15,80 @@ import java.util.Date; ...@@ -14,74 +15,80 @@ import java.util.Date;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
@TableName("sys_login_log") @TableName("sys_login_log")
public class LoginLog extends Model<LoginLog> { public class LoginLog implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "LOGIN_LOG_ID", type = IdType.AUTO)
private Integer id; private Long loginLogId;
/** /**
* 日志名称 * 日志名称
*/ */
private String logname; @TableField("LOG_NAME")
private String logName;
/** /**
* 管理员id * 管理员id
*/ */
private Integer userid; @TableField("USER_ID")
private Long userId;
/** /**
* 创建时间 * 创建时间
*/ */
private Date createtime; @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/** /**
* 是否执行成功 * 是否执行成功
*/ */
@TableField("SUCCEED")
private String succeed; private String succeed;
/** /**
* 具体消息 * 具体消息
*/ */
@TableField("MESSAGE")
private String message; private String message;
/** /**
* 登录ip * 登录ip
*/ */
private String ip; @TableField("IP_ADDRESS")
private String ipAddress;
public Integer getId() { public Long getLoginLogId() {
return id; return loginLogId;
} }
public void setId(Integer id) { public void setLoginLogId(Long loginLogId) {
this.id = id; this.loginLogId = loginLogId;
} }
public String getLogname() { public String getLogName() {
return logname; return logName;
} }
public void setLogname(String logname) { public void setLogName(String logName) {
this.logname = logname; this.logName = logName;
} }
public Integer getUserid() { public Long getUserId() {
return userid; return userId;
} }
public void setUserid(Integer userid) { public void setUserId(Long userId) {
this.userid = userid; this.userId = userId;
} }
public Date getCreatetime() { public Date getCreateTime() {
return createtime; return createTime;
} }
public void setCreatetime(Date createtime) { public void setCreateTime(Date createTime) {
this.createtime = createtime; this.createTime = createTime;
} }
public String getSucceed() { public String getSucceed() {
...@@ -100,29 +107,24 @@ public class LoginLog extends Model<LoginLog> { ...@@ -100,29 +107,24 @@ public class LoginLog extends Model<LoginLog> {
this.message = message; this.message = message;
} }
public String getIp() { public String getIpAddress() {
return ip; return ipAddress;
} }
public void setIp(String ip) { public void setIpAddress(String ipAddress) {
this.ip = ip; this.ipAddress = ipAddress;
}
@Override
protected Serializable pkVal() {
return this.id;
} }
@Override @Override
public String toString() { public String toString() {
return "LoginLog{" + return "LoginLog{" +
"id=" + id + ", loginLogId=" + loginLogId +
", logname=" + logname + ", logName=" + logName +
", userid=" + userid + ", userId=" + userId +
", createtime=" + createtime + ", createTime=" + createTime +
", succeed=" + succeed + ", succeed=" + succeed +
", message=" + message + ", message=" + message +
", ip=" + ip + ", ipAddress=" + ipAddress +
"}"; "}";
} }
} }
package cn.stylefeng.guns.modular.system.model; package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* <p> * <p>
...@@ -14,76 +15,111 @@ import java.io.Serializable; ...@@ -14,76 +15,111 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
@TableName("sys_menu") @TableName("sys_menu")
public class Menu extends Model<Menu> { public class Menu implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键id * 主键id
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "MENU_ID", type = IdType.AUTO)
private Long id; private Long menuId;
/** /**
* 菜单编号 * 菜单编号
*/ */
@TableField("CODE")
private String code; private String code;
/** /**
* 菜单父编号 * 菜单父编号
*/ */
@TableField("PCODE")
private String pcode; private String pcode;
/** /**
* 当前菜单的所有父菜单编号 * 当前菜单的所有父菜单编号
*/ */
@TableField("PCODES")
private String pcodes; private String pcodes;
/** /**
* 菜单名称 * 菜单名称
*/ */
@NotBlank @TableField("NAME")
private String name; private String name;
/** /**
* 菜单图标 * 菜单图标
*/ */
@TableField("ICON")
private String icon; private String icon;
/** /**
* url地址 * url地址
*/ */
@NotBlank @TableField("URL")
private String url; private String url;
/** /**
* 菜单排序号 * 菜单排序号
*/ */
private Integer num; @TableField("SORT")
private Integer sort;
/** /**
* 菜单层级 * 菜单层级
*/ */
@TableField("LEVELS")
private Integer levels; private Integer levels;
/** /**
* 是否是菜单(1:是 0:不是) * 是否是菜单(字典)
*/ */
private Integer ismenu; @TableField("MENU_FLAG")
private String menuFlag;
/** /**
* 备注 * 备注
*/ */
private String tips; @TableField("DESCRIPTION")
private String description;
/** /**
* 菜单状态 : 1:启用 0:不启用 * 菜单状态(字典)
*/ */
private Integer status; @TableField("STATUS")
private String status;
/** /**
* 是否打开: 1:打开 0:不打开 * 是否打开新页面的标识(字典)
*/ */
private Integer isopen; @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;
/**
* 修改人
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Long getId() { public Long getMenuId() {
return id; return menuId;
} }
public void setId(Long id) { public void setMenuId(Long menuId) {
this.id = id; this.menuId = menuId;
} }
public String getCode() { public String getCode() {
...@@ -134,12 +170,12 @@ public class Menu extends Model<Menu> { ...@@ -134,12 +170,12 @@ public class Menu extends Model<Menu> {
this.url = url; this.url = url;
} }
public Integer getNum() { public Integer getSort() {
return num; return sort;
} }
public void setNum(Integer num) { public void setSort(Integer sort) {
this.num = num; this.sort = sort;
} }
public Integer getLevels() { public Integer getLevels() {
...@@ -150,59 +186,99 @@ public class Menu extends Model<Menu> { ...@@ -150,59 +186,99 @@ public class Menu extends Model<Menu> {
this.levels = levels; this.levels = levels;
} }
public Integer getIsmenu() { public String getMenuFlag() {
return ismenu; return menuFlag;
} }
public void setIsmenu(Integer ismenu) { public void setMenuFlag(String menuFlag) {
this.ismenu = ismenu; this.menuFlag = menuFlag;
} }
public String getTips() { public String getDescription() {
return tips; return description;
} }
public void setTips(String tips) { public void setDescription(String description) {
this.tips = tips; this.description = description;
} }
public Integer getStatus() { public String getStatus() {
return status; return status;
} }
public void setStatus(Integer status) { public void setStatus(String status) {
this.status = status; this.status = status;
} }
public Integer getIsopen() { public String getNewPageFlag() {
return isopen; return newPageFlag;
} }
public void setIsopen(Integer isopen) { public void setNewPageFlag(String newPageFlag) {
this.isopen = isopen; this.newPageFlag = newPageFlag;
} }
@Override public String getOpenFlag() {
protected Serializable pkVal() { return openFlag;
return this.id; }
public void setOpenFlag(String openFlag) {
this.openFlag = openFlag;
}
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 @Override
public String toString() { public String toString() {
return "Menu{" + return "Menu{" +
"id=" + id + ", menuId=" + menuId +
", code=" + code + ", code=" + code +
", pcode=" + pcode + ", pcode=" + pcode +
", pcodes=" + pcodes + ", pcodes=" + pcodes +
", name=" + name + ", name=" + name +
", icon=" + icon + ", icon=" + icon +
", url=" + url + ", url=" + url +
", num=" + num + ", sort=" + sort +
", levels=" + levels + ", levels=" + levels +
", ismenu=" + ismenu + ", menuFlag=" + menuFlag +
", tips=" + tips + ", description=" + description +
", status=" + status + ", status=" + status +
", isopen=" + isopen + ", newPageFlag=" + newPageFlag +
"}"; ", openFlag=" + openFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
} }
} }
package cn.stylefeng.guns.modular.system.model; package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
...@@ -14,46 +15,56 @@ import java.util.Date; ...@@ -14,46 +15,56 @@ import java.util.Date;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
@TableName("sys_notice") @TableName("sys_notice")
public class Notice extends Model<Notice> { public class Notice implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "NOTICE_ID", type = IdType.AUTO)
private Integer id; private Long noticeId;
/** /**
* 标题 * 标题
*/ */
@TableField("TITLE")
private String title; private String title;
/** /**
* 类型
*/
private Integer type;
/**
* 内容 * 内容
*/ */
@TableField("CONTENT")
private String content; private String content;
/** /**
* 创建时间 * 创建时间
*/ */
private Date createtime; @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/** /**
* 创建人 * 创建人
*/ */
private Integer creater; @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;
public Integer getId() { public Long getNoticeId() {
return id; return noticeId;
} }
public void setId(Integer id) { public void setNoticeId(Long noticeId) {
this.id = id; this.noticeId = noticeId;
} }
public String getTitle() { public String getTitle() {
...@@ -64,14 +75,6 @@ public class Notice extends Model<Notice> { ...@@ -64,14 +75,6 @@ public class Notice extends Model<Notice> {
this.title = title; this.title = title;
} }
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getContent() { public String getContent() {
return content; return content;
} }
...@@ -80,36 +83,48 @@ public class Notice extends Model<Notice> { ...@@ -80,36 +83,48 @@ public class Notice extends Model<Notice> {
this.content = content; this.content = content;
} }
public Date getCreatetime() { public Date getCreateTime() {
return createtime; return createTime;
} }
public void setCreatetime(Date createtime) { public void setCreateTime(Date createTime) {
this.createtime = createtime; this.createTime = createTime;
} }
public Integer getCreater() { public Long getCreateUser() {
return creater; return createUser;
} }
public void setCreater(Integer creater) { public void setCreateUser(Long createUser) {
this.creater = creater; this.createUser = createUser;
} }
@Override public Date getUpdateTime() {
protected Serializable pkVal() { return updateTime;
return this.id; }
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
} }
@Override @Override
public String toString() { public String toString() {
return "Notice{" + return "Notice{" +
"id=" + id + ", noticeId=" + noticeId +
", title=" + title + ", title=" + title +
", type=" + type + ", content=" + content +
", content=" + content + ", createTime=" + createTime +
", createtime=" + createtime + ", createUser=" + createUser +
", creater=" + creater + ", updateTime=" + updateTime +
"}"; ", updateUser=" + updateUser +
"}";
} }
} }
package cn.stylefeng.guns.modular.system.model; package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
...@@ -14,90 +15,98 @@ import java.util.Date; ...@@ -14,90 +15,98 @@ import java.util.Date;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
@TableName("sys_operation_log") @TableName("sys_operation_log")
public class OperationLog extends Model<OperationLog> { public class OperationLog implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "OPERATION_LOG_ID", type = IdType.AUTO)
private Integer id; private Long operationLogId;
/** /**
* 日志类型 * 日志类型(字典)
*/ */
private String logtype; @TableField("LOG_TYPE")
private String logType;
/** /**
* 日志名称 * 日志名称
*/ */
private String logname; @TableField("LOG_NAME")
private String logName;
/** /**
* 用户id * 用户id
*/ */
private Integer userid; @TableField("USER_ID")
private Long userId;
/** /**
* 类名称 * 类名称
*/ */
private String classname; @TableField("CLASS_NAME")
private String className;
/** /**
* 方法名称 * 方法名称
*/ */
@TableField("METHOD")
private String method; private String method;
/** /**
* 创建时间 * 创建时间
*/ */
private Date createtime; @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/** /**
* 是否成功 * 是否成功(字典)
*/ */
@TableField("SUCCEED")
private String succeed; private String succeed;
/** /**
* 备注 * 备注
*/ */
@TableField("MESSAGE")
private String message; private String message;
public Integer getId() { public Long getOperationLogId() {
return id; return operationLogId;
} }
public void setId(Integer id) { public void setOperationLogId(Long operationLogId) {
this.id = id; this.operationLogId = operationLogId;
} }
public String getLogtype() { public String getLogType() {
return logtype; return logType;
} }
public void setLogtype(String logtype) { public void setLogType(String logType) {
this.logtype = logtype; this.logType = logType;
} }
public String getLogname() { public String getLogName() {
return logname; return logName;
} }
public void setLogname(String logname) { public void setLogName(String logName) {
this.logname = logname; this.logName = logName;
} }
public Integer getUserid() { public Long getUserId() {
return userid; return userId;
} }
public void setUserid(Integer userid) { public void setUserId(Long userId) {
this.userid = userid; this.userId = userId;
} }
public String getClassname() { public String getClassName() {
return classname; return className;
} }
public void setClassname(String classname) { public void setClassName(String className) {
this.classname = classname; this.className = className;
} }
public String getMethod() { public String getMethod() {
...@@ -108,12 +117,12 @@ public class OperationLog extends Model<OperationLog> { ...@@ -108,12 +117,12 @@ public class OperationLog extends Model<OperationLog> {
this.method = method; this.method = method;
} }
public Date getCreatetime() { public Date getCreateTime() {
return createtime; return createTime;
} }
public void setCreatetime(Date createtime) { public void setCreateTime(Date createTime) {
this.createtime = createtime; this.createTime = createTime;
} }
public String getSucceed() { public String getSucceed() {
...@@ -133,22 +142,17 @@ public class OperationLog extends Model<OperationLog> { ...@@ -133,22 +142,17 @@ public class OperationLog extends Model<OperationLog> {
} }
@Override @Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() { public String toString() {
return "OperationLog{" + return "OperationLog{" +
"id=" + id + ", operationLogId=" + operationLogId +
", logtype=" + logtype + ", logType=" + logType +
", logname=" + logname + ", logName=" + logName +
", userid=" + userid + ", userId=" + userId +
", classname=" + classname + ", className=" + className +
", method=" + method + ", method=" + method +
", createtime=" + createtime + ", createTime=" + createTime +
", succeed=" + succeed + ", succeed=" + succeed +
", message=" + message + ", message=" + message +
"}"; "}";
} }
} }
package cn.stylefeng.guns.modular.system.model; package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
...@@ -13,63 +12,60 @@ import java.io.Serializable; ...@@ -13,63 +12,60 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
@TableName("sys_relation") @TableName("sys_relation")
public class Relation extends Model<Relation> { public class Relation implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId("RELATION_ID")
private Integer id; private Long relationId;
/** /**
* 菜单id * 菜单id
*/ */
private Long menuid; @TableField("MENU_ID")
private Long menuId;
/** /**
* 角色id * 角色id
*/ */
private Integer roleid; @TableField("ROLE_ID")
private Long roleId;
public Integer getId() { public Long getRelationId() {
return id; return relationId;
} }
public void setId(Integer id) { public void setRelationId(Long relationId) {
this.id = id; this.relationId = relationId;
} }
public Long getMenuid() { public Long getMenuId() {
return menuid; return menuId;
} }
public void setMenuid(Long menuid) { public void setMenuId(Long menuId) {
this.menuid = menuid; this.menuId = menuId;
} }
public Integer getRoleid() { public Long getRoleId() {
return roleid; return roleId;
} }
public void setRoleid(Integer roleid) { public void setRoleId(Long roleId) {
this.roleid = roleid; this.roleId = roleId;
}
@Override
protected Serializable pkVal() {
return this.id;
} }
@Override @Override
public String toString() { public String toString() {
return "Relation{" + return "Relation{" +
"id=" + id + ", relationId=" + relationId +
", menuid=" + menuid + ", menuId=" + menuId +
", roleid=" + roleid + ", roleId=" + roleId +
"}"; "}";
} }
} }
package cn.stylefeng.guns.modular.system.model; package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* <p> * <p>
...@@ -13,65 +15,78 @@ import java.io.Serializable; ...@@ -13,65 +15,78 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
@TableName("sys_role") @TableName("sys_role")
public class Role extends Model<Role> { public class Role implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键id * 主键id
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "ROLE_ID", type = IdType.AUTO)
private Integer id; private Long roleId;
/**
* 序号
*/
private Integer num;
/** /**
* 父角色id * 父角色id
*/ */
private Integer pid; @TableField("PID")
private Long pid;
/** /**
* 角色名称 * 角色名称
*/ */
@TableField("NAME")
private String name; private String name;
/** /**
* 部门名称 * 提示
*/ */
private Integer deptid; @TableField("DESCRIPTION")
private String description;
/** /**
* 提示 * 序号
*/ */
private String tips; @TableField("SORT")
private Integer sort;
/** /**
* 保留字段(暂时没用) * 乐观锁
*/ */
@TableField("VERSION")
private Integer 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;
/**
* 修改用户
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Integer getId() { public Long getRoleId() {
return id; return roleId;
}
public void setId(Integer id) {
this.id = id;
} }
public Integer getNum() { public void setRoleId(Long roleId) {
return num; this.roleId = roleId;
} }
public void setNum(Integer num) { public Long getPid() {
this.num = num;
}
public Integer getPid() {
return pid; return pid;
} }
public void setPid(Integer pid) { public void setPid(Long pid) {
this.pid = pid; this.pid = pid;
} }
...@@ -83,20 +98,20 @@ public class Role extends Model<Role> { ...@@ -83,20 +98,20 @@ public class Role extends Model<Role> {
this.name = name; this.name = name;
} }
public Integer getDeptid() { public String getDescription() {
return deptid; return description;
} }
public void setDeptid(Integer deptid) { public void setDescription(String description) {
this.deptid = deptid; this.description = description;
} }
public String getTips() { public Integer getSort() {
return tips; return sort;
} }
public void setTips(String tips) { public void setSort(Integer sort) {
this.tips = tips; this.sort = sort;
} }
public Integer getVersion() { public Integer getVersion() {
...@@ -107,21 +122,51 @@ public class Role extends Model<Role> { ...@@ -107,21 +122,51 @@ public class Role extends Model<Role> {
this.version = version; this.version = version;
} }
@Override public Date getCreateTime() {
protected Serializable pkVal() { return createTime;
return this.id; }
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 @Override
public String toString() { public String toString() {
return "Role{" + return "Role{" +
"id=" + id + ", roleId=" + roleId +
", num=" + num + ", pid=" + pid +
", pid=" + pid + ", name=" + name +
", name=" + name + ", description=" + description +
", deptid=" + deptid + ", sort=" + sort +
", tips=" + tips + ", version=" + version +
", version=" + version + ", createTime=" + createTime +
"}"; ", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
} }
} }
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 管理员表
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("sys_user")
@Data
public class User implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "USER_ID", type = IdType.AUTO)
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;
}
...@@ -18,7 +18,7 @@ package cn.stylefeng.guns.modular.system.factory; ...@@ -18,7 +18,7 @@ package cn.stylefeng.guns.modular.system.factory;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.stylefeng.guns.core.common.constant.state.ManagerStatus; import cn.stylefeng.guns.core.common.constant.state.ManagerStatus;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.transfer.UserDto; import cn.stylefeng.guns.modular.system.transfer.UserDto;
import cn.stylefeng.roses.core.util.ToolUtil; import cn.stylefeng.roses.core.util.ToolUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -44,7 +44,7 @@ public class UserFactory { ...@@ -44,7 +44,7 @@ public class UserFactory {
} else { } else {
User user = new User(); User user = new User();
BeanUtils.copyProperties(userDto, user); BeanUtils.copyProperties(userDto, user);
user.setCreatetime(new Date()); user.setCreateTime(new Date());
user.setStatus(ManagerStatus.OK.getCode()); user.setStatus(ManagerStatus.OK.getCode());
user.setPassword(md5Password); user.setPassword(md5Password);
user.setSalt(salt); user.setSalt(salt);
...@@ -69,7 +69,7 @@ public class UserFactory { ...@@ -69,7 +69,7 @@ public class UserFactory {
oldUser.setBirthday(newUser.getBirthday()); oldUser.setBirthday(newUser.getBirthday());
} }
if (ToolUtil.isNotEmpty(newUser.getDeptid())) { if (ToolUtil.isNotEmpty(newUser.getDeptid())) {
oldUser.setDeptid(newUser.getDeptid()); oldUser.setDeptId(newUser.getDeptid());
} }
if (ToolUtil.isNotEmpty(newUser.getSex())) { if (ToolUtil.isNotEmpty(newUser.getSex())) {
oldUser.setSex(newUser.getSex()); oldUser.setSex(newUser.getSex());
......
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.entity.CodeDbinfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 数据库链接信息 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
public interface CodeDbinfoMapper extends BaseMapper<CodeDbinfo> {
}
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.core.common.node.ZTreeNode; import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Dept; import cn.stylefeng.guns.modular.system.entity.Dept;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -29,7 +14,7 @@ import java.util.Map; ...@@ -29,7 +14,7 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface DeptMapper extends BaseMapper<Dept> { public interface DeptMapper extends BaseMapper<Dept> {
...@@ -43,4 +28,4 @@ public interface DeptMapper extends BaseMapper<Dept> { ...@@ -43,4 +28,4 @@ public interface DeptMapper extends BaseMapper<Dept> {
*/ */
List<Map<String, Object>> list(@Param("condition") String condition); List<Map<String, Object>> list(@Param("condition") String condition);
} }
\ No newline at end of file
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.Dict; import cn.stylefeng.guns.modular.system.entity.Dict;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -28,7 +13,7 @@ import java.util.Map; ...@@ -28,7 +13,7 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface DictMapper extends BaseMapper<Dict> { public interface DictMapper extends BaseMapper<Dict> {
...@@ -46,4 +31,5 @@ public interface DictMapper extends BaseMapper<Dict> { ...@@ -46,4 +31,5 @@ public interface DictMapper extends BaseMapper<Dict> {
* 根据父类编码获取词典列表 * 根据父类编码获取词典列表
*/ */
List<Dict> selectByParentCode(@Param("code") String code); List<Dict> selectByParentCode(@Param("code") String code);
}
\ No newline at end of file }
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.entity.FileInfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 文件信息表
Mapper 接口
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
public interface FileInfoMapper extends BaseMapper<FileInfo> {
}
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.LoginLog; import cn.stylefeng.guns.modular.system.entity.LoginLog;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -29,7 +14,7 @@ import java.util.Map; ...@@ -29,7 +14,7 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface LoginLogMapper extends BaseMapper<LoginLog> { public interface LoginLogMapper extends BaseMapper<LoginLog> {
...@@ -38,5 +23,4 @@ public interface LoginLogMapper extends BaseMapper<LoginLog> { ...@@ -38,5 +23,4 @@ public interface LoginLogMapper extends BaseMapper<LoginLog> {
*/ */
List<Map<String, Object>> getLoginLogs(@Param("page") Page<LoginLog> page, @Param("beginTime") String beginTime, List<Map<String, Object>> getLoginLogs(@Param("page") Page<LoginLog> page, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("logName") String logName, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc); @Param("endTime") String endTime, @Param("logName") String logName, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc);
}
}
\ No newline at end of file
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.core.common.node.MenuNode; import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode; import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Menu; import cn.stylefeng.guns.modular.system.entity.Menu;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -30,7 +15,7 @@ import java.util.Map; ...@@ -30,7 +15,7 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface MenuMapper extends BaseMapper<Menu> { public interface MenuMapper extends BaseMapper<Menu> {
...@@ -48,7 +33,7 @@ public interface MenuMapper extends BaseMapper<Menu> { ...@@ -48,7 +33,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @return * @return
* @date 2017年2月12日 下午9:14:34 * @date 2017年2月12日 下午9:14:34
*/ */
List<Long> getMenuIdsByRoleId(@Param("roleId") Integer roleId); List<Long> getMenuIdsByRoleId(@Param("roleId") Long roleId);
/** /**
* 获取菜单列表树 * 获取菜单列表树
...@@ -82,7 +67,7 @@ public interface MenuMapper extends BaseMapper<Menu> { ...@@ -82,7 +67,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @return * @return
* @date 2017年2月19日 下午7:12:38 * @date 2017年2月19日 下午7:12:38
*/ */
List<String> getResUrlsByRoleId(Integer roleId); List<String> getResUrlsByRoleId(Long roleId);
/** /**
* 根据角色获取菜单 * 根据角色获取菜单
...@@ -91,5 +76,6 @@ public interface MenuMapper extends BaseMapper<Menu> { ...@@ -91,5 +76,6 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @return * @return
* @date 2017年2月19日 下午10:35:40 * @date 2017年2月19日 下午10:35:40
*/ */
List<MenuNode> getMenusByRoleIds(List<Integer> roleIds); List<MenuNode> getMenusByRoleIds(List<Long> roleIds);
}
\ No newline at end of file }
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.Notice; import cn.stylefeng.guns.modular.system.entity.Notice;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -28,7 +13,7 @@ import java.util.Map; ...@@ -28,7 +13,7 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface NoticeMapper extends BaseMapper<Notice> { public interface NoticeMapper extends BaseMapper<Notice> {
...@@ -37,4 +22,4 @@ public interface NoticeMapper extends BaseMapper<Notice> { ...@@ -37,4 +22,4 @@ public interface NoticeMapper extends BaseMapper<Notice> {
*/ */
List<Map<String, Object>> list(@Param("condition") String condition); List<Map<String, Object>> list(@Param("condition") String condition);
} }
\ No newline at end of file
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.OperationLog; import cn.stylefeng.guns.modular.system.entity.OperationLog;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -29,7 +14,7 @@ import java.util.Map; ...@@ -29,7 +14,7 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface OperationLogMapper extends BaseMapper<OperationLog> { public interface OperationLogMapper extends BaseMapper<OperationLog> {
...@@ -38,4 +23,5 @@ public interface OperationLogMapper extends BaseMapper<OperationLog> { ...@@ -38,4 +23,5 @@ public interface OperationLogMapper extends BaseMapper<OperationLog> {
*/ */
List<Map<String, Object>> getOperationLogs(@Param("page") Page<OperationLog> page, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("logName") String logName, @Param("logType") String logType, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc); List<Map<String, Object>> getOperationLogs(@Param("page") Page<OperationLog> page, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("logName") String logName, @Param("logType") String logType, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc);
}
\ No newline at end of file }
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.entity.Relation;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 角色和菜单关联表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
public interface RelationMapper extends BaseMapper<Relation> {
}
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.core.common.node.ZTreeNode; import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Role; import cn.stylefeng.guns.modular.system.entity.Role;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -29,7 +14,7 @@ import java.util.Map; ...@@ -29,7 +14,7 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface RoleMapper extends BaseMapper<Role> { public interface RoleMapper extends BaseMapper<Role> {
...@@ -48,7 +33,7 @@ public interface RoleMapper extends BaseMapper<Role> { ...@@ -48,7 +33,7 @@ public interface RoleMapper extends BaseMapper<Role> {
* @return * @return
* @date 2017年2月13日 下午7:57:51 * @date 2017年2月13日 下午7:57:51
*/ */
int deleteRolesById(@Param("roleId") Integer roleId); int deleteRolesById(@Param("roleId") Long roleId);
/** /**
* 获取角色列表树 * 获取角色列表树
...@@ -65,4 +50,5 @@ public interface RoleMapper extends BaseMapper<Role> { ...@@ -65,4 +50,5 @@ public interface RoleMapper extends BaseMapper<Role> {
* @date 2017年2月18日 上午10:32:04 * @date 2017年2月18日 上午10:32:04
*/ */
List<ZTreeNode> roleTreeListByRoleId(String[] roleId); List<ZTreeNode> roleTreeListByRoleId(String[] roleId);
}
\ No newline at end of file }
/** package cn.stylefeng.guns.modular.system.mapper;
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.User; import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.roses.core.datascope.DataScope; import cn.stylefeng.roses.core.datascope.DataScope;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -29,32 +14,33 @@ import java.util.Map; ...@@ -29,32 +14,33 @@ import java.util.Map;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-07-11 * @since 2018-12-07
*/ */
public interface UserMapper extends BaseMapper<User> { public interface UserMapper extends BaseMapper<User> {
/** /**
* 修改用户状态 * 修改用户状态
*/ */
int setStatus(@Param("userId") Integer userId, @Param("status") int status); int setStatus(@Param("userId") Long userId, @Param("status") String status);
/** /**
* 修改密码 * 修改密码
*/ */
int changePwd(@Param("userId") Integer userId, @Param("pwd") String pwd); int changePwd(@Param("userId") Long userId, @Param("pwd") String pwd);
/** /**
* 根据条件查询用户列表 * 根据条件查询用户列表
*/ */
List<Map<String, Object>> selectUsers(@Param("dataScope") DataScope dataScope, @Param("name") String name, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("deptid") Integer deptid); List<Map<String, Object>> selectUsers(@Param("dataScope") DataScope dataScope, @Param("name") String name, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("deptid") Long deptId);
/** /**
* 设置用户的角色 * 设置用户的角色
*/ */
int setRoles(@Param("userId") Integer userId, @Param("roleIds") String roleIds); int setRoles(@Param("userId") Long userId, @Param("roleIds") String roleIds);
/** /**
* 通过账号获取用户 * 通过账号获取用户
*/ */
User getByAccount(@Param("account") String account); User getByAccount(@Param("account") String account);
}
\ No newline at end of file }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.CodeDbinfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.CodeDbinfo">
<id column="DB_ID" property="dbId" />
<result column="NAME" property="name" />
<result column="DB_DRIVER" property="dbDriver" />
<result column="DB_URL" property="dbUrl" />
<result column="DB_USER_NAME" property="dbUserName" />
<result column="DB_PASSWORD" property="dbPassword" />
<result column="DB_TYPE" property="dbType" />
<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">
DB_ID AS dbId, NAME AS name, DB_DRIVER AS dbDriver, DB_URL AS dbUrl, DB_USER_NAME AS dbUserName, DB_PASSWORD AS dbPassword, DB_TYPE AS dbType, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.DeptMapper">
<!-- 通用查询映射结果 -->
<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"/>
</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
</sql>
<select id="tree" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select DEPT_ID AS id, PID as pId, SIMPLE_NAME as name,
(
CASE
WHEN (PID = 0 OR PID IS NULL) THEN
'true'
ELSE
'false'
END
) as isOpen from sys_dept
</select>
<select id="list" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_dept
<if test="condition != null and condition != ''">
where SIMPLE_NAME like CONCAT('%',#{condition},'%') or FULL_NAME like CONCAT('%',#{condition},'%')
</if>
order by SORT ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.DictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Dict">
<id column="DICT_ID" property="dictId"/>
<result column="PID" property="pid"/>
<result column="NAME" property="name"/>
<result column="CODE" property="code"/>
<result column="DESCRIPTION" property="description"/>
<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">
DICT_ID AS dictId, PID AS pid, NAME AS name, CODE AS code, DESCRIPTION AS description, SORT AS sort, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
<select id="selectByCode" resultType="cn.stylefeng.guns.modular.system.entity.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where CODE = #{code}
</select>
<select id="selectByParentCode" resultType="cn.stylefeng.guns.modular.system.entity.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where PID in(select DICT_ID from sys_dict where CODE = #{code}) order by SORT asc
</select>
<select id="list" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_dict
where PID = 0
<if test="condition != null and condition != ''">
AND NAME like CONCAT('%',#{condition},'%')
</if>
order by DICT_ID ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.FileInfoMapper">
<!-- 通用查询映射结果 -->
<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" />
</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
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.LoginLogMapper"> <mapper namespace="cn.stylefeng.guns.modular.system.mapper.LoginLogMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.LoginLog"> <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.LoginLog">
<id column="id" property="id" /> <id column="LOGIN_LOG_ID" property="loginLogId"/>
<result column="logname" property="logname" /> <result column="LOG_NAME" property="logName"/>
<result column="userid" property="userid" /> <result column="USER_ID" property="userId"/>
<result column="createtime" 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" property="ip" /> <result column="IP_ADDRESS" property="ipAddress"/>
</resultMap> </resultMap>
<select id="getLoginLogs" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> <!-- 通用查询结果列 -->
select * from sys_login_log where 1 = 1 <sql id="Base_Column_List">
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> 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
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) </sql>
</if>
<if test="logName != null and logName !=''"> <select id="getLoginLogs" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
and logname like CONCAT('%',#{logName},'%') select
</if> <include refid="Base_Column_List"/>
<choose> from sys_login_log where 1 = 1
<when test="orderByField != null and orderByField !=''"> <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
<choose> and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
<when test="isAsc == true"> </if>
order by ${orderByField} ASC <if test="logName != null and logName !=''">
</when> and LOG_NAME like CONCAT('%',#{logName},'%')
<otherwise> </if>
order by ${orderByField} DESC <choose>
</otherwise> <when test="orderByField != null and orderByField !=''">
</choose> <choose>
</when> <when test="isAsc == true">
<otherwise> order by ${orderByField} ASC
order by createtime DESC </when>
</otherwise> <otherwise>
</choose> order by ${orderByField} DESC
</select> </otherwise>
</choose>
</when>
<otherwise>
order by CREATE_TIME DESC
</otherwise>
</choose>
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.MenuMapper"> <mapper namespace="cn.stylefeng.guns.modular.system.mapper.MenuMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Menu"> <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Menu">
<id column="id" property="id" /> <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="num" property="num" /> <result column="SORT" property="sort"/>
<result column="levels" property="levels" /> <result column="LEVELS" property="levels"/>
<result column="ismenu" property="ismenu" /> <result column="MENU_FLAG" property="menuFlag"/>
<result column="tips" property="tips" /> <result column="DESCRIPTION" property="description"/>
<result column="status" property="status" /> <result column="STATUS" property="status"/>
<result column="isopen" property="isopen" /> <result column="NEW_PAGE_FLAG" property="newPageFlag"/>
</resultMap> <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"> <sql id="Base_Column_List">
id, code, pcode, name, icon, url, num, levels,pcodes, 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
tips, status,isopen,ismenu
</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 = 1 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>
<select id="getMenuIdsByRoleId" resultType="long"> <select id="getMenuIdsByRoleId" resultType="long">
select menuid from select MENU_ID from
sys_relation where roleid = #{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.id AS id, m1.MENU_ID AS id,
( (
CASE CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
0 0
ELSE ELSE
m2.id m2.MENU_ID
END END
) AS pId, ) AS pId,
m1. NAME m1.NAME
AS NAME, AS NAME,
( (
CASE CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
'true' 'true'
ELSE ELSE
'false' 'false'
...@@ -65,26 +70,26 @@ ...@@ -65,26 +70,26 @@
) as isOpen ) as isOpen
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.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.id AS id, m1.MENU_ID AS id,
( (
CASE CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
0 0
ELSE ELSE
m2.id m2.MENU_ID
END END
) AS pId, ) AS pId,
m1. NAME AS NAME, m1.NAME AS name,
( (
CASE CASE
WHEN (m2.id = 0 OR m2.id IS WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS
NULL) THEN NULL) THEN
'true' 'true'
ELSE ELSE
...@@ -93,85 +98,85 @@ ...@@ -93,85 +98,85 @@
) as isOpen, ) as isOpen,
( (
CASE CASE
WHEN (m3.ID = 0 OR m3.ID WHEN (m3.MENU_ID = 0 OR m3.MENU_ID
IS NULL) THEN IS NULL) THEN
'false' 'false'
ELSE ELSE
'true' 'true'
END END
) "checked" ) as `checked`
FROM FROM
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
ID MENU_ID
FROM FROM
sys_menu sys_menu
WHERE WHERE
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.id = m3.id ) m3 on m1.MENU_ID = m3.MENU_ID
ORDER BY ORDER BY
m1.id ASC m1.MENU_ID ASC
</select> </select>
<delete id="deleteRelationByMenu"> <delete id="deleteRelationByMenu">
delete from sys_relation where menuid = #{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.menuid = m.id inner join sys_menu m on rel.MENU_ID = m.MENU_ID
where rel.roleid = #{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.id AS id, m1.MENU_ID AS id,
m1.icon AS icon, m1.ICON AS icon,
( (
CASE CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
0 0
ELSE ELSE
m2.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.ismenu as ismenu, m1.MENU_FLAG as ismenu,
m1.num 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
ID MENU_ID
FROM FROM
sys_menu sys_menu
WHERE WHERE
ID IN ( MENU_ID IN (
SELECT SELECT
menuid MENU_ID
FROM FROM
sys_relation rela sys_relation rela
WHERE WHERE
rela.roleid 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.id = m3.id ) m3 ON m1.MENU_ID = m3.MENU_ID
where m1.ismenu = 1 where m1.MENU_FLAG = 'Y'
order by levels,num asc order by LEVELS,m1.SORT asc
</select> </select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.NoticeMapper">
<!-- 通用查询映射结果 -->
<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" />
</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
</sql>
<select id="list" resultType="map">
select
<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},'%')
</if>
order by CREATE_TIME DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.OperationLogMapper"> <mapper namespace="cn.stylefeng.guns.modular.system.mapper.OperationLogMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.OperationLog"> <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.OperationLog">
<id column="id" property="id" /> <id column="OPERATION_LOG_ID" property="operationLogId"/>
<result column="logtype" property="logtype" /> <result column="LOG_TYPE" property="logType"/>
<result column="logname" property="logname" /> <result column="LOG_NAME" property="logName"/>
<result column="userid" property="userid" /> <result column="USER_ID" property="userId"/>
<result column="classname" property="classname" /> <result column="CLASS_NAME" property="className"/>
<result column="method" property="method" /> <result column="METHOD" property="method"/>
<result column="createtime" 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>
<select id="getOperationLogs" resultType="map"> <!-- 通用查询结果列 -->
select * from sys_operation_log where 1 = 1 <sql id="Base_Column_List">
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> 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
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) </sql>
</if>
<if test="logName != null and logName !=''"> <select id="getOperationLogs" resultType="map">
and logname like CONCAT('%',#{logName},'%') select
</if> <include refid="Base_Column_List"/>
<if test="logType != null and logType !=''"> from sys_operation_log where 1 = 1
and logtype like CONCAT('%',#{logType},'%') <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
</if> and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
<choose> </if>
<when test="orderByField != null and orderByField !=''"> <if test="logName != null and logName !=''">
<choose> and LOG_NAME like CONCAT('%',#{logName},'%')
<when test="isAsc == true"> </if>
order by ${orderByField} ASC <if test="logType != null and logType !=''">
</when> and LOG_TYPE like CONCAT('%',#{logType},'%')
<otherwise> </if>
order by ${orderByField} DESC <choose>
</otherwise> <when test="orderByField != null and orderByField !=''">
</choose> <choose>
</when> <when test="isAsc == true">
<otherwise> order by ${orderByField} ASC
order by createtime DESC </when>
</otherwise> <otherwise>
</choose> order by ${orderByField} DESC
</select> </otherwise>
</choose>
</when>
<otherwise>
order by CREATE_TIME DESC
</otherwise>
</choose>
</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