Compare commits

..

4 Commits
lh ... master

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

9
.gitattributes vendored

@ -0,0 +1,9 @@
*.md linguist-language=Java
*.yml linguist-language=Java
*.html linguist-language=Java
*.js linguist-language=Java
*.xml linguist-language=Java
*.css linguist-language=Java
*.sql linguist-language=Java
*.uml linguist-language=Java
*.cmd linguist-language=Java

1
.gitignore vendored

@ -0,0 +1 @@
/target/

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
</component>
</module>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="company-financial-management-main" />
<module name="ssm3d8m9" />
</profile>
</annotationProcessing>
</component>
</project>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/webapp/admin/dist/fonts/element-icons.535877f5.woff" charset="GBK" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>spring</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="spring-schema">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="java-output-path" value="/mybatisplus-spring-mvc/target/classes"/>
<property name="context-root" value="spring-schema"/>
</wb-module>
</project-modules>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

@ -0,0 +1,54 @@
# (VX)
> VX13033494971
####
BUG
####
Java + SSMSpring+SpringMVC+Mybatis + Vue + Mysql
####
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
###
![](photo/1.png)
![](photo/2.png)
![](photo/3.png)
![](photo/4.png)
![](photo/5.png)
![](photo/6.png)
![](photo/7.png)
![](photo/8.png)
![](photo/9.png)
![](photo/10.png)
![](photo/11.png)
![](photo/12.png)
![](photo/13.png)
### ()
- idea/eclipsejdk-1.8maven-3.8.6mysqlnodejs
##
![](photo/0-WeChat.png)
##

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

@ -0,0 +1,272 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jlwl</groupId>
<artifactId>ssm3d8m9</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>5.0.0.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<druid.version>1.1.0</druid.version>
<fastjson.version>1.2.8</fastjson.version>
<mybaitsplus.version>2.3</mybaitsplus.version>
<mysql.version>5.1.38</mysql.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.19</slf4j.version>
<aspectjweaver.version>1.8.8</aspectjweaver.version>
<fileupload.version>1.3.1</fileupload.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- AOP -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectjweaver.version}</version>
</dependency>
<!-- FileUpload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${fileupload.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Mybatis-Plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>${mybaitsplus.version}</version>
</dependency>
<!-- Mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<scope>4.0</scope>
<version>4.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.0.jre8</version>
<scope>runtime</scope>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Log -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.0.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.29</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
</dependency>
<!-- -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
</dependencies>
<build>
<!-- 访 -->
<finalName>ssm3d8m9</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin-3.1</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,100 @@
package com.interceptor;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import com.annotation.IgnoreAuth;
import com.entity.EIException;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.R;
//权限(Token)验证拦截器
// 实现HandlerInterceptor接口用于在请求到达控制器前进行Token验证
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
// 定义Token在请求头中的key
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired
private TokenService tokenService; // 注入Token服务
// 预处理方法,在控制器方法执行前调用
// @param request HTTP请求对象
// @param response HTTP响应对象
// @param handler 目标处理器
// @return 验证通过返回true否则返回false
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 设置跨域请求支持
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
// 检查是否有IgnoreAuth注解不需要权限验证的注解
IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
// 获取方法上的IgnoreAuth注解
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true; // 如果不是Controller方法直接放行
}
// 从请求头中获取Token
String token = request.getHeader(LOGIN_TOKEN_KEY);
// 如果方法上有IgnoreAuth注解直接放行
if(annotation != null) {
return true;
}
// Token验证逻辑
TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
// 通过TokenService获取Token实体
tokenEntity = tokenService.getTokenEntity(token);
}
// 如果Token有效将用户信息存入session
if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true; // 验证通过
}
// Token无效时的处理
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
try {
writer = response.getWriter();
// 返回401未授权错误
writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
} finally {
if(writer != null){
writer.close(); // 关闭输出流
}
}
return false; // 拦截请求
}
}

@ -0,0 +1,46 @@
package com.model.enums;
import java.io.Serializable;
import com.baomidou.mybatisplus.enums.IEnum;
//必须现在 IEnum 配置 该包扫描自动注入,查看文件 spring-mybatis.xml 参数 typeEnumsPackage
//此枚举类用于表示某种状态的类型,实现了 MyBatis-Plus 的 IEnum 接口,
//可以方便地在 MyBatis-Plus 中使用枚举类型进行数据库操作。
public enum TypeEnum implements IEnum {
// 定义枚举常量,表示禁用状态,值为 0描述为 "禁用"
DISABLED(0, "禁用"),
// 定义枚举常量,表示正常状态,值为 1描述为 "正常"
NORMAL(1, "正常");
// 枚举常量对应的值,用于在数据库中存储
private final int value;
// 枚举常量的描述信息,用于显示给用户
private final String desc;
// 枚举的构造函数,用于初始化枚举常量的值和描述信息
// @param value 枚举常量对应的值
//@param desc 枚举常量的描述信息
TypeEnum(final int value, final String desc) {
this.value = value;
this.desc = desc;
}
//实现 IEnum 接口的方法,用于获取枚举常量对应的值
// @return 枚举常量对应的值
@Override
public Serializable getValue() {
return this.value;
}
// 获取枚举常量的描述信息,添加此方法可能是为了在使用 Jackson 序列化时,
//通过 @JsonValue 注解返回中文描述信息
//@return 枚举常量的描述信息
public String getDesc() {
return this.desc;
}
}

@ -0,0 +1,25 @@
package com.utils;
import cn.hutool.crypto.digest.DigestUtil;
//MD5Util 类是一个工具类,主要提供了使用 MD5 算法对字符串进行加密的功能。
// MD5 是一种广泛使用的哈希算法,用于生成数据的固定长度哈希值。
// 这里使用了 Hutool 工具包中的 DigestUtil 类来实现 MD5 加密。
public class MD5Util {
// 对输入的明文进行 MD5 加密。
//@param text 待加密的明文。该参数为要进行 MD5 加密的原始字符串。
// @return 加密后的密文。返回一个长度为 32 位的十六进制字符串,代表输入明文的 MD5 哈希值。
// 如果输入为 null 或空字符串,也会进行加密处理并返回相应的结果。
//注意:该方法原本注释中有 `key` 参数,但实际代码中未使用,
// 仅对输入的 `text` 进行了 MD5 加密,并非带密钥的加密方式。
//真正的带密钥加密通常需要将密钥与明文进行特定的组合后再进行哈希计算。
public static String md5(String text) {
// 调用 Hutool 工具包中的 DigestUtil 类的 md5Hex 方法对输入的 text 进行 MD5 加密,
// 并将加密结果以十六进制字符串的形式返回。
String md5str = DigestUtil.md5Hex(text);
return md5str;
}
}

