Commit 731c3f16 authored by fangzhipeng's avatar fangzhipeng

Initial commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.bigsys:bigsys-dubbo:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:dubbo:2.5.3" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.15.0-GA" level="project" />
<orderEntry type="library" name="Maven: org.jboss.netty:netty:3.2.5.Final" level="project" />
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.6" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.1" level="project" />
<orderEntry type="library" name="Maven: jline:jline:0.9.94" level="project" />
<orderEntry type="library" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty:3.7.0.Final" level="project" />
<orderEntry type="library" name="Maven: com.bigsys:bigsys-spring:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-instrument:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-instrument-tomcat:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.6.9" level="project" />
<orderEntry type="library" name="Maven: commons-pool:commons-pool:1.5.3" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jms:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc-portlet:4.3.10.RELEASE" level="project" />
</component>
</module>
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>bigsys-auth</artifactId>
<groupId>com.bigsys</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bigsys-auth-api</artifactId>
<packaging>jar</packaging>
<name>${artifactId}</name>
</project>
\ No newline at end of file
package com.bigsys.auth.api;
import com.bigsys.auth.api.model.AppInfo;
public interface AppAuth {
/**
* 根据应用名称获取授权信息
* @param name
* @return
*/
AppInfo auth(String name);
}
package com.bigsys.auth.api.model;
public class AppInfo {
private Integer id;
private String name;
private String authTime;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthTime() {
return authTime;
}
public void setAuthTime(String authTime) {
this.authTime = authTime;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bigsys</groupId>
<artifactId>bigsys-auth-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>${artifactId}</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- plugin setting -->
<mybatis.generator.generatorConfig.xml>${basedir}/src/test/resources/generatorConfig.xml</mybatis.generator.generatorConfig.xml>
<mybatis.generator.generatorConfig.properties>file:///${basedir}/src/test/resources/generatorConfig.properties</mybatis.generator.generatorConfig.properties>
</properties>
<dependencies>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>com.bigsys</groupId>
<artifactId>bigsys-auth-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.42</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-all</artifactId>
<version>1.2.6</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- Mybatis generator代码生成插件 配置 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<configuration>
<configurationFile>${mybatis.generator.generatorConfig.xml}</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.bigsys.auth.project;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication
@ComponentScan(basePackages = "com.bigsys.auth.project")
@MapperScan(basePackages = "com.bigsys.auth.project.db.**")
public class BigsysAuthSpringbootApplication {
public static void main(String[] args) {
SpringApplication.run(BigsysAuthSpringbootApplication.class, args);
}
}
package com.bigsys.auth.project;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello() {
return "hello";
}
}
package com.bigsys.auth.project.config;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.service.UserService;
import org.apache.shiro.authc.*;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.util.SimpleByteSource;
import org.apache.tomcat.util.security.MD5Encoder;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.nio.charset.Charset;
@Component("myRealm")
public class MyRealm extends AuthorizingRealm{
@Resource
private UserService userService;
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
return null;
}
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
User user = userService.getUser((String) authenticationToken.getPrincipal());
if (!user.getPassward().equals((new String((char[]) authenticationToken.getCredentials())))) {
throw new IncorrectCredentialsException("密码错误!!");
}
AuthenticationInfo info = new SimpleAuthenticationInfo(user, user.getPassward(), this.getClass().getName());
return info;
}
}
package com.bigsys.auth.project.config;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.util.response.BSResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.realm.Realm;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.shiro.web.servlet.Cookie;
import org.apache.shiro.web.servlet.SimpleCookie;
import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
import javax.servlet.Filter;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Created by fangzhipeng on 2017/9/4.
*/
@Configuration
public class ShiroConfig {
@Resource
private Realm myRealm;
/**
* ShiroFilterFactoryBean 处理拦截资源文件问题。
* 注意:单独一个ShiroFilterFactoryBean配置是或报错的,以为在
* 初始化ShiroFilterFactoryBean的时候需要注入:SecurityManager
*
* Filter Chain定义说明 1、一个URL可以配置多个Filter,使用逗号分隔 2、当设置多个过滤器时,全部验证通过,才视为通过
* 3、部分过滤器可指定参数,如perms,roles
*
*/
@Bean
public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
shiroFilterFactoryBean.setFilters(getMyFilters());
// 必须设置 SecurityManager
shiroFilterFactoryBean.setSecurityManager(securityManager);
// 如果不设置默认会自动寻找Web工程根目录下的"/login.jsp"页面
shiroFilterFactoryBean.setLoginUrl("/login.html");
// 登录成功后要跳转的链接
shiroFilterFactoryBean.setSuccessUrl("/loginRes");
// 未授权界面;
shiroFilterFactoryBean.setUnauthorizedUrl("/403");
// 拦截器.
Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>();
filterChainDefinitionMap.put("/hello", "anon");
filterChainDefinitionMap.put("/**", "authc");
// // 配置不会被拦截的链接 顺序判断
// filterChainDefinitionMap.put("/static/**", "anon");
// filterChainDefinitionMap.put("/ajaxLogin", "anon");
//
// // 配置退出过滤器,其中的具体的退出代码Shiro已经替我们实现了
// filterChainDefinitionMap.put("/logout", "logout");
//
// filterChainDefinitionMap.put("/add", "perms[权限添加]");
//
// // <!-- 过滤链定义,从上向下顺序执行,一般将 /**放在最为下边 -->:这是一个坑呢,一不小心代码就不好使了;
// // <!-- authc:所有url都必须认证通过才可以访问; anon:所有url都都可以匿名访问-->
// filterChainDefinitionMap.put("/**", "authc");
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
System.out.println("Shiro拦截器工厂类注入成功");
return shiroFilterFactoryBean;
}
private Map<String, Filter> getMyFilters() {
Map<String, Filter> filters = new HashMap<>();
filters.put("authc", new FormAuthenticationFilter() {
@Override
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
if (isLoginRequest(request, response)) {
if (isLoginSubmission(request, response)) {
return executeLogin(request, response);
} else {
//allow them to see the login page ;)
return true;
}
} else {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
BSResponse bsResponse = BSResponse.needLogin("您已经退出,请重新登录。");
OutputStream outputStream = null;
outputStream = response.getOutputStream();
outputStream.write(new ObjectMapper().writeValueAsString(bsResponse).getBytes("utf-8"));
return false;
}
}
@Override
protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) {
try {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
BSResponse bsResponse = BSResponse.error(e.getMessage());
OutputStream outputStream = null;
outputStream = response.getOutputStream();
outputStream.write(new ObjectMapper().writeValueAsString(bsResponse).getBytes("utf-8"));
return false;
} catch (IOException e1) {
e1.printStackTrace();
}
return false;
}
@Override
protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, ServletRequest request, ServletResponse response) throws Exception {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
User user = (User) SecurityUtils.getSubject().getPrincipal();
BSResponse bsResponse = BSResponse.ok(user);
response.setContentLength(new ObjectMapper().writeValueAsString(bsResponse).getBytes("utf-8").length);
OutputStream outputStream = response.getOutputStream();
outputStream.write(new ObjectMapper().writeValueAsString(bsResponse).getBytes("utf-8"));
return false;
}
});
return filters;
}
@Bean
public SecurityManager securityManager(SessionManager sessionManager) {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
securityManager.setSessionManager(sessionManager);
// 设置realm.
securityManager.setRealm(myRealm);
return securityManager;
}
@Bean
public SessionManager sessionManager() {
Cookie sessionIdCookie = new SimpleCookie();
sessionIdCookie.setName("MySessionId");
sessionIdCookie.setHttpOnly(false);
sessionIdCookie.setPath("/");
DefaultWebSessionManager manager = new DefaultWebSessionManager();
manager.setSessionIdCookie(sessionIdCookie);
return manager;
}
// /**
// * 身份认证realm; (这个需要自己写,账号密码校验;权限等)
// *
// * @return
// */
// @Bean
// public MyShiroRealm myShiroRealm() {
// MyShiroRealm myShiroRealm = new MyShiroRealm();
// return myShiroRealm;
// }
}
package com.bigsys.auth.project.config;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import org.springframework.web.HttpRequestHandler;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import org.springframework.web.servlet.resource.ResourceHttpRequestHandler;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
@Component
public class SpringInit implements ApplicationContextAware{
@Resource
private ApplicationContext applicationContext;
@PostConstruct
public void addSupportType() {
SimpleUrlHandlerMapping handlerMapping = applicationContext.getBean("resourceHandlerMapping", SimpleUrlHandlerMapping.class);
Map<String, ResourceHttpRequestHandler> urlMap = (Map<String, ResourceHttpRequestHandler>) handlerMapping.getUrlMap();
for (Map.Entry<String, ResourceHttpRequestHandler> entry : urlMap.entrySet()) {
entry.getValue().setSupportedMethods("GET", "POST");
}
}
@PostConstruct
public void test() {
Map<String, FormAuthenticationFilter> beans = applicationContext.getBeansOfType(FormAuthenticationFilter.class);
for (Map.Entry<String, FormAuthenticationFilter> stringFormAuthenticationFilterEntry : beans.entrySet()) {
System.out.println(stringFormAuthenticationFilterEntry.getKey() + stringFormAuthenticationFilterEntry.getValue().getClass().getName());
}
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
}
package com.bigsys.auth.project.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class LoginController {
@RequestMapping(value = "/loginRes")
public boolean loginRes () {
return true;
}
}
package com.bigsys.auth.project.controller;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.service.RoleMenuService;
import com.bigsys.auth.project.service.RoleService;
import com.bigsys.auth.project.service.UserRoleService;
import com.bigsys.auth.project.service.WrapperRole;
import com.bigsys.auth.project.util.response.BSResponse;
import com.google.common.collect.Lists;
import org.apache.shiro.SecurityUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping(value = "/menu")
public class MenuController {
@Resource
private RoleMenuService roleMenuService;
@Resource
private UserRoleService userRoleService;
@RequestMapping(value = "/getMenus")
public BSResponse getMenus() {
User curUser = (User) SecurityUtils.getSubject().getPrincipal();
userRoleService.wrapperRoles(Lists.newArrayList(curUser));
if (curUser.getRoleIds().contains("admin")) {
return BSResponse.ok("all");
}
List<String> menus = roleMenuService.getRoleMenus(curUser.getRoleIds());
return BSResponse.ok(menus);
}
}
package com.bigsys.auth.project.controller;
import com.bigsys.auth.project.db.model.Role;
import com.bigsys.auth.project.model.RoleMenus;
import com.bigsys.auth.project.service.RoleMenuService;
import com.bigsys.auth.project.service.RoleService;
import com.bigsys.auth.project.util.response.BSResponse;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping(value = "/role")
public class RoleController {
@Resource
private RoleService roleService;
@Resource
private RoleMenuService roleMenusService;
@RequestMapping(value = "/addRole")
public BSResponse addRole(@RequestBody Role role) {
roleService.insert(role);
return BSResponse.ok();
}
@RequestMapping(value = "/deleteRole")
public BSResponse deleteRole(String id) {
roleService.deleteRole(id);
return BSResponse.ok();
}
@RequestMapping(value = "/getRole")
public BSResponse getRole() {
List<Role> role = roleService.getRoles();
return BSResponse.ok(role);
}
@RequestMapping(value = "/addRoleMenus")
public BSResponse addRoleMenu(@RequestBody RoleMenus roleMenus) {
roleMenusService.addRoleMenus(roleMenus);
return BSResponse.ok();
}
@RequestMapping(value = "/getRoleMenus")
public BSResponse getRoleMenus(String role) {
List<String> links = roleMenusService.getRoleMenus(role);
return BSResponse.ok(links);
}
@RequestMapping(value = "/getSubRoles")
public BSResponse getSubRoles(String roleId) {
List<Role> roles = roleService.getSubRoles(roleId);
return BSResponse.ok(roles);
}
}
package com.bigsys.auth.project.controller;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.service.UserService;
import com.bigsys.auth.project.util.response.BSResponse;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.thymeleaf.util.StringUtils;
import javax.annotation.Resource;
import javax.naming.Name;
@RestController
@RequestMapping(value = "/user")
public class UserController {
@Resource
private UserService userService;
@RequestMapping(value = "/delete")
public BSResponse delete(String id) {
userService.deleteByPrimaryKey(id);
return BSResponse.ok();
}
@RequestMapping(value = "/addOrUpdate")
public BSResponse addOrUpdateUser(@RequestBody User model) {
userService.addOrUpdate(model);
return BSResponse.ok();
}
@RequestMapping(value = "/getById")
public BSResponse getById (String id) {
User user = userService.selectByPrimaryKey(id);
return BSResponse.ok(user);
}
@RequestMapping(value = "/page")
public PageInfo<User> page (User model, PageInfo<User> page) {
return userService.page(model, page);
}
}
package com.bigsys.auth.project.db.dao;
import com.bigsys.auth.project.db.model.AppInfo;
import com.bigsys.auth.project.db.model.AppInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface AppInfoMapper {
long countByExample(AppInfoExample example);
int deleteByExample(AppInfoExample example);
int deleteByPrimaryKey(Integer id);
int insert(AppInfo record);
int insertSelective(AppInfo record);
List<AppInfo> selectByExample(AppInfoExample example);
AppInfo selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") AppInfo record, @Param("example") AppInfoExample example);
int updateByExample(@Param("record") AppInfo record, @Param("example") AppInfoExample example);
int updateByPrimaryKeySelective(AppInfo record);
int updateByPrimaryKey(AppInfo record);
}
\ 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="com.bigsys.auth.project.db.dao.AppInfoMapper">
<resultMap id="BaseResultMap" type="com.bigsys.auth.project.db.model.AppInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="auth_time" jdbcType="VARCHAR" property="authTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, auth_time
</sql>
<select id="selectByExample" parameterType="com.bigsys.auth.project.db.model.AppInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bigsys_app_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bigsys_app_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from bigsys_app_info
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bigsys.auth.project.db.model.AppInfoExample">
delete from bigsys_app_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bigsys.auth.project.db.model.AppInfo">
insert into bigsys_app_info (id, name, auth_time
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{authTime,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.bigsys.auth.project.db.model.AppInfo">
insert into bigsys_app_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="authTime != null">
auth_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="authTime != null">
#{authTime,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bigsys.auth.project.db.model.AppInfoExample" resultType="java.lang.Long">
select count(*) from bigsys_app_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bigsys_app_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.authTime != null">
auth_time = #{record.authTime,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bigsys_app_info
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
auth_time = #{record.authTime,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bigsys.auth.project.db.model.AppInfo">
update bigsys_app_info
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="authTime != null">
auth_time = #{authTime,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bigsys.auth.project.db.model.AppInfo">
update bigsys_app_info
set name = #{name,jdbcType=VARCHAR},
auth_time = #{authTime,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
package com.bigsys.auth.project.db.dao;
import com.bigsys.auth.project.db.model.BsTest;
import com.bigsys.auth.project.db.model.BsTestExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface BsTestMapper {
long countByExample(BsTestExample example);
int deleteByExample(BsTestExample example);
int deleteByPrimaryKey(Integer id);
int insert(BsTest record);
int insertSelective(BsTest record);
List<BsTest> selectByExample(BsTestExample example);
BsTest selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") BsTest record, @Param("example") BsTestExample example);
int updateByExample(@Param("record") BsTest record, @Param("example") BsTestExample example);
int updateByPrimaryKeySelective(BsTest record);
int updateByPrimaryKey(BsTest record);
}
\ 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="com.bigsys.auth.project.db.dao.BsTestMapper">
<resultMap id="BaseResultMap" type="com.bigsys.auth.project.db.model.BsTest">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name
</sql>
<select id="selectByExample" parameterType="com.bigsys.auth.project.db.model.BsTestExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bigsys_test
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bigsys_test
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from bigsys_test
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bigsys.auth.project.db.model.BsTestExample">
delete from bigsys_test
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bigsys.auth.project.db.model.BsTest">
insert into bigsys_test (id, name)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.bigsys.auth.project.db.model.BsTest">
insert into bigsys_test
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bigsys.auth.project.db.model.BsTestExample" resultType="java.lang.Long">
select count(*) from bigsys_test
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bigsys_test
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bigsys_test
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bigsys.auth.project.db.model.BsTest">
update bigsys_test
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bigsys.auth.project.db.model.BsTest">
update bigsys_test
set name = #{name,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
package com.bigsys.auth.project.db.dao;
import com.bigsys.auth.project.db.model.Role;
import com.bigsys.auth.project.db.model.RoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RoleMapper {
long countByExample(RoleExample example);
int deleteByExample(RoleExample example);
int deleteByPrimaryKey(String id);
int insert(Role record);
int insertSelective(Role record);
List<Role> selectByExample(RoleExample example);
Role selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);
int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);
int updateByPrimaryKeySelective(Role record);
int updateByPrimaryKey(Role record);
}
\ 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="com.bigsys.auth.project.db.dao.RoleMapper">
<resultMap id="BaseResultMap" type="com.bigsys.auth.project.db.model.Role">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="parentId" jdbcType="VARCHAR" property="parentId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, parentId
</sql>
<select id="selectByExample" parameterType="com.bigsys.auth.project.db.model.RoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bigsys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bigsys_role
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from bigsys_role
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.bigsys.auth.project.db.model.RoleExample">
delete from bigsys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bigsys.auth.project.db.model.Role">
insert into bigsys_role (id, name, parentId
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.bigsys.auth.project.db.model.Role">
insert into bigsys_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="parentId != null">
parentId,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bigsys.auth.project.db.model.RoleExample" resultType="java.lang.Long">
select count(*) from bigsys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bigsys_role
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parentId = #{record.parentId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bigsys_role
set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
parentId = #{record.parentId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bigsys.auth.project.db.model.Role">
update bigsys_role
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parentId = #{parentId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.bigsys.auth.project.db.model.Role">
update bigsys_role
set name = #{name,jdbcType=VARCHAR},
parentId = #{parentId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package com.bigsys.auth.project.db.dao;
import com.bigsys.auth.project.db.model.RoleMenu;
import com.bigsys.auth.project.db.model.RoleMenuExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RoleMenuMapper {
long countByExample(RoleMenuExample example);
int deleteByExample(RoleMenuExample example);
int deleteByPrimaryKey(Integer id);
int insert(RoleMenu record);
int insertSelective(RoleMenu record);
List<RoleMenu> selectByExample(RoleMenuExample example);
RoleMenu selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") RoleMenu record, @Param("example") RoleMenuExample example);
int updateByExample(@Param("record") RoleMenu record, @Param("example") RoleMenuExample example);
int updateByPrimaryKeySelective(RoleMenu record);
int updateByPrimaryKey(RoleMenu record);
}
\ 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="com.bigsys.auth.project.db.dao.RoleMenuMapper">
<resultMap id="BaseResultMap" type="com.bigsys.auth.project.db.model.RoleMenu">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="role" jdbcType="VARCHAR" property="role" />
<result column="menu" jdbcType="VARCHAR" property="menu" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, role, menu
</sql>
<select id="selectByExample" parameterType="com.bigsys.auth.project.db.model.RoleMenuExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bigsys_role_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bigsys_role_menu
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from bigsys_role_menu
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bigsys.auth.project.db.model.RoleMenuExample">
delete from bigsys_role_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bigsys.auth.project.db.model.RoleMenu">
insert into bigsys_role_menu (id, role, menu
)
values (#{id,jdbcType=INTEGER}, #{role,jdbcType=VARCHAR}, #{menu,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.bigsys.auth.project.db.model.RoleMenu">
insert into bigsys_role_menu
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="role != null">
role,
</if>
<if test="menu != null">
menu,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="role != null">
#{role,jdbcType=VARCHAR},
</if>
<if test="menu != null">
#{menu,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bigsys.auth.project.db.model.RoleMenuExample" resultType="java.lang.Long">
select count(*) from bigsys_role_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bigsys_role_menu
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.role != null">
role = #{record.role,jdbcType=VARCHAR},
</if>
<if test="record.menu != null">
menu = #{record.menu,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bigsys_role_menu
set id = #{record.id,jdbcType=INTEGER},
role = #{record.role,jdbcType=VARCHAR},
menu = #{record.menu,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bigsys.auth.project.db.model.RoleMenu">
update bigsys_role_menu
<set>
<if test="role != null">
role = #{role,jdbcType=VARCHAR},
</if>
<if test="menu != null">
menu = #{menu,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bigsys.auth.project.db.model.RoleMenu">
update bigsys_role_menu
set role = #{role,jdbcType=VARCHAR},
menu = #{menu,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
package com.bigsys.auth.project.db.dao;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.db.model.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserMapper {
long countByExample(UserExample example);
int deleteByExample(UserExample example);
int deleteByPrimaryKey(String id);
int insert(User record);
int insertSelective(User record);
List<User> selectByExample(UserExample example);
User selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
int updateByExample(@Param("record") User record, @Param("example") UserExample example);
int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record);
}
\ 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="com.bigsys.auth.project.db.dao.UserMapper">
<resultMap id="BaseResultMap" type="com.bigsys.auth.project.db.model.User">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="passward" jdbcType="VARCHAR" property="passward" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, username, name, passward, phone, createTime, updateTime
</sql>
<select id="selectByExample" parameterType="com.bigsys.auth.project.db.model.UserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bigsys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bigsys_user
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from bigsys_user
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.bigsys.auth.project.db.model.UserExample">
delete from bigsys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bigsys.auth.project.db.model.User">
insert into bigsys_user (id, username, name,
passward, phone, createTime,
updateTime)
values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{passward,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.bigsys.auth.project.db.model.User">
insert into bigsys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="username != null">
username,
</if>
<if test="name != null">
name,
</if>
<if test="passward != null">
passward,
</if>
<if test="phone != null">
phone,
</if>
<if test="createTime != null">
createTime,
</if>
<if test="updateTime != null">
updateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="passward != null">
#{passward,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bigsys.auth.project.db.model.UserExample" resultType="java.lang.Long">
select count(*) from bigsys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bigsys_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.passward != null">
passward = #{record.passward,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
createTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
updateTime = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bigsys_user
set id = #{record.id,jdbcType=VARCHAR},
username = #{record.username,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
passward = #{record.passward,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
createTime = #{record.createTime,jdbcType=TIMESTAMP},
updateTime = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bigsys.auth.project.db.model.User">
update bigsys_user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="passward != null">
passward = #{passward,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
createTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
updateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.bigsys.auth.project.db.model.User">
update bigsys_user
set username = #{username,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
passward = #{passward,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
createTime = #{createTime,jdbcType=TIMESTAMP},
updateTime = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package com.bigsys.auth.project.db.dao;
import com.bigsys.auth.project.db.model.UserRole;
import com.bigsys.auth.project.db.model.UserRoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserRoleMapper {
long countByExample(UserRoleExample example);
int deleteByExample(UserRoleExample example);
int deleteByPrimaryKey(Integer id);
int insert(UserRole record);
int insertSelective(UserRole record);
List<UserRole> selectByExample(UserRoleExample example);
UserRole selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") UserRole record, @Param("example") UserRoleExample example);
int updateByExample(@Param("record") UserRole record, @Param("example") UserRoleExample example);
int updateByPrimaryKeySelective(UserRole record);
int updateByPrimaryKey(UserRole record);
}
\ 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="com.bigsys.auth.project.db.dao.UserRoleMapper">
<resultMap id="BaseResultMap" type="com.bigsys.auth.project.db.model.UserRole">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="role" jdbcType="VARCHAR" property="role" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, username, role
</sql>
<select id="selectByExample" parameterType="com.bigsys.auth.project.db.model.UserRoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bigsys_user_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bigsys_user_role
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from bigsys_user_role
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bigsys.auth.project.db.model.UserRoleExample">
delete from bigsys_user_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bigsys.auth.project.db.model.UserRole">
insert into bigsys_user_role (id, username, role
)
values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{role,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.bigsys.auth.project.db.model.UserRole">
insert into bigsys_user_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="username != null">
username,
</if>
<if test="role != null">
role,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="role != null">
#{role,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bigsys.auth.project.db.model.UserRoleExample" resultType="java.lang.Long">
select count(*) from bigsys_user_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bigsys_user_role
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.role != null">
role = #{record.role,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bigsys_user_role
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
role = #{record.role,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bigsys.auth.project.db.model.UserRole">
update bigsys_user_role
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="role != null">
role = #{role,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bigsys.auth.project.db.model.UserRole">
update bigsys_user_role
set username = #{username,jdbcType=VARCHAR},
role = #{role,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
package com.bigsys.auth.project.db.model;
public class AppInfo {
private Integer id;
private String name;
private String authTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getAuthTime() {
return authTime;
}
public void setAuthTime(String authTime) {
this.authTime = authTime == null ? null : authTime.trim();
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import java.util.ArrayList;
import java.util.List;
public class AppInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public AppInfoExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andAuthTimeIsNull() {
addCriterion("auth_time is null");
return (Criteria) this;
}
public Criteria andAuthTimeIsNotNull() {
addCriterion("auth_time is not null");
return (Criteria) this;
}
public Criteria andAuthTimeEqualTo(String value) {
addCriterion("auth_time =", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeNotEqualTo(String value) {
addCriterion("auth_time <>", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeGreaterThan(String value) {
addCriterion("auth_time >", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeGreaterThanOrEqualTo(String value) {
addCriterion("auth_time >=", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeLessThan(String value) {
addCriterion("auth_time <", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeLessThanOrEqualTo(String value) {
addCriterion("auth_time <=", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeLike(String value) {
addCriterion("auth_time like", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeNotLike(String value) {
addCriterion("auth_time not like", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeIn(List<String> values) {
addCriterion("auth_time in", values, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeNotIn(List<String> values) {
addCriterion("auth_time not in", values, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeBetween(String value1, String value2) {
addCriterion("auth_time between", value1, value2, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeNotBetween(String value1, String value2) {
addCriterion("auth_time not between", value1, value2, "authTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
public class BsTest {
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
@Override
public String toString() {
return "BsTest{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import java.util.ArrayList;
import java.util.List;
public class BsTestExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public BsTestExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import java.util.ArrayList;
import java.util.List;
public class Role {
private String id;
private String name;
private String parentId;
private List<Role> roles = new ArrayList<>();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId == null ? null : parentId.trim();
}
public List<Role> getRoles() {
return roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import java.util.ArrayList;
import java.util.List;
public class RoleExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RoleExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parentId is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parentId is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(String value) {
addCriterion("parentId =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(String value) {
addCriterion("parentId <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(String value) {
addCriterion("parentId >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(String value) {
addCriterion("parentId >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(String value) {
addCriterion("parentId <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(String value) {
addCriterion("parentId <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLike(String value) {
addCriterion("parentId like", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotLike(String value) {
addCriterion("parentId not like", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<String> values) {
addCriterion("parentId in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<String> values) {
addCriterion("parentId not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(String value1, String value2) {
addCriterion("parentId between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(String value1, String value2) {
addCriterion("parentId not between", value1, value2, "parentId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
public class RoleMenu {
private Integer id;
private String role;
private String menu;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role == null ? null : role.trim();
}
public String getMenu() {
return menu;
}
public void setMenu(String menu) {
this.menu = menu == null ? null : menu.trim();
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import java.util.ArrayList;
import java.util.List;
public class RoleMenuExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RoleMenuExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andRoleIsNull() {
addCriterion("role is null");
return (Criteria) this;
}
public Criteria andRoleIsNotNull() {
addCriterion("role is not null");
return (Criteria) this;
}
public Criteria andRoleEqualTo(String value) {
addCriterion("role =", value, "role");
return (Criteria) this;
}
public Criteria andRoleNotEqualTo(String value) {
addCriterion("role <>", value, "role");
return (Criteria) this;
}
public Criteria andRoleGreaterThan(String value) {
addCriterion("role >", value, "role");
return (Criteria) this;
}
public Criteria andRoleGreaterThanOrEqualTo(String value) {
addCriterion("role >=", value, "role");
return (Criteria) this;
}
public Criteria andRoleLessThan(String value) {
addCriterion("role <", value, "role");
return (Criteria) this;
}
public Criteria andRoleLessThanOrEqualTo(String value) {
addCriterion("role <=", value, "role");
return (Criteria) this;
}
public Criteria andRoleLike(String value) {
addCriterion("role like", value, "role");
return (Criteria) this;
}
public Criteria andRoleNotLike(String value) {
addCriterion("role not like", value, "role");
return (Criteria) this;
}
public Criteria andRoleIn(List<String> values) {
addCriterion("role in", values, "role");
return (Criteria) this;
}
public Criteria andRoleNotIn(List<String> values) {
addCriterion("role not in", values, "role");
return (Criteria) this;
}
public Criteria andRoleBetween(String value1, String value2) {
addCriterion("role between", value1, value2, "role");
return (Criteria) this;
}
public Criteria andRoleNotBetween(String value1, String value2) {
addCriterion("role not between", value1, value2, "role");
return (Criteria) this;
}
public Criteria andMenuIsNull() {
addCriterion("menu is null");
return (Criteria) this;
}
public Criteria andMenuIsNotNull() {
addCriterion("menu is not null");
return (Criteria) this;
}
public Criteria andMenuEqualTo(String value) {
addCriterion("menu =", value, "menu");
return (Criteria) this;
}
public Criteria andMenuNotEqualTo(String value) {
addCriterion("menu <>", value, "menu");
return (Criteria) this;
}
public Criteria andMenuGreaterThan(String value) {
addCriterion("menu >", value, "menu");
return (Criteria) this;
}
public Criteria andMenuGreaterThanOrEqualTo(String value) {
addCriterion("menu >=", value, "menu");
return (Criteria) this;
}
public Criteria andMenuLessThan(String value) {
addCriterion("menu <", value, "menu");
return (Criteria) this;
}
public Criteria andMenuLessThanOrEqualTo(String value) {
addCriterion("menu <=", value, "menu");
return (Criteria) this;
}
public Criteria andMenuLike(String value) {
addCriterion("menu like", value, "menu");
return (Criteria) this;
}
public Criteria andMenuNotLike(String value) {
addCriterion("menu not like", value, "menu");
return (Criteria) this;
}
public Criteria andMenuIn(List<String> values) {
addCriterion("menu in", values, "menu");
return (Criteria) this;
}
public Criteria andMenuNotIn(List<String> values) {
addCriterion("menu not in", values, "menu");
return (Criteria) this;
}
public Criteria andMenuBetween(String value1, String value2) {
addCriterion("menu between", value1, value2, "menu");
return (Criteria) this;
}
public Criteria andMenuNotBetween(String value1, String value2) {
addCriterion("menu not between", value1, value2, "menu");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import com.bigsys.auth.project.service.WrapperRole;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class User implements WrapperRole{
private String id;
private String username;
private String name;
private String passward;
private String phone;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private List<String> roleIds = new ArrayList<>();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username == null ? null : username.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getPassward() {
return passward;
}
public void setPassward(String passward) {
this.passward = passward == null ? null : passward.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
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 List<String> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<String> roleIds) {
this.roleIds = roleIds;
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class UserExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUsernameIsNull() {
addCriterion("username is null");
return (Criteria) this;
}
public Criteria andUsernameIsNotNull() {
addCriterion("username is not null");
return (Criteria) this;
}
public Criteria andUsernameEqualTo(String value) {
addCriterion("username =", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotEqualTo(String value) {
addCriterion("username <>", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThan(String value) {
addCriterion("username >", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThanOrEqualTo(String value) {
addCriterion("username >=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThan(String value) {
addCriterion("username <", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThanOrEqualTo(String value) {
addCriterion("username <=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLike(String value) {
addCriterion("username like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotLike(String value) {
addCriterion("username not like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameIn(List<String> values) {
addCriterion("username in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameNotIn(List<String> values) {
addCriterion("username not in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameBetween(String value1, String value2) {
addCriterion("username between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andUsernameNotBetween(String value1, String value2) {
addCriterion("username not between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andPasswardIsNull() {
addCriterion("passward is null");
return (Criteria) this;
}
public Criteria andPasswardIsNotNull() {
addCriterion("passward is not null");
return (Criteria) this;
}
public Criteria andPasswardEqualTo(String value) {
addCriterion("passward =", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardNotEqualTo(String value) {
addCriterion("passward <>", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardGreaterThan(String value) {
addCriterion("passward >", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardGreaterThanOrEqualTo(String value) {
addCriterion("passward >=", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardLessThan(String value) {
addCriterion("passward <", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardLessThanOrEqualTo(String value) {
addCriterion("passward <=", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardLike(String value) {
addCriterion("passward like", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardNotLike(String value) {
addCriterion("passward not like", value, "passward");
return (Criteria) this;
}
public Criteria andPasswardIn(List<String> values) {
addCriterion("passward in", values, "passward");
return (Criteria) this;
}
public Criteria andPasswardNotIn(List<String> values) {
addCriterion("passward not in", values, "passward");
return (Criteria) this;
}
public Criteria andPasswardBetween(String value1, String value2) {
addCriterion("passward between", value1, value2, "passward");
return (Criteria) this;
}
public Criteria andPasswardNotBetween(String value1, String value2) {
addCriterion("passward not between", value1, value2, "passward");
return (Criteria) this;
}
public Criteria andPhoneIsNull() {
addCriterion("phone is null");
return (Criteria) this;
}
public Criteria andPhoneIsNotNull() {
addCriterion("phone is not null");
return (Criteria) this;
}
public Criteria andPhoneEqualTo(String value) {
addCriterion("phone =", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotEqualTo(String value) {
addCriterion("phone <>", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThan(String value) {
addCriterion("phone >", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThanOrEqualTo(String value) {
addCriterion("phone >=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThan(String value) {
addCriterion("phone <", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThanOrEqualTo(String value) {
addCriterion("phone <=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLike(String value) {
addCriterion("phone like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotLike(String value) {
addCriterion("phone not like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneIn(List<String> values) {
addCriterion("phone in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotIn(List<String> values) {
addCriterion("phone not in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneBetween(String value1, String value2) {
addCriterion("phone between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotBetween(String value1, String value2) {
addCriterion("phone not between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("createTime is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("createTime is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("createTime =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("createTime <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("createTime >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("createTime >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("createTime <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("createTime <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("createTime in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("createTime not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("createTime between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("createTime not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("updateTime is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("updateTime is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("updateTime =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("updateTime <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("updateTime >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("updateTime >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("updateTime <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("updateTime <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("updateTime in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("updateTime not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("updateTime between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("updateTime not between", value1, value2, "updateTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
public class UserRole {
private Integer id;
private String username;
private String role;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username == null ? null : username.trim();
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role == null ? null : role.trim();
}
}
\ No newline at end of file
package com.bigsys.auth.project.db.model;
import java.util.ArrayList;
import java.util.List;
public class UserRoleExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserRoleExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUsernameIsNull() {
addCriterion("username is null");
return (Criteria) this;
}
public Criteria andUsernameIsNotNull() {
addCriterion("username is not null");
return (Criteria) this;
}
public Criteria andUsernameEqualTo(String value) {
addCriterion("username =", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotEqualTo(String value) {
addCriterion("username <>", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThan(String value) {
addCriterion("username >", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThanOrEqualTo(String value) {
addCriterion("username >=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThan(String value) {
addCriterion("username <", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThanOrEqualTo(String value) {
addCriterion("username <=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLike(String value) {
addCriterion("username like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotLike(String value) {
addCriterion("username not like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameIn(List<String> values) {
addCriterion("username in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameNotIn(List<String> values) {
addCriterion("username not in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameBetween(String value1, String value2) {
addCriterion("username between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andUsernameNotBetween(String value1, String value2) {
addCriterion("username not between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andRoleIsNull() {
addCriterion("role is null");
return (Criteria) this;
}
public Criteria andRoleIsNotNull() {
addCriterion("role is not null");
return (Criteria) this;
}
public Criteria andRoleEqualTo(String value) {
addCriterion("role =", value, "role");
return (Criteria) this;
}
public Criteria andRoleNotEqualTo(String value) {
addCriterion("role <>", value, "role");
return (Criteria) this;
}
public Criteria andRoleGreaterThan(String value) {
addCriterion("role >", value, "role");
return (Criteria) this;
}
public Criteria andRoleGreaterThanOrEqualTo(String value) {
addCriterion("role >=", value, "role");
return (Criteria) this;
}
public Criteria andRoleLessThan(String value) {
addCriterion("role <", value, "role");
return (Criteria) this;
}
public Criteria andRoleLessThanOrEqualTo(String value) {
addCriterion("role <=", value, "role");
return (Criteria) this;
}
public Criteria andRoleLike(String value) {
addCriterion("role like", value, "role");
return (Criteria) this;
}
public Criteria andRoleNotLike(String value) {
addCriterion("role not like", value, "role");
return (Criteria) this;
}
public Criteria andRoleIn(List<String> values) {
addCriterion("role in", values, "role");
return (Criteria) this;
}
public Criteria andRoleNotIn(List<String> values) {
addCriterion("role not in", values, "role");
return (Criteria) this;
}
public Criteria andRoleBetween(String value1, String value2) {
addCriterion("role between", value1, value2, "role");
return (Criteria) this;
}
public Criteria andRoleNotBetween(String value1, String value2) {
addCriterion("role not between", value1, value2, "role");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.bigsys.auth.project.model;
import java.util.List;
public class Menu {
private String name;
private String link;
private boolean hasSub = false;
private List<Menu> menus;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public boolean isHasSub() {
return hasSub;
}
public void setHasSub(boolean hasSub) {
this.hasSub = hasSub;
}
public List<Menu> getMenus() {
return menus;
}
public void setMenus(List<Menu> menus) {
this.menus = menus;
}
}
package com.bigsys.auth.project.model;
import java.util.List;
public class RoleMenus {
private String id;
private List<String> links;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<String> getLinks() {
return links;
}
public void setLinks(List<String> links) {
this.links = links;
}
}
package com.bigsys.auth.project.service;
import com.bigsys.auth.project.db.model.RoleMenu;
import com.bigsys.auth.project.db.model.RoleMenuExample;
import com.bigsys.auth.project.model.RoleMenus;
import com.bigsys.auth.project.util.service.BaseService;
import java.util.List;
public interface RoleMenuService extends BaseService<Integer, RoleMenu, RoleMenuExample, RoleMenuExample.Criteria> {
void addRoleMenus(RoleMenus roleMenus);
List<String> getRoleMenus(String role);
List<String> getRoleMenus(List<String> roleIds);
}
package com.bigsys.auth.project.service;
import com.bigsys.auth.project.db.model.Role;
import com.bigsys.auth.project.db.model.RoleExample;
import com.bigsys.auth.project.util.service.BaseService;
import java.util.List;
public interface RoleService extends BaseService<String, Role, RoleExample, RoleExample.Criteria>{
/**
* 获取嵌套结构的role列表
*/
List<Role> getRoles();
/**
* 有子角色的话一同删除
* @param id
*/
void deleteRole(String id);
/**
* 获取给定roleId下面的所有子角色
* @param roleId
* @return
*/
List<Role> getSubRoles(String roleId);
}
package com.bigsys.auth.project.service;
import com.bigsys.auth.project.db.model.UserRole;
import com.bigsys.auth.project.db.model.UserRoleExample;
import com.bigsys.auth.project.util.service.BaseService;
import java.util.List;
public interface UserRoleService extends BaseService<Integer, UserRole, UserRoleExample, UserRoleExample.Criteria> {
/**
* 为用户包裹上用户对应的角色信息
* @param list
*/
void wrapperRoles(List<? extends WrapperRole> list);
/**
* 通过用户名称获取用户对应的角色
* @param username
* @return
*/
List<UserRole> getUserRoles(String username);
/**
* 根据角色id查询有该角色id的用户
* @param roleIds
* @return
*/
List<UserRole> getUserRoles(List<String> roleIds);
}
package com.bigsys.auth.project.service;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.db.model.UserExample;
import com.bigsys.auth.project.util.service.BaseService;
import com.github.pagehelper.PageInfo;
public interface UserService extends BaseService<String, User, UserExample, UserExample.Criteria> {
void addOrUpdate(User model);
/**
* 根据当前登录人角色返回对应的角色下的用户
* @param condition
* @param pager
* @return
*/
PageInfo<User> page(User condition, PageInfo<User> pager);
User getUser(String username);
}
package com.bigsys.auth.project.service;
import java.util.List;
public interface WrapperRole {
void setRoleIds(List<String> roleIds);
String getUsername();
}
package com.bigsys.auth.project.service.impl;
import com.bigsys.auth.api.AppAuth;
import com.bigsys.auth.project.db.dao.AppInfoMapper;
import com.bigsys.auth.project.db.model.AppInfo;
import com.bigsys.auth.project.db.model.AppInfoExample;
import com.bigsys.auth.project.util.CreateExample;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("appAuth")
public class AppAuthImpl implements AppAuth {
@Resource
private AppInfoMapper appInfoMapper;
List<AppInfo> select(CreateExample<AppInfoExample, AppInfoExample.Criteria> example) {
AppInfoExample appInfoExample = new AppInfoExample();
AppInfoExample.Criteria criteria = appInfoExample.createCriteria();
example.createExample(appInfoExample, criteria);
return appInfoMapper.selectByExample(appInfoExample);
}
@Override
public com.bigsys.auth.api.model.AppInfo auth(String name) {
List<AppInfo> list = select((example, criteria) -> {});
if (list.size() > 0) {
com.bigsys.auth.api.model.AppInfo appInfo = new com.bigsys.auth.api.model.AppInfo();
appInfo.setId(list.get(0).getId());
appInfo.setName(list.get(0).getName());
appInfo.setAuthTime(list.get(0).getAuthTime());
return appInfo;
}
return null;
}
}
package com.bigsys.auth.project.service.impl;
import com.bigsys.auth.project.db.dao.RoleMenuMapper;
import com.bigsys.auth.project.db.model.RoleMenu;
import com.bigsys.auth.project.db.model.RoleMenuExample;
import com.bigsys.auth.project.model.RoleMenus;
import com.bigsys.auth.project.service.RoleMenuService;
import com.bigsys.auth.project.util.service.BaseServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@Service("roleMenuService")
public class RoleMenuServiceImpl extends BaseServiceImpl<Integer, RoleMenu, RoleMenuExample, RoleMenuExample.Criteria> implements RoleMenuService {
@Resource
private RoleMenuMapper roleMenuMapper;
@Override
public Object getDao() {
return roleMenuMapper;
}
@Override
public Class getExample() {
return RoleMenuExample.class;
}
@Override
public void addRoleMenus(RoleMenus roleMenus) {
deleteByExample((a, b) -> {
b.andRoleEqualTo(roleMenus.getId());
});
for (String link : roleMenus.getLinks()) {
RoleMenu roleMenu = new RoleMenu();
roleMenu.setMenu(link);
roleMenu.setRole(roleMenus.getId());
insert(roleMenu);
}
}
@Override
public List<String> getRoleMenus(String role) {
List<RoleMenu> roleMenus = selectByExample((a, b) -> {
b.andRoleEqualTo(role);
});
List<String> menus = roleMenus.stream()
.map(roleMenu -> roleMenu.getMenu())
.collect(Collectors.toList());
return menus;
}
@Override
public List<String> getRoleMenus(List<String> roleIds) {
List<RoleMenu> roleMenus = selectByExample((a, b) -> {
b.andRoleIn(roleIds);
});
return roleMenus.stream()
.map(roleMenu -> roleMenu.getMenu())
.distinct().collect(Collectors.toList());
}
}
package com.bigsys.auth.project.service.impl;
import com.bigsys.auth.project.db.dao.RoleMapper;
import com.bigsys.auth.project.db.model.Role;
import com.bigsys.auth.project.db.model.RoleExample;
import com.bigsys.auth.project.service.RoleService;
import com.bigsys.auth.project.util.service.BaseServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("roleService")
public class RoleServiceImpl extends BaseServiceImpl<String, Role, RoleExample, RoleExample.Criteria> implements RoleService{
@Resource
private RoleMapper roleMapper;
@Override
public Object getDao() {
return roleMapper;
}
@Override
public Class getExample() {
return RoleExample.class;
}
@Override
public List<Role> getRoles() {
List<Role> roles = selectByExample((a, b) -> {});
Map<String, List<Role>> roleMap = new HashMap<>();
for (Role role : roles) {
if (roleMap.get(role.getParentId()) == null) {
roleMap.put(role.getParentId(), new ArrayList<>());
}
roleMap.get(role.getParentId()).add(role);
}
Role role = roleMap.get(null).get(0);
fillRole(role, roleMap);
List<Role> roleWrapper = new ArrayList<>();
roleWrapper.add(role);
return roleWrapper;
}
@Override
public void deleteRole(String id) {
doDeleteRole(id);
}
@Override
public List<Role> getSubRoles(String roleId) {
List<Role> roles = new ArrayList<>();
roles = selectByExample((a, b) -> {
b.andParentIdEqualTo(roleId);
});
List<Role> subSubRoles = new ArrayList<>();
for (Role role : roles) {
subSubRoles.addAll(getSubRoles(role.getId()));
}
roles.addAll(subSubRoles);
return roles;
}
private void doDeleteRole(String id) {
List<Role> subRoles = selectByExample((a, b) -> {
b.andParentIdEqualTo(id);
});
deleteByPrimaryKey(id);
if (subRoles.size() > 0) {
for (Role subRole : subRoles) {
doDeleteRole(subRole.getId());
}
}
}
private void fillRole(Role role, Map<String, List<Role>> roleMap) {
if (roleMap.get(role.getId()) == null) { //叶子节点
return;
}
role.setRoles(roleMap.get(role.getId()));
for (Role subRole : roleMap.get(role.getId())) {
fillRole(subRole, roleMap);
}
}
}
package com.bigsys.auth.project.service.impl;
import com.bigsys.auth.project.db.dao.UserRoleMapper;
import com.bigsys.auth.project.db.model.UserRole;
import com.bigsys.auth.project.db.model.UserRoleExample;
import com.bigsys.auth.project.service.WrapperRole;
import com.bigsys.auth.project.service.UserRoleService;
import com.bigsys.auth.project.util.service.BaseServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@Service("userRoleService")
public class UserRoleServiceImpl extends BaseServiceImpl<Integer, UserRole, UserRoleExample, UserRoleExample.Criteria> implements UserRoleService{
@Resource
private UserRoleMapper userRoleMapper;
@Override
public Object getDao() {
return userRoleMapper;
}
@Override
public Class getExample() {
return UserRoleExample.class;
}
@Override
public void wrapperRoles(List<? extends WrapperRole> list) {
for (WrapperRole wrapperRole : list) {
List<UserRole> userRoles = selectByExample((a, b) -> {
b.andUsernameEqualTo(wrapperRole.getUsername());
});
wrapperRole.setRoleIds(userRoles.stream().map(userRole -> userRole.getRole()).collect(Collectors.toList()));
}
}
@Override
public List<UserRole> getUserRoles(String username) {
List<UserRole> userRoles = selectByExample((a, b) -> {
b.andUsernameEqualTo(username);
});
return userRoles;
}
@Override
public List<UserRole> getUserRoles(List<String> roleIds) {
List<UserRole> userRoles = selectByExample((a, b) -> {
b.andRoleIn(roleIds);
});
return userRoles;
}
}
package com.bigsys.auth.project.service.impl;
import com.bigsys.auth.project.db.dao.UserMapper;
import com.bigsys.auth.project.db.model.Role;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.db.model.UserExample;
import com.bigsys.auth.project.db.model.UserRole;
import com.bigsys.auth.project.service.RoleService;
import com.bigsys.auth.project.service.UserRoleService;
import com.bigsys.auth.project.service.UserService;
import com.bigsys.auth.project.util.UUIDGenarator;
import com.bigsys.auth.project.util.service.BaseServiceImpl;
import com.github.pagehelper.PageInfo;
import com.sun.javafx.scene.control.skin.VirtualFlow;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
import org.thymeleaf.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Service("userService")
public class UserServiceImpl extends BaseServiceImpl<String, User, UserExample, UserExample.Criteria> implements UserService {
private final String INIT_PWD = "123456";
@Resource
private UserMapper userMapper;
@Resource
private UserRoleService userRoleService;
@Resource
private RoleService roleService;
@Override
public Object getDao() {
return userMapper;
}
@Override
public Class getExample() {
return UserExample.class;
}
@Override
public void addOrUpdate(User model) {
if (StringUtils.isEmpty(model.getId())) {
model.setId(UUIDGenarator.getUUID());
model.setPassward(INIT_PWD);
model.setCreateTime(new Date());
model.setUpdateTime(new Date());
userMapper.insert(model);
} else {
userMapper.updateByPrimaryKeySelective(model);
}
userRoleService.deleteByExample((a, b) -> {
b.andUsernameEqualTo(model.getUsername());
});
for (String roleId : model.getRoleIds()) {
UserRole userRole = new UserRole();
userRole.setUsername(model.getUsername());
userRole.setRole(roleId);
userRoleService.insert(userRole);
}
}
@Override
public PageInfo<User> page(User condition, PageInfo<User> pager) {
User curUser = (User) SecurityUtils.getSubject().getPrincipal();
List<UserRole> userRoles = userRoleService.getUserRoles(curUser.getUsername());
List<Role> subRoles = new ArrayList<>();
for (UserRole userRole : userRoles) {
subRoles.addAll(roleService.getSubRoles(userRole.getRole()));
}
List<UserRole> subUserRoles = userRoleService.getUserRoles(subRoles.stream().map(subRole -> subRole.getId()).collect(Collectors.toList()));
pager = selectByExampleAndPage(pager, (example, criteria) -> {
example.setOrderByClause("updateTime desc");
criteria.andUsernameIn(subUserRoles.stream().map(subUserRole -> subUserRole.getUsername()).collect(Collectors.toList()));
});
userRoleService.wrapperRoles(pager.getList());
return pager;
}
@Override
public User getUser(String username) {
List<User> users = selectByExample((a, b) -> {
b.andUsernameEqualTo(username);
});
return users.get(0);
}
}
package com.bigsys.auth.project.util;
public interface CreateExample<k, v> {
void createExample(k k, v v);
}
package com.bigsys.auth.project.util;
public class UUIDGenarator {
/**
* 获取32位唯一主键
* @return
*/
public static synchronized String getUUID(){
return java.util.UUID.randomUUID().toString().replaceAll("-", "") ;
}
}
package com.bigsys.auth.project.util.response;
import java.util.HashMap;
public class BSResponse extends HashMap{
private static final String OK = "OK";
private static final String FAIL = "FAIL";
private static final String NEEDLOGIN = "NEEDLOGIN";
public static BSResponse ok() {
BSResponse bsResponse = new BSResponse();
bsResponse.put("status", OK);
return bsResponse;
}
public static BSResponse ok(Object data) {
BSResponse bsResponse = new BSResponse();
bsResponse.put("status", OK);
bsResponse.put("data", data);
return bsResponse;
}
public static BSResponse error(String msg) {
BSResponse bsResponse = new BSResponse();
bsResponse.put("status", FAIL);
bsResponse.put("msg", msg);
return bsResponse;
}
public static BSResponse needLogin(String msg) {
BSResponse bsResponse = new BSResponse();
bsResponse.put("status", NEEDLOGIN);
bsResponse.put("msg", msg);
return bsResponse;
}
}
package com.bigsys.auth.project.util.service;
import com.bigsys.auth.project.util.CreateExample;
import com.github.pagehelper.PageInfo;
import java.util.List;
public interface BaseService<key, model, example, criteria> {
long countByExample(CreateExample<example, criteria> createExample);
int deleteByExample(CreateExample<example, criteria> createExample);
int deleteByPrimaryKey(key id);
int insert(model record);
int insertSelective(model record);
List<model> selectByExample(CreateExample<example, criteria> createExample);
model selectByPrimaryKey(key id);
int updateByExampleSelective(model record, CreateExample<example, criteria> createExample);
int updateByExample(model record, CreateExample<example, criteria> createExample);
int updateByPrimaryKeySelective(model record);
int updateByPrimaryKey(model record);
PageInfo<model> selectByExampleAndPage(PageInfo<model> page, CreateExample<example, criteria> createExample);
}
package com.bigsys.auth.project.util.service;
import com.bigsys.auth.project.util.CreateExample;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public abstract class BaseServiceImpl<key, model, example, criteria> implements BaseService<key, model, example, criteria> {
private Map<String, Method> methodMap = new HashMap<>();
private final String MYBATIS_COUNTBYEXAMPLE = "countByExample";
private final String MYBATIS_DELETEBYEXAMPLE = "deleteByExample";
private final String MYBATIS_DELETEBYPRIMARYKEY = "deleteByPrimaryKey";
private final String MYBATIS_INSERT = "insert";
private final String MYBATIS_INSERTSELECTIVE = "insertSelective";
private final String MYBATIS_SELECTBYEXAMPLE = "selectByExample";
private final String MYBATIS_SELECTBYPRIMARYKEY = "selectByPrimaryKey";
private final String MYBATIS_UPDATEBYEXAMPLESELECTIVE = "updateByExampleSelective";
private final String MYBATIS_UPDATEBYEXAMPLE = "updateByExample";
private final String MYBATIS_UPDATEBYPRIMARYKEYSELECTIVE = "updateByPrimaryKeySelective";
private final String MYBATIS_UPDATEBYPRIMARYKEY = "updateByPrimaryKey";
private final String MYBATIS_CREATECRITERIA = "createCriteria";
public abstract Object getDao();
public abstract Class getExample();
@Override
public long countByExample(CreateExample<example, criteria> createExample) {
return (long) invokeMethod(getDao(), MYBATIS_COUNTBYEXAMPLE, produceExample(createExample));
}
@Override
public int deleteByExample(CreateExample<example, criteria> createExample) {
return (int) invokeMethod(getDao(), MYBATIS_DELETEBYEXAMPLE, produceExample(createExample));
}
@Override
public int deleteByPrimaryKey(key id) {
return (int) invokeMethod(getDao(), MYBATIS_DELETEBYPRIMARYKEY, id);
}
@Override
public int insert(model record) {
return (int) invokeMethod(getDao(), MYBATIS_INSERT, record);
}
@Override
public int insertSelective(model record) {
return (int) invokeMethod(getDao(), MYBATIS_INSERTSELECTIVE, record);
}
@Override
public List<model> selectByExample(CreateExample<example, criteria> createExample) {
return (List<model>) invokeMethod(getDao(), MYBATIS_SELECTBYEXAMPLE, produceExample(createExample));
}
@Override
public model selectByPrimaryKey(key id) {
return (model) invokeMethod(getDao(), MYBATIS_SELECTBYPRIMARYKEY, id);
}
@Override
public int updateByExampleSelective(model record, CreateExample<example, criteria> createExample) {
return (int) invokeMethod(getDao(), MYBATIS_UPDATEBYEXAMPLESELECTIVE, record, produceExample(createExample));
}
@Override
public int updateByExample(model record, CreateExample<example, criteria> createExample) {
return (int) invokeMethod(getDao(), MYBATIS_UPDATEBYEXAMPLE, record, produceExample(createExample));
}
@Override
public int updateByPrimaryKeySelective(model record) {
return (int) invokeMethod(getDao(), MYBATIS_UPDATEBYPRIMARYKEYSELECTIVE, record);
}
@Override
public int updateByPrimaryKey(model record) {
return (int) invokeMethod(getDao(), MYBATIS_UPDATEBYPRIMARYKEY, record);
}
@Override
public PageInfo<model> selectByExampleAndPage(PageInfo<model> page, CreateExample<example, criteria> createExample) {
page = PageHelper.startPage(page).doSelectPageInfo(() -> {
invokeMethod(getDao(), MYBATIS_SELECTBYEXAMPLE, produceExample(createExample));
});
return page;
}
private void init() {
Object dao = getDao();
Class clazz = dao.getClass();
Method[] methods = clazz.getMethods();
for (Method method : methods) {
methodMap.put(method.getName(), method);
}
}
private example produceExample(CreateExample<example, criteria> createExample) {
example example = null;
try {
example = (example) getExample().newInstance();
Class clazz = example.getClass();
criteria criteria = (criteria) clazz.getMethod(MYBATIS_CREATECRITERIA).invoke(example);
createExample.createExample(example, criteria);
return example;
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
private Object invokeMethod(Object obj, String method, Object... args) {
if (methodMap.size() == 0) {
init();
}
try {
Object value = methodMap.get(method).invoke(obj, args);
return value;
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
}
server.context-path=/bigsys-auth
server.port=9003
spring.datasource.url=jdbc:mysql://localhost:3306/bigsys?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
spring.datasource.username=root
spring.datasource.password=root
spring.output.ansi.enabled=always
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<h1>请登录</h1>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
</head>
<body>
<h1>hello world</h1>
</body>
</html>
\ No newline at end of file
package com.bigsys.auth.project;
import com.bigsys.auth.project.db.model.User;
import com.bigsys.auth.project.service.UserService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
@RunWith(SpringRunner.class)
@SpringBootTest
public class BigsysAuthSpringbootApplicationTests {
@Resource
private UserService userService;
@Test
public void contextLoads() {
for (int i = 0; i < 100; i++) {
User user = new User();
user.setName("jkakdf");
user.setPhone("faskdjfa");
userService.addOrUpdate(user);
}
}
}
# 数据库驱动jar 路径
drive.class.path=/Users/fangzhipeng/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar
# 数据库连接参数
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/bigsys?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
jdbc.username=root
jdbc.password=root
# 包路径配置
model.package=com.bigsys.auth.project.db.model
dao.package=com.bigsys.auth.project.db.dao
xml.mapper.package=com.bigsys.auth.project.db.dao
target.project=src/main/java
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<!-- 配置Run As Maven build : Goals 参数 : mybatis-generator:generate -Dmybatis.generator.overwrite=true -->
<!-- 配置 tableName,使用 Run As Maven build 生成 service model 层 -->
<generatorConfiguration>
<!-- 配置文件路径 -->
<properties url="${mybatis.generator.generatorConfig.properties}"/>
<!--数据库驱动包路径 -->
<classPathEntry location="${drive.class.path}"/>
<context id="DB2Tables" targetRuntime="MyBatis3">
<!--关闭注释 -->
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--数据库连接信息 -->
<jdbcConnection driverClass="${jdbc.driver}" connectionURL="${jdbc.url}" userId="${jdbc.username}"
password="${jdbc.password}">
</jdbcConnection>
<!--生成的model 包路径 -->
<javaModelGenerator targetPackage="${model.package}" targetProject="${target.project}">
<property name="enableSubPackages" value="ture"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!--生成xml mapper文件 路径 -->
<sqlMapGenerator targetPackage="${xml.mapper.package}" targetProject="${target.project}">
<property name="enableSubPackages" value="ture"/>
</sqlMapGenerator>
<!-- 生成的Dao接口 的包路径 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="${dao.package}" targetProject="${target.project}">
<property name="enableSubPackages" value="ture"/>
</javaClientGenerator>
<!--对应数据库表名 -->
<!-- <table tableName="rt_upload_stop_info" domainObjectName="UploadStopInfo" >
<columnOverride column="recordTime" javaType="String"></columnOverride>
</table> -->
<!--<table tableName="bigsys_app_info" domainObjectName="AppInfo">-->
<!--</table>-->
<!--<table tableName="bigsys_user" domainObjectName="User">-->
<!--<property name="useActualColumnNames" value="true"/>-->
<!--</table>-->
<!--<table tableName="bigsys_user_role" domainObjectName="UserRole">-->
<!--<property name="useActualColumnNames" value="true"/>-->
<!--</table>-->
<!--<table tableName="bigsys_role_menu" domainObjectName="RoleMenu">-->
<!--<property name="useActualColumnNames" value="true"/>-->
<!--</table>-->
<!--<table tableName="sub_line" domainObjectName="SubLine">-->
<!--<property name="useActualColumnNames" value="true"/>-->
<!--<columnOverride column="createTime" javaType="String"></columnOverride>-->
<!--<columnOverride column="lastModifyTime" javaType="String"></columnOverride>-->
<!--<columnOverride column="publishTime" javaType="String"></columnOverride>-->
<!--<columnOverride column="snapshotTime" javaType="String"></columnOverride>-->
<!--</table>-->
<!--<table tableName="base_stop" domainObjectName="BaseStop">-->
<!--<property name="useActualColumnNames" value="true"/>-->
<!--</table>-->
<!--
<table tableName="daba_demand" domainObjectName="DabaDemand">
</table> -->
<!--<table tableName="line_promotion" domainObjectName="LinePromotion">-->
<!--<property name="useActualColumnNames" value="true"/>-->
<!--</table> -->
<!--<table tableName="daba_inf_line" domainObjectName="DabaInfLine">-->
<!--<property name="useActualColumnNames" value="true"/>-->
<!--<columnOverride column="publishTime" javaType="String"></columnOverride>-->
<!--</table>-->
</context>
</generatorConfiguration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.paul0523</groupId>
<artifactId>baseframework</artifactId>
<version>1.0-SNAPSHOT</version>
<name>${artifactId}</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.jdk>1.8</project.build.jdk>
<plugin.maven-compiler>3.1</plugin.maven-compiler>
</properties>
<modules>
<module>bigsys-auth-api</module>
<module>bigsys-auth-project</module>
</modules>
<build>
<plugins>
<!--Maven编译插件 配置 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugin.maven-compiler}</version>
<configuration>
<source>${project.build.jdk}</source>
<target>${project.build.jdk}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
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