@ -0,0 +1,282 @@
package com.utils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.mapper.Wrapper;
//Mybatis-Plus工具类提供了一系列用于Mybatis-Plus查询条件构造和字符串格式转换的工具方法。
public class MPUtil {
// 定义下划线字符常量,用于驼峰转下划线操作
public static final char UNDERLINE = '_';
// 将Java Bean转换为Map并将Map中的键从驼峰格式转换为下划线格式同时添加前缀。
// @param bean 要转换的Java Bean对象
//@param pre 要添加的前缀,可用于指定表别名等
// @return 转换后的Map键为下划线格式且带有前缀
public static Map allEQMapPre(Object bean, String pre) {
// 使用Hutool的BeanUtil将Java Bean转换为Map
Map<String, Object> map = BeanUtil.beanToMap(bean);
// 调用camelToUnderlineMap方法将Map中的键从驼峰格式转换为下划线格式并添加前缀
return camelToUnderlineMap(map, pre);
}
// 将Java Bean转换为Map并将Map中的键从驼峰格式转换为下划线格式。
// @param bean 要转换的Java Bean对象
//@return 转换后的Map键为下划线格式
public static Map allEQMap(Object bean) {
// 使用Hutool的BeanUtil将Java Bean转换为Map
Map<String, Object> map = BeanUtil.beanToMap(bean);
// 调用camelToUnderlineMap方法将Map中的键从驼峰格式转换为下划线格式不添加前缀
return camelToUnderlineMap(map, "");
}
// 为Wrapper对象添加模糊查询条件将Java Bean转换为Map键转换为下划线格式并添加前缀。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param bean 包含查询条件的Java Bean对象
//@param pre 要添加的前缀,可用于指定表别名等
// @return 添加了模糊查询条件的Wrapper对象
public static Wrapper allLikePre(Wrapper wrapper, Object bean, String pre) {
// 使用Hutool的BeanUtil将Java Bean转换为Map
Map<String, Object> map = BeanUtil.beanToMap(bean);
// 调用camelToUnderlineMap方法将Map中的键从驼峰格式转换为下划线格式并添加前缀
Map result = camelToUnderlineMap(map, pre);
// 调用genLike方法为Wrapper对象添加模糊查询条件
return genLike(wrapper, result);
}
// 为Wrapper对象添加模糊查询条件将Java Bean转换为Map。
//@param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param bean 包含查询条件的Java Bean对象
// @return 添加了模糊查询条件的Wrapper对象
public static Wrapper allLike(Wrapper wrapper, Object bean) {
// 使用Hutool的BeanUtil将Java Bean转换为Map忽略空值和默认值
Map result = BeanUtil.beanToMap(bean, true, true);
// 调用genLike方法为Wrapper对象添加模糊查询条件
return genLike(wrapper, result);
}
// 为Wrapper对象添加模糊查询条件。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param param 包含查询条件的Map键为字段名值为查询值
//@return 添加了模糊查询条件的Wrapper对象
public static Wrapper genLike(Wrapper wrapper, Map param) {
// 获取Map的迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i = 0;
while (it.hasNext()) {
if (i > 0) {
// 如果不是第一个条件添加and连接符
wrapper.and();
}
// 获取Map中的键值对
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String value = (String) entry.getValue();
// 为Wrapper对象添加模糊查询条件
wrapper.like(key, value);
i++;
}
return wrapper;
}
//为Wrapper对象添加模糊查询或等值查询条件将Java Bean转换为Map。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
//@param bean 包含查询条件的Java Bean对象
//@return 添加了模糊查询或等值查询条件的Wrapper对象
public static Wrapper likeOrEq(Wrapper wrapper, Object bean) {
// 使用Hutool的BeanUtil将Java Bean转换为Map忽略空值和默认值
Map result = BeanUtil.beanToMap(bean, true, true);
// 调用genLikeOrEq方法为Wrapper对象添加模糊查询或等值查询条件
return genLikeOrEq(wrapper, result);
}
// 为Wrapper对象添加模糊查询或等值查询条件。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param param 包含查询条件的Map键为字段名值为查询值
// @return 添加了模糊查询或等值查询条件的Wrapper对象
public static Wrapper genLikeOrEq(Wrapper wrapper, Map param) {
// 获取Map的迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i = 0;
while (it.hasNext()) {
if (i > 0) {
// 如果不是第一个条件添加and连接符
wrapper.and();
}
// 获取Map中的键值对
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
if (entry.getValue().toString().contains("%")) {
// 如果值包含%,则添加模糊查询条件,去除%
wrapper.like(key, entry.getValue().toString().replace("%", ""));
} else {
// 否则添加等值查询条件
wrapper.eq(key, entry.getValue());
}
i++;
}
return wrapper;
}
// 为Wrapper对象添加等值查询条件将Java Bean转换为Map。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param bean 包含查询条件的Java Bean对象
// @return 添加了等值查询条件的Wrapper对象
public static Wrapper allEq(Wrapper wrapper, Object bean) {
// 使用Hutool的BeanUtil将Java Bean转换为Map忽略空值和默认值
Map result = BeanUtil.beanToMap(bean, true, true);
// 调用genEq方法为Wrapper对象添加等值查询条件
return genEq(wrapper, result);
}
// 为Wrapper对象添加等值查询条件。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param param 包含查询条件的Map键为字段名值为查询值
// @return 添加了等值查询条件的Wrapper对象
public static Wrapper genEq(Wrapper wrapper, Map param) {
// 获取Map的迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i = 0;
while (it.hasNext()) {
if (i > 0) {
// 如果不是第一个条件添加and连接符
wrapper.and();
}
// 获取Map中的键值对
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
// 为Wrapper对象添加等值查询条件
wrapper.eq(key, entry.getValue());
i++;
}
return wrapper;
}
// 为Wrapper对象添加范围查询条件。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param params 包含范围查询条件的Map键为字段名_start或字段名_end值为查询范围
// @return 添加了范围查询条件的Wrapper对象
public static Wrapper between(Wrapper wrapper, Map<String, Object> params) {
for (String key : params.keySet()) {
String columnName = "";
if (key.endsWith("_start")) {
// 处理以_start结尾的键获取字段名
columnName = key.substring(0, key.indexOf("_start"));
if (StringUtils.isNotBlank(params.get(key).toString())) {
// 如果值不为空,添加大于等于查询条件
wrapper.ge(columnName, params.get(key));
}
}
if (key.endsWith("_end")) {
// 处理以_end结尾的键获取字段名
columnName = key.substring(0, key.indexOf("_end"));
if (StringUtils.isNotBlank(params.get(key).toString())) {
// 如果值不为空,添加小于等于查询条件
wrapper.le(columnName, params.get(key));
}
}
}
return wrapper;
}
//为Wrapper对象添加排序条件。
// @param wrapper Mybatis-Plus的Wrapper对象用于构造查询条件
// @param params 包含排序条件的Map键为order排序方式asc或desc和sort排序字段
//@return 添加了排序条件的Wrapper对象
public static Wrapper sort(Wrapper wrapper, Map<String, Object> params) {
String order = "";
if (params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) {
// 获取排序方式
order = params.get("order").toString();
}
if (params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) {
if (order.equalsIgnoreCase("desc")) {
// 如果排序方式为desc添加降序排序条件
wrapper.orderDesc(Arrays.asList(params.get("sort")));
} else {
// 否则添加升序排序条件
wrapper.orderAsc(Arrays.asList(params.get("sort")));
}
}
return wrapper;
}
// 将驼峰格式的字符串转换为下划线格式的字符串。
// @param param 要转换的驼峰格式字符串
// @return 转换后的下划线格式字符串
public static String camelToUnderline(String param) {
if (param == null || "".equals(param.trim())) {
return "";
}
int len = param.length();
StringBuilder sb = new StringBuilder(len);
for (int i = 0; i < len; i++) {
char c = param.charAt(i);
if (Character.isUpperCase(c)) {
// 如果是大写字母,添加下划线并转换为小写字母
sb.append(UNDERLINE);
sb.append(Character.toLowerCase(c));
} else {
// 否则直接添加字符
sb.append(c);
}
}
return sb.toString();
}
// 测试驼峰转下划线方法。
//@param ages 命令行参数
public static void main(String[] ages) {
// 测试驼峰转下划线方法
System.out.println(camelToUnderline("ABCddfANM"));
}
//将Map中的键从驼峰格式转换为下划线格式并添加前缀。
//@param param 要转换的Map
// @param pre 要添加的前缀,可用于指定表别名等
// @return 转换后的Map键为下划线格式且带有前缀
public static Map camelToUnderlineMap(Map param, String pre) {
Map<String, Object> newMap = new HashMap<String, Object>();
// 获取Map的迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
// 获取Map中的键值对
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
// 将键从驼峰格式转换为下划线格式
String newKey = camelToUnderline(key);
if (pre.endsWith(".")) {
// 如果前缀以.结尾,直接添加前缀和新键
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
// 如果前缀为空,直接添加新键
newMap.put(newKey, entry.getValue());
} else {
// 否则添加前缀.和新键
newMap.put(pre + "." + newKey, entry.getValue());
}
}
return newMap;
}
}

@ -0,0 +1,118 @@
package com.utils;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.Page;
// 分页工具类,用于封装分页相关的信息,方便在业务层和展示层之间传递分页数据。
// 实现了Serializable接口以便该类的实例可以在网络传输或存储到文件等场景中使用。
public class PageUtils implements Serializable {
// 序列化版本号,用于确保不同版本的类在反序列化时的兼容性
private static final long serialVersionUID = 1L;
// 总记录数,即满足查询条件的所有记录的数量
private long total;
// 每页记录数,指定每页显示的记录数量
private int pageSize;
// 总页数,根据总记录数和每页记录数计算得出的总页数
private long totalPage;
// 当前页数,标识当前请求的是第几页数据
private int currPage;
// 列表数据,包含当前页的具体数据记录
private List<?> list;
// 构造方法,根据提供的列表数据、总记录数、每页记录数和当前页数来初始化分页信息。
//@param list 列表数据,包含当前页的具体记录
// @param totalCount 总记录数,满足查询条件的所有记录的数量
//@param pageSize 每页记录数,指定每页显示的记录数量
// @param currPage 当前页数,标识当前请求的是第几页数据
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.total = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
// 使用Math.ceil方法向上取整计算总页数确保总页数能够覆盖所有记录
this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
}
// 构造方法根据MyBatis-Plus的Page对象来初始化分页信息。
// @param page MyBatis-Plus的Page对象包含了分页相关的各种信息
public PageUtils(Page<?> page) {
// 从Page对象中获取当前页的记录列表
this.list = page.getRecords();
// 从Page对象中获取总记录数
this.total = page.getTotal();
// 从Page对象中获取每页记录数
this.pageSize = page.getSize();
// 从Page对象中获取当前页数
this.currPage = page.getCurrent();
// 从Page对象中获取总页数
this.totalPage = page.getPages();
}
// 构造方法根据传入的参数Map来初始化分页信息。
//该方法先通过Query工具类根据参数生成Page对象再调用另一个构造方法初始化分页信息。
//@param params 包含分页相关参数的Map例如页码、每页数量等
public PageUtils(Map<String, Object> params) {
// 通过Query工具类根据参数生成Page对象
Page page = new Query(params).getPage();
// 调用另一个构造方法根据生成的Page对象初始化分页信息
new PageUtils(page);
}
// 获取每页记录数的方法
public int getPageSize() {
return pageSize;
}
// 设置每页记录数的方法
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
// 获取当前页数的方法
public int getCurrPage() {
return currPage;
}
// 设置当前页数的方法
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
// 获取列表数据的方法
public List<?> getList() {
return list;
}
// 设置列表数据的方法
public void setList(List<?> list) {
this.list = list;
}
// 获取总页数的方法
public long getTotalPage() {
return totalPage;
}
// 设置总页数的方法
public void setTotalPage(long totalPage) {
this.totalPage = totalPage;
}
// 获取总记录数的方法
public long getTotal() {
return total;
}
// 设置总记录数的方法
public void setTotal(long total) {
this.total = total;
}
}

@ -0,0 +1,120 @@
package com.utils;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.plugins.Page;
// 查询参数类继承自LinkedHashMap<String, Object>
// 用于封装查询相关的参数,如分页参数、排序参数等,并提供了一些方法来处理这些参数,
// 以适配MyBatis-Plus的分页和排序功能。
public class Query<T> extends LinkedHashMap<String, Object> {
// 序列化版本号,用于确保不同版本的类在反序列化时的兼容性
private static final long serialVersionUID = 1L;
// mybatis-plus分页参数用于封装MyBatis-Plus的分页信息如当前页码、每页条数等。
private Page<T> page;
// 当前页码默认值为1表示第一页。
private int currPage = 1;
//每页条数默认值为10表示每页显示10条记录。
private int limit = 10;
// 构造方法根据JQPageInfo对象来初始化查询参数。
// @param pageInfo 包含分页和排序信息的JQPageInfo对象。
public Query(JQPageInfo pageInfo) {
// 分页参数处理
// 如果JQPageInfo中存在页码信息则更新当前页码
if (pageInfo.getPage() != null) {
currPage = pageInfo.getPage();
}
// 如果JQPageInfo中存在每页条数信息则更新每页条数
if (pageInfo.getLimit() != null) {
limit = pageInfo.getLimit();
}
// 防止SQL注入
// 对排序字段sidx和排序方式order进行SQL注入过滤
String sidx = SQLFilter.sqlInject(pageInfo.getSidx());
String order = SQLFilter.sqlInject(pageInfo.getOrder());
// mybatis-plus分页
// 创建MyBatis-Plus的Page对象传入当前页码和每页条数
this.page = new Page<>(currPage, limit);
// 排序处理
// 如果排序字段和排序方式都不为空则设置MyBatis-Plus的Page对象的排序信息
if (StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)) {
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
// 构造方法根据传入的参数Map来初始化查询参数。
//@param params 包含查询参数的Map如page页码、limit每页条数、sidx排序字段、order排序方式等。
public Query(Map<String, Object> params) {
// 将传入的参数Map中的所有键值对放入当前对象中
this.putAll(params);
// 分页参数处理
// 如果参数Map中存在页码信息则更新当前页码
if (params.get("page") != null) {
currPage = Integer.parseInt((String) params.get("page"));
}
// 如果参数Map中存在每页条数信息则更新每页条数
if (params.get("limit") != null) {
limit = Integer.parseInt((String) params.get("limit"));
}
// 计算偏移量offset即当前页数据在总数据中的起始位置
this.put("offset", (currPage - 1) * limit);
// 将当前页码和每页条数重新放入参数Map中以便其他地方使用
this.put("page", currPage);
this.put("limit", limit);
// 防止SQL注入
// 对排序字段sidx和排序方式order进行SQL注入过滤
String sidx = SQLFilter.sqlInject((String) params.get("sidx"));
String order = SQLFilter.sqlInject((String) params.get("order"));
// 将过滤后的排序字段和排序方式重新放入参数Map中
this.put("sidx", sidx);
this.put("order", order);
// mybatis-plus分页
// 创建MyBatis-Plus的Page对象传入当前页码和每页条数
this.page = new Page<>(currPage, limit);
// 排序处理
// 如果排序字段和排序方式都不为空则设置MyBatis-Plus的Page对象的排序信息
if (StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)) {
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
//获取MyBatis-Plus的Page对象包含分页和排序信息。
// @return MyBatis-Plus的Page对象。
public Page<T> getPage() {
return page;
}
//获取当前页码。
// @return 当前页码。
public int getCurrPage() {
return currPage;
}
// 获取每页条数。
// @return 每页条数。
public int getLimit() {
return limit;
}
}

@ -0,0 +1,83 @@
package com.utils;
import java.util.HashMap;
import java.util.Map;
//返回数据类继承自HashMap<String, Object>
// 用于封装和返回业务处理的结果数据,通常用于前后端交互时返回响应信息。
public class R extends HashMap<String, Object> {
// 序列化版本号,用于确保不同版本的类在反序列化时的兼容性
private static final long serialVersionUID = 1L;
//构造方法初始化一个R对象并设置默认的返回码为0通常表示成功
public R() {
put("code", 0);
}
//静态方法返回一个表示错误的R对象错误码为500错误信息为“未知异常请联系管理员”。
// @return 表示错误的R对象。
public static R error() {
return error(500, "未知异常,请联系管理员");
}
// 静态方法返回一个表示错误的R对象错误码为500错误信息为传入的msg。
// @param msg 错误信息。
// @return 表示错误的R对象。
public static R error(String msg) {
return error(500, msg);
}
// 静态方法返回一个表示错误的R对象错误码为传入的code错误信息为传入的msg。
// @param code 错误码。
//@param msg 错误信息。
//@return 表示错误的R对象。
public static R error(int code, String msg) {
R r = new R();
r.put("code", code);
r.put("msg", msg);
return r;
}
// 静态方法返回一个表示成功的R对象包含传入的成功提示信息msg。
// @param msg 成功提示信息。
// @return 表示成功的R对象。
public static R ok(String msg) {
R r = new R();
r.put("msg", msg);
return r;
}
//静态方法返回一个表示成功的R对象将传入的map中的键值对添加到R对象中。
//@param map 包含数据的Map对象。
// @return 表示成功的R对象。
public static R ok(Map<String, Object> map) {
R r = new R();
r.putAll(map);
return r;
}
// 静态方法返回一个表示成功的R对象只包含默认的返回码0。
//@return 表示成功的R对象。
public static R ok() {
return new R();
}
//重写put方法将键值对添加到R对象中并返回当前R对象
// 支持链式调用,方便连续添加多个键值对。
// @param key 键。
// @param value 值。
// @return 当前R对象。
public R put(String key, Object value) {
super.put(key, value);
return this;
}
}

@ -0,0 +1,50 @@
package com.utils;
import org.apache.commons.lang3.StringUtils;
import com.entity.EIException;
//SQL过滤类用于对输入的字符串进行SQL注入风险的检查和过滤
// 以增强应用程序的安全性防止恶意用户通过SQL注入攻击数据库。
public class SQLFilter {
// SQL注入过滤方法对传入的字符串进行检查和处理
//去除可能导致SQL注入的危险字符并检查是否包含非法的SQL关键字。
// @param str 待验证的字符串通常是用户输入的内容可能用于构建SQL语句。
// @return 经过处理后的字符串如果字符串为空则返回null
// 如果字符串包含非法字符则抛出EIException异常。
public static String sqlInject(String str) {
// 判断字符串是否为空或空白字符串如果是则直接返回null
if (StringUtils.isBlank(str)) {
return null;
}
// 去掉字符串中的单引号(')、双引号(")、分号(;)和反斜杠(\)
// 这些字符在SQL语句中可能被用于构造恶意的SQL注入语句。
str = StringUtils.replace(str, "'", "");
str = StringUtils.replace(str, "\"", "");
str = StringUtils.replace(str, ";", "");
str = StringUtils.replace(str, "\\", "");
// 将字符串转换为小写,以便统一检查非法关键字,
// 因为SQL关键字不区分大小写转换为小写后可以更方便地进行比较。
str = str.toLowerCase();
// 定义一个包含常见非法SQL关键字的数组这些关键字可能被用于恶意的SQL操作
// 如删除数据delete、修改数据update、创建或修改表结构alter、drop等。
String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"};
// 遍历非法关键字数组,检查字符串中是否包含这些关键字。
// 如果包含则认为该字符串存在SQL注入风险抛出EIException异常。
for (String keyword : keywords) {
if (str.indexOf(keyword) != -1) {
throw new EIException("包含非法字符");
}
}
// 如果字符串经过上述处理后没有发现非法字符,则返回处理后的字符串。
return str;
}
}

@ -0,0 +1,71 @@
package com.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
//Spring Context 工具类,实现了 ApplicationContextAware 接口,
// 用于在非 Spring 管理的类中获取 Spring 应用上下文ApplicationContext
//从而可以方便地获取 Spring 容器中管理的 Bean。
@Component
public class SpringContextUtils implements ApplicationContextAware {
// 静态变量,用于存储 Spring 应用上下文
public static ApplicationContext applicationContext;
//实现 ApplicationContextAware 接口的方法,当 Spring 容器初始化完成后,
// 会自动调用该方法并传入 ApplicationContext 实例,将其赋值给静态变量。
// @param applicationContext Spring 应用上下文实例
// @throws BeansException 如果在设置应用上下文时出现 Bean 相关的异常
@Override
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
SpringContextUtils.applicationContext = applicationContext;
}
// 根据 Bean 的名称从 Spring 容器中获取对应的 Bean 实例。
// @param name Bean 的名称
// @return 对应的 Bean 实例
public static Object getBean(String name) {
return applicationContext.getBean(name);
}
// 根据 Bean 的名称和类型从 Spring 容器中获取对应的 Bean 实例,
// 并将其转换为指定的类型。
// @param name Bean 的名称
// @param requiredType 所需 Bean 的类型
// @param <T> 泛型类型
// @return 对应的 Bean 实例
public static <T> T getBean(String name, Class<T> requiredType) {
return applicationContext.getBean(name, requiredType);
}
//检查 Spring 容器中是否包含指定名称的 Bean。
// @param name Bean 的名称
// @return 如果包含则返回 true否则返回 false
public static boolean containsBean(String name) {
return applicationContext.containsBean(name);
}
// 检查指定名称的 Bean 在 Spring 容器中是否为单例模式。
//@param name Bean 的名称
//@return 如果是单例则返回 true否则返回 false
public static boolean isSingleton(String name) {
return applicationContext.isSingleton(name);
}
// 获取指定名称的 Bean 在 Spring 容器中的类型。
//@param name Bean 的名称
//@return Bean 的类型
public static Class<? extends Object> getType(String name) {
return applicationContext.getType(name);
}
}

@ -0,0 +1,44 @@
package com.utils;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import com.entity.EIException;
// hibernate-validator校验工具类用于利用Hibernate Validator框架
// 对对象进行验证,检查对象的属性是否符合预先定义的验证规则。
public class ValidatorUtils {
// 静态变量用于存储Validator实例该实例用于执行验证操作
private static Validator validator;
// 静态代码块在类加载时执行初始化Validator实例
static {
// 通过Validation.buildDefaultValidatorFactory()获取默认的验证工厂,
// 然后调用其getValidator()方法获取Validator实例
validator = Validation.buildDefaultValidatorFactory().getValidator();
}
//校验对象的方法,根据传入的对象和验证组对对象进行验证。
// @param object 待校验的对象,该对象的属性应使用合适的验证注解进行标注。
// @param groups 待校验的组指定了要应用的验证规则组可以传入多个Class对象表示不同的组。
// @throws EIException 如果校验不通过即存在约束违反ConstraintViolation
// 则抛出EIException异常并将第一个约束违反的错误信息作为异常消息。
public static void validateEntity(Object object, Class<?>... groups)
throws EIException {
// 调用Validator的validate方法对对象进行验证传入对象和验证组
// 该方法返回一个包含所有约束违反的Set集合
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(object, groups);
// 判断约束违反的Set集合是否为空如果不为空说明对象的属性存在不符合验证规则的情况
if (!constraintViolations.isEmpty()) {
// 获取第一个约束违反的实例
ConstraintViolation<Object> constraint = (ConstraintViolation<Object>) constraintViolations.iterator().next();
// 抛出EIException异常并将约束违反的错误信息作为异常消息
throw new EIException(constraint.getMessage());
}
}
}

@ -0,0 +1,10 @@
validationQuery=SELECT 1
jdbc_url=jdbc:mysql://127.0.0.1:3306/ssm3d8m9?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false
jdbc_username=root
jdbc_password=root
#jdbc_url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ssm3d8m9
#jdbc_username=sa
#jdbc_password=123456

@ -0,0 +1,41 @@
/*
Navicat Premium Data Transfer
Source Server : mysql-localhost
Source Server Type : MySQL
Source Server Version : 50616
Source Host : localhost
Source Database : mybatis-plus
Target Server Type : MySQL
Target Server Version : 50616
File Encoding : utf-8
Date: 06/25/2017 20:53:49 PM
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`name` varchar(50) DEFAULT NULL COMMENT '',
`age` int(3) DEFAULT NULL COMMENT '',
`type` int(1) DEFAULT '0' COMMENT '0 1, 使tinyint(1)mysqltinyInt1isBit=falsemysqlboolean',
`ctime` datetime DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='';
-- ----------------------------
-- Records of `sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user`(id,name,age,ctime,type) VALUES ('784972358981328902', 'Tom', '24', '2017-06-25 20:53:33', '1');
INSERT INTO `sys_user`(id,name,age,ctime,type) VALUES ('784972358981328903', 'Jammy', '21', '2017-06-25 20:53:37', '1');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

@ -0,0 +1,19 @@
log4j.rootLogger=INFO,CONSOLE,A
log4j.addivity.org.apache=false
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} -%-4r [%t] %-5p %x - %m%n
log4j.appender.CONSOLE.Target=System.out
#log4j.appender.CONSOLE.charset=utf-8
log4j.appender.CONSOLE.encoding=utf-8
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.A=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A.File=${catalina.home}/logs/yo_log/PurePro_
log4j.appender.A.DatePattern=yyyy-MM-dd'.log'
log4j.appender.A.layout=org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern=[FH_sys] %d{yyyy-MM-dd HH\:mm\:ss} %5p %c{1}\:%L \: %m%n
log4j.logger.java.sql.ResultSet=INFO
log4j.logger.org.apache=INFO
log4j.logger.java.sql.Connection=INFO
log4j.logger.java.sql.Statement=INFO
log4j.logger.java.sql.PreparedStatement=INFO

@ -0,0 +1,36 @@
<?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.dao.BumenfenleiDao">
<!-- 使 -->
<resultMap type="com.entity.BumenfenleiEntity" id="bumenfenleiMap">
<result property="leixing" column="leixing"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.BumenfenleiVO" >
SELECT * FROM bumenfenlei bumenfenlei
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.BumenfenleiVO" >
SELECT bumenfenlei.* FROM bumenfenlei bumenfenlei
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.BumenfenleiView" >
SELECT bumenfenlei.* FROM bumenfenlei bumenfenlei
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.BumenfenleiView" >
SELECT * FROM bumenfenlei bumenfenlei <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,42 @@
<?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.dao.ChengbenjieyuDao">
<!-- 使 -->
<resultMap type="com.entity.ChengbenjieyuEntity" id="chengbenjieyuMap">
<result property="chengbenmingcheng" column="chengbenmingcheng"/>
<result property="shouruxiangmu" column="shouruxiangmu"/>
<result property="shourujine" column="shourujine"/>
<result property="zhichuxiangmu" column="zhichuxiangmu"/>
<result property="zhichujine" column="zhichujine"/>
<result property="jieyujine" column="jieyujine"/>
<result property="riqi" column="riqi"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.ChengbenjieyuVO" >
SELECT * FROM chengbenjieyu chengbenjieyu
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.ChengbenjieyuVO" >
SELECT chengbenjieyu.* FROM chengbenjieyu chengbenjieyu
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.ChengbenjieyuView" >
SELECT chengbenjieyu.* FROM chengbenjieyu chengbenjieyu
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.ChengbenjieyuView" >
SELECT * FROM chengbenjieyu chengbenjieyu <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,56 @@
<?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.dao.CommonDao">
<select id="getOption" resultType="String" >
SELECT distinct ${column} FROM ${table}
where ${column} is not null and ${column} !=''
<if test = "level != null">
and level=#{level}
</if>
<if test = "parent != null">
and parent=#{parent}
</if>
</select>
<select id="getFollowByOption" resultType="map" >
SELECT * FROM ${table} where ${column}=#{columnValue}
</select>
<update id="sh">
UPDATE ${table} set sfsh=#{sfsh} where id=#{id}
</update>
<select id="remindCount" resultType="int" >
SELECT count(1) FROM ${table}
where 1=1
<if test = "type == 1 ">
<if test = " remindstart != null ">
and ${column} &gt;= #{remindstart}
</if>
<if test = " remindend != null ">
and ${column} &lt;= #{remindend}
</if>
</if>
<if test = "type == 2 ">
<if test = " remindstart != null ">
and ${column} &gt;= str_to_date(#{remindstart},'%Y-%m-%d')
</if>
<if test = " remindend != null ">
and ${column} &lt;= str_to_date(#{remindend},'%Y-%m-%d')
</if>
</if>
</select>
<select id="selectCal" resultType="map" >
SELECT sum(${column}) sum,max(${column}) max,min(${column}) min,avg(${column}) avg FROM ${table}
</select>
<select id="selectGroup" resultType="map" >
SELECT ${column} , count(1) total FROM ${table} group by ${column}
</select>
<select id="selectValue" resultType="map" >
SELECT ${xColumn}, sum(${yColumn}) total FROM ${table} group by ${xColumn}
</select>
</mapper>

@ -0,0 +1,5 @@
<?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.dao.ConfigDao">
</mapper>

@ -0,0 +1,43 @@
<?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.dao.FapiaoxinxiDao">
<!-- 使 -->
<resultMap type="com.entity.FapiaoxinxiEntity" id="fapiaoxinxiMap">
<result property="fapiaobianhao" column="fapiaobianhao"/>
<result property="kehuxingming" column="kehuxingming"/>
<result property="shangpinmingcheng" column="shangpinmingcheng"/>
<result property="shangpindanjia" column="shangpindanjia"/>
<result property="shangpinshuliang" column="shangpinshuliang"/>
<result property="zongjine" column="zongjine"/>
<result property="kaipiaoriqi" column="kaipiaoriqi"/>
<result property="beizhu" column="beizhu"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.FapiaoxinxiVO" >
SELECT * FROM fapiaoxinxi fapiaoxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.FapiaoxinxiVO" >
SELECT fapiaoxinxi.* FROM fapiaoxinxi fapiaoxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.FapiaoxinxiView" >
SELECT fapiaoxinxi.* FROM fapiaoxinxi fapiaoxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.FapiaoxinxiView" >
SELECT * FROM fapiaoxinxi fapiaoxinxi <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,43 @@
<?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.dao.GongyingshangxinxiDao">
<!-- 使 -->
<resultMap type="com.entity.GongyingshangxinxiEntity" id="gongyingshangxinxiMap">
<result property="gongyingshangxingming" column="gongyingshangxingming"/>
<result property="gongsimingcheng" column="gongsimingcheng"/>
<result property="gongsidizhi" column="gongsidizhi"/>
<result property="gongyingchanpin" column="gongyingchanpin"/>
<result property="lianxidianhua" column="lianxidianhua"/>
<result property="hezuoshizhang" column="hezuoshizhang"/>
<result property="beizhu" column="beizhu"/>
<result property="dengjiriqi" column="dengjiriqi"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.GongyingshangxinxiVO" >
SELECT * FROM gongyingshangxinxi gongyingshangxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.GongyingshangxinxiVO" >
SELECT gongyingshangxinxi.* FROM gongyingshangxinxi gongyingshangxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.GongyingshangxinxiView" >
SELECT gongyingshangxinxi.* FROM gongyingshangxinxi gongyingshangxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.GongyingshangxinxiView" >
SELECT * FROM gongyingshangxinxi gongyingshangxinxi <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,42 @@
<?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.dao.JizhangpingzhengDao">
<!-- 使 -->
<resultMap type="com.entity.JizhangpingzhengEntity" id="jizhangpingzhengMap">
<result property="pingzhengbianhao" column="pingzhengbianhao"/>
<result property="pingzhengmingcheng" column="pingzhengmingcheng"/>
<result property="leixing" column="leixing"/>
<result property="pingzhengneirong" column="pingzhengneirong"/>
<result property="dengjiriqi" column="dengjiriqi"/>
<result property="fujian" column="fujian"/>
<result property="beizhu" column="beizhu"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.JizhangpingzhengVO" >
SELECT * FROM jizhangpingzheng jizhangpingzheng
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.JizhangpingzhengVO" >
SELECT jizhangpingzheng.* FROM jizhangpingzheng jizhangpingzheng
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.JizhangpingzhengView" >
SELECT jizhangpingzheng.* FROM jizhangpingzheng jizhangpingzheng
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.JizhangpingzhengView" >
SELECT * FROM jizhangpingzheng jizhangpingzheng <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,43 @@
<?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.dao.KehuxinxiDao">
<!-- 使 -->
<resultMap type="com.entity.KehuxinxiEntity" id="kehuxinxiMap">
<result property="kehuxingming" column="kehuxingming"/>
<result property="gongsimingcheng" column="gongsimingcheng"/>
<result property="gongsidizhi" column="gongsidizhi"/>
<result property="hezuoxiangmu" column="hezuoxiangmu"/>
<result property="hezuoshizhang" column="hezuoshizhang"/>
<result property="lianxidianhua" column="lianxidianhua"/>
<result property="beizhu" column="beizhu"/>
<result property="dengjiriqi" column="dengjiriqi"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.KehuxinxiVO" >
SELECT * FROM kehuxinxi kehuxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.KehuxinxiVO" >
SELECT kehuxinxi.* FROM kehuxinxi kehuxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.KehuxinxiView" >
SELECT kehuxinxi.* FROM kehuxinxi kehuxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.KehuxinxiView" >
SELECT * FROM kehuxinxi kehuxinxi <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,43 @@
<?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.dao.RijizhangDao">
<!-- 使 -->
<resultMap type="com.entity.RijizhangEntity" id="rijizhangMap">
<result property="xuhao" column="xuhao"/>
<result property="riqi" column="riqi"/>
<result property="zhaiyao" column="zhaiyao"/>
<result property="shouru" column="shouru"/>
<result property="zhichu" column="zhichu"/>
<result property="jine" column="jine"/>
<result property="guanligonghao" column="guanligonghao"/>
<result property="guanlixingming" column="guanlixingming"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.RijizhangVO" >
SELECT * FROM rijizhang rijizhang
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.RijizhangVO" >
SELECT rijizhang.* FROM rijizhang rijizhang
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.RijizhangView" >
SELECT rijizhang.* FROM rijizhang rijizhang
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.RijizhangView" >
SELECT * FROM rijizhang rijizhang <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,45 @@
<?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.dao.ShangpinchukuDao">
<!-- 使 -->
<resultMap type="com.entity.ShangpinchukuEntity" id="shangpinchukuMap">
<result property="shangpinmingcheng" column="shangpinmingcheng"/>
<result property="shangpinleixing" column="shangpinleixing"/>
<result property="kehuxingming" column="kehuxingming"/>
<result property="shangpinshuliang" column="shangpinshuliang"/>
<result property="chukushijian" column="chukushijian"/>
<result property="beizhu" column="beizhu"/>
<result property="yuangonggonghao" column="yuangonggonghao"/>
<result property="yuangongxingming" column="yuangongxingming"/>
<result property="sfsh" column="sfsh"/>
<result property="shhf" column="shhf"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.ShangpinchukuVO" >
SELECT * FROM shangpinchuku shangpinchuku
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.ShangpinchukuVO" >
SELECT shangpinchuku.* FROM shangpinchuku shangpinchuku
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.ShangpinchukuView" >
SELECT shangpinchuku.* FROM shangpinchuku shangpinchuku
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.ShangpinchukuView" >
SELECT * FROM shangpinchuku shangpinchuku <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,42 @@
<?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.dao.ShangpinkucunDao">
<!-- 使 -->
<resultMap type="com.entity.ShangpinkucunEntity" id="shangpinkucunMap">
<result property="shangpinmingcheng" column="shangpinmingcheng"/>
<result property="shangpinleixing" column="shangpinleixing"/>
<result property="shangpinshuliang" column="shangpinshuliang"/>
<result property="shangpinxiangqing" column="shangpinxiangqing"/>
<result property="cunfangweizhi" column="cunfangweizhi"/>
<result property="shifouwanhao" column="shifouwanhao"/>
<result property="dengjiriqi" column="dengjiriqi"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.ShangpinkucunVO" >
SELECT * FROM shangpinkucun shangpinkucun
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.ShangpinkucunVO" >
SELECT shangpinkucun.* FROM shangpinkucun shangpinkucun
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.ShangpinkucunView" >
SELECT shangpinkucun.* FROM shangpinkucun shangpinkucun
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.ShangpinkucunView" >
SELECT * FROM shangpinkucun shangpinkucun <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,36 @@
<?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.dao.ShangpinleixingDao">
<!-- 使 -->
<resultMap type="com.entity.ShangpinleixingEntity" id="shangpinleixingMap">
<result property="leixing" column="leixing"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.ShangpinleixingVO" >
SELECT * FROM shangpinleixing shangpinleixing
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.ShangpinleixingVO" >
SELECT shangpinleixing.* FROM shangpinleixing shangpinleixing
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.ShangpinleixingView" >
SELECT shangpinleixing.* FROM shangpinleixing shangpinleixing
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.ShangpinleixingView" >
SELECT * FROM shangpinleixing shangpinleixing <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,46 @@
<?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.dao.ShangpinrukuDao">
<!-- 使 -->
<resultMap type="com.entity.ShangpinrukuEntity" id="shangpinrukuMap">
<result property="shangpinmingcheng" column="shangpinmingcheng"/>
<result property="shangpinleixing" column="shangpinleixing"/>
<result property="gongyingshangxingming" column="gongyingshangxingming"/>
<result property="shangpinshuliang" column="shangpinshuliang"/>
<result property="rukushijian" column="rukushijian"/>
<result property="shifouwanhao" column="shifouwanhao"/>
<result property="beizhu" column="beizhu"/>
<result property="yuangonggonghao" column="yuangonggonghao"/>
<result property="yuangongxingming" column="yuangongxingming"/>
<result property="sfsh" column="sfsh"/>
<result property="shhf" column="shhf"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.ShangpinrukuVO" >
SELECT * FROM shangpinruku shangpinruku
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.ShangpinrukuVO" >
SELECT shangpinruku.* FROM shangpinruku shangpinruku
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.ShangpinrukuView" >
SELECT shangpinruku.* FROM shangpinruku shangpinruku
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.ShangpinrukuView" >
SELECT * FROM shangpinruku shangpinruku <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,13 @@
<?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.dao.TokenDao">
<select id="selectListView"
resultType="com.entity.TokenEntity" >
SELECT t.* FROM token t
<where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,13 @@
<?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.dao.UserDao">
<select id="selectListView"
resultType="com.entity.UserEntity" >
SELECT u.* FROM users u
<where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,43 @@
<?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.dao.YuangongDao">
<!-- 使 -->
<resultMap type="com.entity.YuangongEntity" id="yuangongMap">
<result property="yuangonggonghao" column="yuangonggonghao"/>
<result property="mima" column="mima"/>
<result property="yuangongxingming" column="yuangongxingming"/>
<result property="xingbie" column="xingbie"/>
<result property="bumen" column="bumen"/>
<result property="shouji" column="shouji"/>
<result property="youxiang" column="youxiang"/>
<result property="shenfenzheng" column="shenfenzheng"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.YuangongVO" >
SELECT * FROM yuangong yuangong
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.YuangongVO" >
SELECT yuangong.* FROM yuangong yuangong
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.YuangongView" >
SELECT yuangong.* FROM yuangong yuangong
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.YuangongView" >
SELECT * FROM yuangong yuangong <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,44 @@
<?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.dao.YuangongbaoxiaoDao">
<!-- 使 -->
<resultMap type="com.entity.YuangongbaoxiaoEntity" id="yuangongbaoxiaoMap">
<result property="yuangonggonghao" column="yuangonggonghao"/>
<result property="yuangongxingming" column="yuangongxingming"/>
<result property="baoxiaoxiangmu" column="baoxiaoxiangmu"/>
<result property="baoxiaojine" column="baoxiaojine"/>
<result property="shenqingriqi" column="shenqingriqi"/>
<result property="beizhu" column="beizhu"/>
<result property="guanligonghao" column="guanligonghao"/>
<result property="guanlixingming" column="guanlixingming"/>
<result property="ispay" column="ispay"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.YuangongbaoxiaoVO" >
SELECT * FROM yuangongbaoxiao yuangongbaoxiao
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.YuangongbaoxiaoVO" >
SELECT yuangongbaoxiao.* FROM yuangongbaoxiao yuangongbaoxiao
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.YuangongbaoxiaoView" >
SELECT yuangongbaoxiao.* FROM yuangongbaoxiao yuangongbaoxiao
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.YuangongbaoxiaoView" >
SELECT * FROM yuangongbaoxiao yuangongbaoxiao <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,43 @@
<?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.dao.YuangongguanliDao">
<!-- 使 -->
<resultMap type="com.entity.YuangongguanliEntity" id="yuangongguanliMap">
<result property="guanligonghao" column="guanligonghao"/>
<result property="mima" column="mima"/>
<result property="guanlixingming" column="guanlixingming"/>
<result property="xingbie" column="xingbie"/>
<result property="zhiwei" column="zhiwei"/>
<result property="shouji" column="shouji"/>
<result property="youxiang" column="youxiang"/>
<result property="shenfenzheng" column="shenfenzheng"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.YuangongguanliVO" >
SELECT * FROM yuangongguanli yuangongguanli
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.YuangongguanliVO" >
SELECT yuangongguanli.* FROM yuangongguanli yuangongguanli
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.YuangongguanliView" >
SELECT yuangongguanli.* FROM yuangongguanli yuangongguanli
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.YuangongguanliView" >
SELECT * FROM yuangongguanli yuangongguanli <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,46 @@
<?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.dao.YuangongjiaokuanDao">
<!-- 使 -->
<resultMap type="com.entity.YuangongjiaokuanEntity" id="yuangongjiaokuanMap">
<result property="yuangonggonghao" column="yuangonggonghao"/>
<result property="yuangongxingming" column="yuangongxingming"/>
<result property="jiaofeimingcheng" column="jiaofeimingcheng"/>
<result property="jiaokuanjine" column="jiaokuanjine"/>
<result property="jiaokuanriqi" column="jiaokuanriqi"/>
<result property="beizhu" column="beizhu"/>
<result property="guanligonghao" column="guanligonghao"/>
<result property="guanlixingming" column="guanlixingming"/>
<result property="sfsh" column="sfsh"/>
<result property="shhf" column="shhf"/>
<result property="ispay" column="ispay"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.YuangongjiaokuanVO" >
SELECT * FROM yuangongjiaokuan yuangongjiaokuan
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.YuangongjiaokuanVO" >
SELECT yuangongjiaokuan.* FROM yuangongjiaokuan yuangongjiaokuan
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.YuangongjiaokuanView" >
SELECT yuangongjiaokuan.* FROM yuangongjiaokuan yuangongjiaokuan
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.YuangongjiaokuanView" >
SELECT * FROM yuangongjiaokuan yuangongjiaokuan <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,47 @@
<?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.dao.YuangongxinchouDao">
<!-- 使 -->
<resultMap type="com.entity.YuangongxinchouEntity" id="yuangongxinchouMap">
<result property="yuangonggonghao" column="yuangonggonghao"/>
<result property="yuangongxingming" column="yuangongxingming"/>
<result property="jibengongzi" column="jibengongzi"/>
<result property="quanqinjiangli" column="quanqinjiangli"/>
<result property="jixiaojiangli" column="jixiaojiangli"/>
<result property="shebaobuzhu" column="shebaobuzhu"/>
<result property="koukuanjine" column="koukuanjine"/>
<result property="koukuanshixiang" column="koukuanshixiang"/>
<result property="shifagongzi" column="shifagongzi"/>
<result property="riqi" column="riqi"/>
<result property="guanligonghao" column="guanligonghao"/>
<result property="guanlixingming" column="guanlixingming"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.YuangongxinchouVO" >
SELECT * FROM yuangongxinchou yuangongxinchou
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.YuangongxinchouVO" >
SELECT yuangongxinchou.* FROM yuangongxinchou yuangongxinchou
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.YuangongxinchouView" >
SELECT yuangongxinchou.* FROM yuangongxinchou yuangongxinchou
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.YuangongxinchouView" >
SELECT * FROM yuangongxinchou yuangongxinchou <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,41 @@
<?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.dao.ZhipiaoxinxiDao">
<!-- 使 -->
<resultMap type="com.entity.ZhipiaoxinxiEntity" id="zhipiaoxinxiMap">
<result property="zhipiaohao" column="zhipiaohao"/>
<result property="shoukuandanwei" column="shoukuandanwei"/>
<result property="jine" column="jine"/>
<result property="yongtu" column="yongtu"/>
<result property="beizhu" column="beizhu"/>
<result property="kaipiaoriqi" column="kaipiaoriqi"/>
</resultMap>
<select id="selectListVO"
resultType="com.entity.vo.ZhipiaoxinxiVO" >
SELECT * FROM zhipiaoxinxi zhipiaoxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectVO"
resultType="com.entity.vo.ZhipiaoxinxiVO" >
SELECT zhipiaoxinxi.* FROM zhipiaoxinxi zhipiaoxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectListView"
resultType="com.entity.view.ZhipiaoxinxiView" >
SELECT zhipiaoxinxi.* FROM zhipiaoxinxi zhipiaoxinxi
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView"
resultType="com.entity.view.ZhipiaoxinxiView" >
SELECT * FROM zhipiaoxinxi zhipiaoxinxi <where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD SQL Map Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--
| plugins:
| properties?, settings?,
| typeAliases?, typeHandlers?,
| objectFactory?,objectWrapperFactory?,
| plugins?,
| environments?, databaseIdProvider?, mappers?
|-->
<configuration>
<!--
|
|
| ,
|
| aggressiveLazyLoading true, true
| multipleResultSetsEnabled true,
| useColumnLabel true, 使
| useGeneratedKeys false, JDBC true使
| autoMappingBehavior PARTIAL, MyBatis PARTIALFULL
| defaultExecutorType SIMPLE, SIMPLE REUSE 使prepared statements BATCH
| defaultStatementTimeout null,
| -->
<settings>
<!-- 使 -->
<setting name="cacheEnabled" value="true"/>
<!-- -->
<setting name="lazyLoadingEnabled" value="true"/>
<setting name="multipleResultSetsEnabled" value="true"/>
<setting name="useColumnLabel" value="true"/>
<setting name="defaultExecutorType" value="REUSE"/>
<setting name="defaultStatementTimeout" value="25000"/>
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
</configuration>

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:default-servlet-handler/>
<!-- Controller() -->
<context:component-scan base-package="com.controller"/>
<!-- FastJson -->
<mvc:annotation-driven>
<!-- <mvc:message-converters register-defaults="true">
IEAJAX,JSON
FastJson
<bean id="fastJsonHttpMessageConverter"
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
text/html,ie
<value>text/html;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
<property name="features">
<array value-type="com.alibaba.fastjson.serializer.SerializerFeature">
<value>DisableCircularReferenceDetect</value>
null
<value>WriteMapNullValue</value>
null,0,null
<value>WriteNullNumberAsZero</value>
null,"",null
<value>WriteNullStringAsEmpty</value>
Listnull,[],null
<value>WriteNullListAsEmpty</value>
Booleannull,false,null
<value>WriteNullBooleanAsFalse</value>
</array>
</property>
</bean>
</mvc:message-converters> -->
</mvc:annotation-driven>
<!-- -->
<mvc:resources mapping="/resources/**" location="/resources/"/>
<!-- , -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
<!-- -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/upload"/>
<bean class="com.interceptor.AuthorizationInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
<!-- -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 31M31*1024*1024 -->
<property name="maxUploadSize" value="32505856"/>
</bean>
</beans>

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- -->
<bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<property name="url" value="${jdbc_url}"/>
<property name="username" value="${jdbc_username}"/>
<property name="password" value="${jdbc_password}"/>
<!-- -->
<property name="initialSize" value="0"/>
<!-- 使 -->
<property name="maxActive" value="20"/>
<!-- -->
<property name="maxIdle" value="20"/>
<!-- -->
<property name="minIdle" value="0"/>
<!-- -->
<property name="maxWait" value="60000"/>
<property name="validationQuery" value="${validationQuery}"/>
<property name="testOnBorrow" value="false"/>
<property name="testOnReturn" value="false"/>
<property name="testWhileIdle" value="true"/>
<!-- -->
<property name="timeBetweenEvictionRunsMillis" value="60000"/>
<!-- -->
<property name="minEvictableIdleTimeMillis" value="25200000"/>
<!-- removeAbandoned -->
<property name="removeAbandoned" value="true"/>
<!-- 180030 -->
<property name="removeAbandonedTimeout" value="1800"/>
<!-- abanded -->
<property name="logAbandoned" value="true"/>
<!-- -->
<property name="filters" value="mergeStat"/>
</bean>
<!-- SpringMybatishttp://mp.baomidou.com -->
<bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<!-- Mapping.xml -->
<property name="mapperLocations" value="classpath:mapper/*.xml"/>
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml"/>
<property name="typeAliasesPackage" value="com..model.*"/>
<property name="typeEnumsPackage" value="com.model.enums"/>
<property name="plugins">
<array>
<!-- -->
<bean id="paginationInterceptor" class="com.baomidou.mybatisplus.plugins.PaginationInterceptor">
</bean>
</array>
</property>
<!-- -->
<property name="globalConfig" ref="globalConfig" />
</bean>
<bean id="globalConfig" class="com.baomidou.mybatisplus.entity.GlobalConfiguration">
<!--
AUTO->`0`("数据库ID自增")
INPUT->`1`(ID")
ID_WORKER->`2`("全局唯一ID")
UUID->`3`("全局唯一ID")
-->
<property name="idType" value="2" />
<!--
MYSQL->`mysql`
ORACLE->`oracle`
DB2->`db2`
H2->`h2`
HSQL->`hsql`
SQLITE->`sqlite`
POSTGRE->`postgresql`
SQLSERVER2005->`sqlserver2005`
SQLSERVER->`sqlserver`
-->
<!-- Oracle -->
<!-- <property name="dbType" value="oracle" /> -->
<!-- 线 true -->
<!-- <property name="dbColumnUnderline" value="true" /> -->
<property name="metaObjectHandler">
<bean class="com.config.MyMetaObjectHandler" />
</property>
</bean>
<!-- MyBatis -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.dao"/>
</bean>
<!-- -->
<bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="append*" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="modify*" propagation="REQUIRED"/>
<tx:method name="edit*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="remove*" propagation="REQUIRED"/>
<tx:method name="repair" propagation="REQUIRED"/>
<tx:method name="get*" propagation="REQUIRED" read-only="true"/>
<tx:method name="find*" propagation="REQUIRED" read-only="true"/>
<tx:method name="load*" propagation="REQUIRED" read-only="true"/>
<tx:method name="search*" propagation="REQUIRED" read-only="true"/>
<tx:method name="datagrid*" propagation="REQUIRED" read-only="true"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<!-- -->
<aop:config>
<aop:pointcut id="transactionPointcut" expression="execution(* com.service..*.*(..))"/>
<aop:advisor pointcut-ref="transactionPointcut" advice-ref="transactionAdvice"/>
</aop:config>
</beans>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<!-- -->
<context:property-placeholder location="classpath:config.properties"/>
<!-- Service() -->
<context:component-scan base-package="com.service"/>
<import resource="classpath:spring/spring-mybatis.xml"/>
</beans>

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>spring</display-name>
<!-- Spring -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring.xml</param-value>
</context-param>
<!-- -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Spring -->
<listener>
<description>Spring</description>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<!-- Spring MVC -->
<servlet>
<servlet-name>SpringMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<description>SpringMVC</description>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- springmvcurl-pattern -->
<!-- dispatchservlet -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
<url-pattern>*.css</url-pattern>
<url-pattern>*.html</url-pattern>
<url-pattern>/upload/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- Session -->
<!-- <session-config>
<session-timeout>15</session-timeout>
</session-config> -->
</web-app>

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="./favicon.ico"><title></title><link href="./css/app.c2e60772.css" rel="preload" as="style"><link href="./css/chunk-vendors.1f0a25b2.css" rel="preload" as="style"><link href="./js/app.4692e4b6.js" rel="preload" as="script"><link href="./js/chunk-vendors.5998aebc.js" rel="preload" as="script"><link href="./css/chunk-vendors.1f0a25b2.css" rel="stylesheet"><link href="./css/app.c2e60772.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but mas-creator-admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="./js/chunk-vendors.5998aebc.js"></script><script src="./js/app.4692e4b6.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -0,0 +1,62 @@
{
"name": "mas-creator-admin",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.4.4",
"echarts": "^4.6.0",
"element-ui": "^2.13.0",
"js-md5": "^0.7.3",
"print-js": "^1.5.0",
"vue": "^2.6.10",
"vue-quill-editor": "^3.0.6",
"vue-amap": "^0.5.10",
"vue-json-excel": "^0.3.0",
"vue-router": "^3.1.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.13.1",
"sass-loader": "^8.0.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.2",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"no-console": "off",
"no-unused-vars": 0,
"no-useless-escape": "off"
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8",
"Android >= 4.0"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title></title>
</head>
<body>
<noscript>
<strong>We're sorry but mas-creator-admin doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -0,0 +1,30 @@
<template>
<div id="app" class="">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: "app",
};
</script>
<style lang="scss">
*{
padding: 0;
margin:0;
}
html,body{
width: 100%;
height: 100%;
}
#app{
height:100%;
}
body {
padding: 0;
margin: 0;
}
</style>

@ -0,0 +1,9 @@
/* 改变主题色变量 */
$--color-primary: #00c292 !default;
$--color-success: #67c23a !default;
$--color-warning: #e6a23c !default;
$--color-danger: #f56c6c !default;
$--color-info: #909399 !default;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
//@import "~element-ui/packages/theme-chalk/src/index";

@ -0,0 +1,47 @@
.form-content {
background: #ffffff;
padding: 10px 10px 0 10px;
}
.table-content {
background: #ffffff;
padding: 0 10px;
}
.pagination-content {
margin-top: 10px;
padding-bottom: 10px;
text-align: right;
}
.detail-form-content{
background: #ffffff;
padding: 10px;
.el-input{
min-width: 200px;
max-width: 600px;
}
}
.bg {
position: absolute;
top: 0;
left: 0;
height: 100%;
}
.login-form {
position: absolute;
top: 0;
right: 0;
width: 350px;
height: 100%;
background: #ffffff;
padding: 0 60px;
font-size: 18px;
font-weight: bold;
}
.h1 {
margin-top: 80px;
font-size: 20px;
font-weight: bold;
}
.btn-login {
margin-top: 50px;
width: 100%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save