Commit 05ae6411 by dengshichuan

Merge branch 'wdz' into 'develop'

Wdz

See merge request 8timerv2/8timerapiv200!15
parents bea51ce9 8315a4c6
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>cn.8timer</groupId>
<artifactId>8timerV200</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>8timerV200</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<shiro.version>1.2.3</shiro.version>
<swagger.version>2.9.2</swagger.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- <exclusions> <exclusion> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> -->
</dependency>
<!-- 排除springboot内置tomcat容器的SpringBootServletInitializer接口需要依赖 javax.servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--打包的时候可以不用包进去,别的设施会提供。事实上该依赖理论上可以参与编译,测试,运行等周期。 相当于compile,但是打包阶段做了exclude操作 -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 添加MySQL依赖 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 添加JDBC依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!-- optional这个需要为 true 热部署才有效 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- swagger2-UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.2</version>
</dependency>
<!-- -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>
<!-- Excel -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-ehcache</artifactId>
<version>${shiro.version}</version>
</dependency>
<!-- redis starter -->
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency> -->
<!-- https://mvnrepository.com/artifact/org.springframework.session/spring-session-data-redis -->
<!-- <dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-data-redis</artifactId>
</dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId>
<version>2.9.0</version> </dependency> -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</dependency>
<!-- Hutool超级工具类 http://hutool.mydoc.io/ -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.6.1</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- freemarker -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<!-- 支持 @ConfigurationProperties 注解 -->
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional> </dependency> -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- jackson -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok-maven-plugin -->
<!-- <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok-maven-plugin</artifactId>
<version>1.18.4.0</version> </dependency> -->
<!-- <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId>
<scope>runtime</scope> </dependency> -->
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.7.1-a</version>
</dependency>
<!-- <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId>
<version>2.6</version> </dependency> <dependency> <groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId> <version>1.3.3</version> </dependency> -->
<!-- 阿里云Java SDK核心库 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.4.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-ecs</artifactId>
<version>4.17.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.1.0</version>
</dependency>
<!--springboot-quartz -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<!--Quartz 使用的连接池 这里Quartz在持久化任务时使用该jar -->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>
<!-- pdf -->
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/fontbox -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
<version>2.0.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!-- https://mvnrepository.com/artifact/nl.bitwalker/UserAgentUtils -->
<dependency>
<groupId>nl.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>1.2.4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<build>
<finalName>8timer-api</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<!-- 不执行单元测试,也不编译测试类 -->
<skip>true</skip>
<!-- 不执行单元测试,但会编译测试类,并在target/test-classes目录下生成相应的class -->
<!-- <skipTests>true</skipTests> -->
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
<!-- <plugin> <groupId>org.projectlombok</groupId> <artifactId>lombok-maven-plugin</artifactId>
<version>1.18.4.0</version> <executions> <execution> <phase>generate-sources</phase>
<goals> <goal>delombok</goal> </goals> <configuration> <addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory> <formatPreferences> <pretty/>
</formatPreferences> </configuration> </execution> </executions> </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<!--<failOnMissingWebXml>false</failOnMissingWebXml> -->
<includeEmptyDirs>true</includeEmptyDirs>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
</build>
<!-- <packaging>war</packaging> -->
</project>
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>cn.8timer</groupId>
<artifactId>8timerV200</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>8timerV200</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<shiro.version>1.2.3</shiro.version>
<swagger.version>2.9.2</swagger.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- <exclusions> <exclusion> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> -->
</dependency>
<!-- 排除springboot内置tomcat容器的SpringBootServletInitializer接口需要依赖 javax.servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--打包的时候可以不用包进去,别的设施会提供。事实上该依赖理论上可以参与编译,测试,运行等周期。 相当于compile,但是打包阶段做了exclude操作 -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 添加MySQL依赖 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 添加JDBC依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!-- optional这个需要为 true 热部署才有效 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- swagger2-UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.2</version>
</dependency>
<!-- -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>
<!-- Excel -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-ehcache</artifactId>
<version>${shiro.version}</version>
</dependency>
<!-- redis starter -->
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency> -->
<!-- https://mvnrepository.com/artifact/org.springframework.session/spring-session-data-redis -->
<!-- <dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-data-redis</artifactId>
</dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId>
<version>2.9.0</version> </dependency> -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</dependency>
<!-- Hutool超级工具类 http://hutool.mydoc.io/ -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.6.1</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- freemarker -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<!-- 支持 @ConfigurationProperties 注解 -->
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional> </dependency> -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- jackson -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok-maven-plugin -->
<!-- <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok-maven-plugin</artifactId>
<version>1.18.4.0</version> </dependency> -->
<!-- <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId>
<scope>runtime</scope> </dependency> -->
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.7.1-a</version>
</dependency>
<!-- <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId>
<version>2.6</version> </dependency> <dependency> <groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId> <version>1.3.3</version> </dependency> -->
<!-- 阿里云Java SDK核心库 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.4.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-ecs</artifactId>
<version>4.17.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.1.0</version>
</dependency>
<!--springboot-quartz -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<!--Quartz 使用的连接池 这里Quartz在持久化任务时使用该jar -->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>
<!-- pdf -->
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/fontbox -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
<version>2.0.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!-- https://mvnrepository.com/artifact/nl.bitwalker/UserAgentUtils -->
<dependency>
<groupId>nl.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>1.2.4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<build>
<finalName>8timer-api</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<!-- 不执行单元测试,也不编译测试类 -->
<skip>true</skip>
<!-- 不执行单元测试,但会编译测试类,并在target/test-classes目录下生成相应的class -->
<!-- <skipTests>true</skipTests> -->
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
<!-- <plugin> <groupId>org.projectlombok</groupId> <artifactId>lombok-maven-plugin</artifactId>
<version>1.18.4.0</version> <executions> <execution> <phase>generate-sources</phase>
<goals> <goal>delombok</goal> </goals> <configuration> <addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory> <formatPreferences> <pretty/>
</formatPreferences> </configuration> </execution> </executions> </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<!--<failOnMissingWebXml>false</failOnMissingWebXml> -->
<includeEmptyDirs>true</includeEmptyDirs>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
</build>
<!-- <packaging>war</packaging> -->
</project>
......@@ -9,10 +9,14 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import cn.timer.api.dto.yggl.YgbintuDto;
import lombok.Getter;
import net.sf.ehcache.search.expression.Between;
/**
* @date 2020年3月23日
......@@ -168,4 +172,47 @@ public interface YgEnumInterface {
return result.type.toString();
}
}
/**
* 工龄
*/
@Getter
enum workage implements YgEnumInterface{
//NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000);
NEW(0,183,0),HALF(184,365,0),ONE(366,548,0),ONEHALF(549,730,0),TWO(731,1000,0),LONG(1001,10000,0);
private Integer begin;
private Integer end;
private Integer number;
workage(Integer begin, Integer end,Integer number) {
this.begin = begin;
this.end = end;
this.number = number;
}
public static Map<String, Integer> choose(List<YgbintuDto> bintu) {
for (YgbintuDto b : bintu) {
Integer index = b.getWorkage();
for (workage item : workage.values()) {
if (index>= item.begin && index<=item.end) {
item.number++;
System.out.println("item"+ item+":"+item.number);
}
}
}
Map<String, Integer> result = new HashMap<String, Integer>();
result.put("x<0.5", NEW.number);
result.put("0.5<x<1", HALF.number);
result.put("1<x<1.5", ONE.number);
result.put("1.5<x<2", ONEHALF.number);
result.put("2<x<3", TWO.number);
result.put("x++", LONG.number);
return result;
}
}
}
//package cn.timer.api.controller.quartz;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import org.quartz.CronScheduleBuilder;
//import org.quartz.CronTrigger;
//import org.quartz.JobBuilder;
//import org.quartz.JobDetail;
//import org.quartz.JobKey;
//import org.quartz.Scheduler;
//import org.quartz.SchedulerException;
//import org.quartz.TriggerBuilder;
//import org.quartz.TriggerKey;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.github.pagehelper.PageInfo;
//
//import cn.timer.api.bean.quartz.JobAndTrigger;
//import cn.timer.api.config.quartz.TestJob;
//import cn.timer.api.dao.quartz.JobAndTriggerMapper;
//import cn.timer.api.utils.Result;
//import cn.timer.api.utils.ResultUtil;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//
//@Api(tags = "99.0 Quartz")
//@RestController
//@RequestMapping(value = "/quartz", produces = { "application/json" })
//public class JobController {
//
// @Autowired
// private Scheduler scheduler;
//
// @PostMapping(value = "/addjob")
// @ApiOperation(value = "新增任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> addjob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName,
// @RequestParam(value = "cronExpression") String cronExpression) throws Exception {
// addJob(jobClassName, jobGroupName, cronExpression);
// return ResultUtil.success("新增定时任务成功");
// }
//
// public void addJob(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
//
// // 启动调度器
// scheduler.start();
//
// // 构建job信息
// JobDetail jobDetail = JobBuilder.newJob(TestJob.class)
// .withIdentity(jobClassName, jobGroupName).build();
//
// // 表达式调度构建器(即任务执行的时间)
// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
//
// // 按新的cronExpression表达式构建一个新的trigger
// CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(jobClassName, jobGroupName)
// .withSchedule(scheduleBuilder).build();
//
// try {
// scheduler.scheduleJob(jobDetail, trigger);
//
// } catch (SchedulerException e) {
// System.out.println("创建定时任务失败" + e);
// throw new Exception("创建定时任务失败");
// }
// }
//
// @PostMapping(value = "/pausejob")
// @ApiOperation(value = "暂停任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> pausejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobPause(jobClassName, jobGroupName);
// return ResultUtil.success("暂停定时任务成功");
// }
//
// public void jobPause(String jobClassName, String jobGroupName) throws Exception {
// scheduler.pauseJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
// @PostMapping(value = "/resumejob")
// @ApiOperation(value = "恢复任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> resumejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobresume(jobClassName, jobGroupName);
// return ResultUtil.success("恢复定时任务成功");
// }
//
// public void jobresume(String jobClassName, String jobGroupName) throws Exception {
// scheduler.resumeJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
// @PostMapping(value = "/reschedulejob")
// @ApiOperation(value = "重新设置任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> rescheduleJob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName,
// @RequestParam(value = "cronExpression") String cronExpression) throws Exception {
// jobreschedule(jobClassName, jobGroupName, cronExpression);
// return ResultUtil.success("重设定时任务成功");
// }
//
// public void jobreschedule(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
// try {
// TriggerKey triggerKey = TriggerKey.triggerKey(jobClassName, jobGroupName);
// // 表达式调度构建器
// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
//
// CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
//
// // 按新的cronExpression表达式重新构建trigger
// trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
//
// // 按新的trigger重新设置job执行
// scheduler.rescheduleJob(triggerKey, trigger);
// } catch (SchedulerException e) {
// System.out.println("更新定时任务失败" + e);
// throw new Exception("更新定时任务失败");
// }
// }
//
// @PostMapping(value = "/deletejob")
// @ApiOperation(value = "删除任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> deletejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobdelete(jobClassName, jobGroupName);
// return ResultUtil.success("删除成功");
// }
//
// public void jobdelete(String jobClassName, String jobGroupName) throws Exception {
// scheduler.pauseTrigger(TriggerKey.triggerKey(jobClassName, jobGroupName));
// scheduler.unscheduleJob(TriggerKey.triggerKey(jobClassName, jobGroupName));
// scheduler.deleteJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
//}
//package cn.timer.api.controller.quartz;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import org.quartz.CronScheduleBuilder;
//import org.quartz.CronTrigger;
//import org.quartz.JobBuilder;
//import org.quartz.JobDetail;
//import org.quartz.JobKey;
//import org.quartz.Scheduler;
//import org.quartz.SchedulerException;
//import org.quartz.TriggerBuilder;
//import org.quartz.TriggerKey;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.github.pagehelper.PageInfo;
//
//import cn.timer.api.bean.quartz.JobAndTrigger;
//import cn.timer.api.config.quartz.TestJob;
//import cn.timer.api.dao.quartz.JobAndTriggerMapper;
//import cn.timer.api.utils.Result;
//import cn.timer.api.utils.ResultUtil;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//
//@Api(tags = "99.0 Quartz")
//@RestController
//@RequestMapping(value = "/quartz", produces = { "application/json" })
//public class JobController {
//
// @Autowired
// private Scheduler scheduler;
//
// @PostMapping(value = "/addjob")
// @ApiOperation(value = "新增任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> addjob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName,
// @RequestParam(value = "cronExpression") String cronExpression) throws Exception {
// addJob(jobClassName, jobGroupName, cronExpression);
// return ResultUtil.success("新增定时任务成功");
// }
//
// public void addJob(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
//
// // 启动调度器
// scheduler.start();
//
// // 构建job信息
// JobDetail jobDetail = JobBuilder.newJob(TestJob.class)
// .withIdentity(jobClassName, jobGroupName).build();
//
// // 表达式调度构建器(即任务执行的时间)
// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
//
// // 按新的cronExpression表达式构建一个新的trigger
// CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(jobClassName, jobGroupName)
// .withSchedule(scheduleBuilder).build();
//
// try {
// scheduler.scheduleJob(jobDetail, trigger);
//
// } catch (SchedulerException e) {
// System.out.println("创建定时任务失败" + e);
// throw new Exception("创建定时任务失败");
// }
// }
//
// @PostMapping(value = "/pausejob")
// @ApiOperation(value = "暂停任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> pausejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobPause(jobClassName, jobGroupName);
// return ResultUtil.success("暂停定时任务成功");
// }
//
// public void jobPause(String jobClassName, String jobGroupName) throws Exception {
// scheduler.pauseJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
// @PostMapping(value = "/resumejob")
// @ApiOperation(value = "恢复任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> resumejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobresume(jobClassName, jobGroupName);
// return ResultUtil.success("恢复定时任务成功");
// }
//
// public void jobresume(String jobClassName, String jobGroupName) throws Exception {
// scheduler.resumeJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
// @PostMapping(value = "/reschedulejob")
// @ApiOperation(value = "重新设置任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> rescheduleJob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName,
// @RequestParam(value = "cronExpression") String cronExpression) throws Exception {
// jobreschedule(jobClassName, jobGroupName, cronExpression);
// return ResultUtil.success("重设定时任务成功");
// }
//
// public void jobreschedule(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
// try {
// TriggerKey triggerKey = TriggerKey.triggerKey(jobClassName, jobGroupName);
// // 表达式调度构建器
// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
//
// CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
//
// // 按新的cronExpression表达式重新构建trigger
// trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
//
// // 按新的trigger重新设置job执行
// scheduler.rescheduleJob(triggerKey, trigger);
// } catch (SchedulerException e) {
// System.out.println("更新定时任务失败" + e);
// throw new Exception("更新定时任务失败");
// }
// }
//
// @PostMapping(value = "/deletejob")
// @ApiOperation(value = "删除任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> deletejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobdelete(jobClassName, jobGroupName);
// return ResultUtil.success("删除成功");
// }
//
// public void jobdelete(String jobClassName, String jobGroupName) throws Exception {
// scheduler.pauseTrigger(TriggerKey.triggerKey(jobClassName, jobGroupName));
// scheduler.unscheduleJob(TriggerKey.triggerKey(jobClassName, jobGroupName));
// scheduler.deleteJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
//}
......@@ -8,6 +8,7 @@ package cn.timer.api.controller.yggl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
......@@ -15,6 +16,7 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import javax.transaction.Transactional;
......@@ -68,6 +70,7 @@ import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.yggl.YgProDtoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.yggl.YgtitleDtoMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.LzbQueryDto;
......@@ -78,9 +81,11 @@ import cn.timer.api.dto.yggl.YgDrjqbDto;
import cn.timer.api.dto.yggl.YgDrsDto;
import cn.timer.api.dto.yggl.YgProDto;
import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgbintuDto;
import cn.timer.api.dto.yggl.YgglCartogramDto;
import cn.timer.api.dto.yggl.YgjgDto;
import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.dto.yggl.YgtitleDto;
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result;
......@@ -123,6 +128,10 @@ public class YgglController {
@Autowired
private YgMzDtoMapper ygMzDtoMapper;
//weng(人事仪表盘)
@Autowired
private YgtitleDtoMapper ygtitleDtoMapper;
/**
* 获取员工档案
*
......@@ -1657,8 +1666,58 @@ public class YgglController {
}
/**
<<<<<<< HEAD
* 员工信息统计图
* @return 成功信息(weng)
*/
@GetMapping("/Cartogram")
@ApiOperation(value = "获取员工管理统计图信息", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 63)
public Result<Map<String, Object>> ygCartogram(@CurrentUser UserBean userBean) {
List<YgbintuDto> bintu = ygglMainEmpMapper.rsybp();
bintu.stream().filter(bean ->{
if (bean.getAge() == null) {
bean.setAge(-1);
}
if (bean.getBm() == null) {
bean.setBm("未分配");
}
if (bean.getGw() == null) {
bean.setGw("未分配");
}
if (bean.getProname() == null) {
bean.setProname("未分配");
}
if (bean.getEduname() == null) {
bean.setEduname("未分配");
}
if (bean.getJobStatus() == null) {
bean.setJobStatus(-1);
}
return true;
}).collect(Collectors.toList());
YgtitleDto title = new LambdaQueryChainWrapper<YgtitleDto>(ygtitleDtoMapper).eq(YgtitleDto::getOrgCode, userBean.getOrgCode()).one();
//Map<String, List<YgbintuDto>> map = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getGw));岗位
//Map<String, List<YgbintuDto>> map = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getBm));部门
Map<String, Map<String, Long>> bmgw = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getBm,Collectors.groupingBy(YgbintuDto::getGw,Collectors.counting())));
Map<String, List<YgbintuDto>> edu = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getEduname));
Map<Integer, List<YgbintuDto>> jobStatus = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getJobStatus));
Map<String, List<YgbintuDto>> proname = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getProname));
Map<String, Integer> workage = YgEnumInterface.workage.choose(bintu);
System.out.println(bmgw);
System.out.println(edu);
System.out.println(jobStatus);
System.out.println(proname);
System.out.println(workage);
return ResultUtil.success();
}
/**
* 获取员工社保公积金
=======
* 获取成长记录表
*
>>>>>>> bea51ce9ef8860bb31a1d14ffce121313636951a
* @param
* @return
*/
......
package cn.timer.api.controller.zzgl;
import java.util.ArrayList;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
import cn.timer.api.dto.zzgl.LogDgjlsDto;
import cn.timer.api.dto.zzgl.LogDgjlsQueryDto;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "2.组织管理")
@RestController
@Transactional
@RequestMapping(value = "/zzgl", produces = { "application/json" })
public class ZzglController {
@Autowired
ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired
ZzglLogDgjlMapper zzglLogDgjlMapper;
/**
* 架构树/架构图/导出
*
* @param
* @return
*/
@GetMapping(value = "/deptlist")
@ApiOperation(value = "获取部门岗位", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglBmgwM>> selectlistdept(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
return ResultUtil.data(zzglBmgwMs);
}
/**
* 岗位成员
*
* @param 部门岗位id
* @return
*/
@GetMapping(value = "/otherlistent/{id}")
@ApiOperation(value = "获取岗位成员列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglMainEmp>> selectOtherlistent(@CurrentUser UserBean userBean, @PathVariable Integer id){
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
LambdaQueryWrapper<YgglMainEmp> ygglMainEmpsLambdaQueryWrapper = new LambdaQueryWrapper<>();
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()));
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
return ResultUtil.data(ygglMainEmps);
}
}
/**
* 获取调岗记录(weng)
*
* @param 部门岗位id
* @return
*/
@PostMapping(value = "/listdgjl")
@ApiOperation(value = "获取调岗记录(weng)", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> selectlistdgjl(@CurrentUser UserBean userBean, @RequestBody LogDgjlsQueryDto logDgjlsQueryDto){
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
list.add(logDgjlsQueryDto.getDeptId());
ZzglBmgwM.getDepts(list, logDgjlsQueryDto.getDeptId(), zzglBmgwMs);
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
logDgjlsQueryDto.setDeptIdList(list);
logDgjlsQueryDto.setOrgCode(orgCode);
IPage<LogDgjlsDto> page = new Page<LogDgjlsDto>(
logDgjlsQueryDto.getCurrentPage() == null ? 1 : logDgjlsQueryDto.getCurrentPage(),
logDgjlsQueryDto.getTotalPage() == null ? 10 : logDgjlsQueryDto.getTotalPage());
List<LogDgjlsDto> logDgjlDtos = zzglLogDgjlMapper.selectListdgjls(page, logDgjlsQueryDto);
return ResultUtil.data(page, logDgjlDtos, "查询成功");
}
}
/**
* 未设置岗位的成员
*
* @return
*/
@GetMapping(value = "/listent")
@ApiOperation(value = "未设置岗位的成员", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglMainEmp>> selectlistent(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
LambdaQueryWrapper<YgglMainEmp> ygglMainEmpsLambdaQueryWrapper = new LambdaQueryWrapper<>();
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone)
.eq(YgglMainEmp::getOrgCode, orgCode)
.and(i -> i.isNull(YgglMainEmp::getBmgwId).or().eq(YgglMainEmp::getBmgwId, 0));
// .and(lqw -> lqw.notIn(id != null,
// YgglMainEmp::getBmgwId,Arrays.asList(id)).or().isNull(YgglMainEmp::getBmgwId))
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
// List<ZzglBmgwMEmpDto> zzglBmgwMEmpDtos =
// zzglBmgwMMapper.selectOtherListByOrgCode(orgCode,id);
return ResultUtil.data(ygglMainEmps);
}
/**
* 添加/修改部门
*
* @param
* @return
*/
@PostMapping(value = "/dept")
@ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明")
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM){
Boolean a = zzglBmgwM.getId() == null;
if (a && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0);
zzglBmgwM.setOrgCode(userBean.getOrgCode());
zzglBmgwM.insertOrUpdate();
if (a)
return ResultUtil.data(zzglBmgwM);
return ResultUtil.success();
}
/**
* 删除部门岗位
*
* @param 部门岗位ids [1,2,3,4]
* @return
*/
@DeleteMapping(value = "/dept")
@ApiOperation(value = "删除部门岗位", httpMethod = "DELETE", notes = "接口发布说明")
public Result<Integer> deldepts(@CurrentUser UserBean userBean, @RequestBody List<Integer> ids) {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", null).in("bmgw_id", ids);
zzglLogDgjlMapper.insertbydeldept(ids, userBean.getEmpNum());
ygglMainEmp.update(updateWrapper);
zzglBmgwMMapper.deleteBatchIds(ids);
return ResultUtil.success();
}
/**
* 批量修改/删除员工部门
*
* @param 部门岗位id
* @return
*/
@PostMapping(value = "/empdept")
@ApiOperation(value = "批量修改/删除员工部门", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> updatelistempdept(@CurrentUser UserBean userBean, @RequestBody UpEmpDeptDto upEmpDeptDto) {
Integer dpetId = upEmpDeptDto.getDpetId();
List<Integer> empNums = upEmpDeptDto.getEmpNum();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
// zzglLogDgjlMapper
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", dpetId).eq("org_code", userBean.getOrgCode()).in("emp_num", empNums);
zzglLogDgjlMapper.insertbyaddemp(empNums, userBean.getEmpNum(), dpetId, userBean.getOrgCode(),
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
ygglMainEmp.update(updateWrapper);
// zzglLogDgjlMapper.insert
return ResultUtil.success();
}
/**
* 岗位权限
*
* @param 部门岗位id
* @return
*/
@GetMapping(value = "/auth/{id}")
@ApiOperation(value = "获取岗位岗位权限", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglAuth>> auth(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
ZzglBmgwM.getupDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
LambdaQueryWrapper<ZzglAuth> wp = new LambdaQueryWrapper<>();
wp.select(ZzglAuth::getMenuId, ZzglAuth::getBmgwId).eq(ZzglAuth::getOrgCode, orgCode)
.and(i -> i.in(ZzglAuth::getBmgwId, list.toArray()));
List<ZzglAuth> zas = ZzglAuth.builder().build().selectList(wp);
return ResultUtil.data(zas);
}
}
/**
* 批量修改/删除岗位权限
*
* @param 部门岗位id
* @param 菜单ids
* @return
*/
@PostMapping(value = "/auth/{id}")
@ApiOperation(value = "批量修改/删除岗位权限", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> auth(@CurrentUser UserBean userBean, @PathVariable Integer id, @RequestBody List<String> ids) {
Integer orgCode = userBean.getOrgCode();
ZzglAuth.builder().build().delete(
new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getOrgCode, orgCode).eq(ZzglAuth::getBmgwId, id));
ids.forEach(o -> {
ZzglAuth za = ZzglAuth.builder().build();
za.setBmgwId(id);
za.setOrgCode(orgCode);
za.setMenuId(o);
za.insert();
});
return ResultUtil.success();
}
}
package cn.timer.api.controller.zzgl;
import java.util.ArrayList;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
import cn.timer.api.dto.zzgl.LogDgjlsDto;
import cn.timer.api.dto.zzgl.LogDgjlsQueryDto;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "2.组织管理")
@RestController
@Transactional
@RequestMapping(value = "/zzgl", produces = { "application/json" })
public class ZzglController {
@Autowired
ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired
ZzglLogDgjlMapper zzglLogDgjlMapper;
/**
* 架构树/架构图/导出
*
* @param
* @return
*/
@GetMapping(value = "/deptlist")
@ApiOperation(value = "获取部门岗位", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglBmgwM>> selectlistdept(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
return ResultUtil.data(zzglBmgwMs);
}
/**
* 岗位成员
*
* @param 部门岗位id
* @return
*/
@GetMapping(value = "/otherlistent/{id}")
@ApiOperation(value = "获取岗位成员列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglMainEmp>> selectOtherlistent(@CurrentUser UserBean userBean, @PathVariable Integer id){
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
LambdaQueryWrapper<YgglMainEmp> ygglMainEmpsLambdaQueryWrapper = new LambdaQueryWrapper<>();
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()));
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
return ResultUtil.data(ygglMainEmps);
}
}
/**
* 获取调岗记录(weng)
*
* @param 部门岗位id
* @return
*/
@PostMapping(value = "/listdgjl")
@ApiOperation(value = "获取调岗记录(weng)", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> selectlistdgjl(@CurrentUser UserBean userBean, @RequestBody LogDgjlsQueryDto logDgjlsQueryDto){
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
list.add(logDgjlsQueryDto.getDeptId());
ZzglBmgwM.getDepts(list, logDgjlsQueryDto.getDeptId(), zzglBmgwMs);
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
logDgjlsQueryDto.setDeptIdList(list);
logDgjlsQueryDto.setOrgCode(orgCode);
IPage<LogDgjlsDto> page = new Page<LogDgjlsDto>(
logDgjlsQueryDto.getCurrentPage() == null ? 1 : logDgjlsQueryDto.getCurrentPage(),
logDgjlsQueryDto.getTotalPage() == null ? 10 : logDgjlsQueryDto.getTotalPage());
List<LogDgjlsDto> logDgjlDtos = zzglLogDgjlMapper.selectListdgjls(page, logDgjlsQueryDto);
return ResultUtil.data(page, logDgjlDtos, "查询成功");
}
}
/**
* 未设置岗位的成员
*
* @return
*/
@GetMapping(value = "/listent")
@ApiOperation(value = "未设置岗位的成员", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglMainEmp>> selectlistent(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
LambdaQueryWrapper<YgglMainEmp> ygglMainEmpsLambdaQueryWrapper = new LambdaQueryWrapper<>();
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone)
.eq(YgglMainEmp::getOrgCode, orgCode)
.and(i -> i.isNull(YgglMainEmp::getBmgwId).or().eq(YgglMainEmp::getBmgwId, 0));
// .and(lqw -> lqw.notIn(id != null,
// YgglMainEmp::getBmgwId,Arrays.asList(id)).or().isNull(YgglMainEmp::getBmgwId))
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
// List<ZzglBmgwMEmpDto> zzglBmgwMEmpDtos =
// zzglBmgwMMapper.selectOtherListByOrgCode(orgCode,id);
return ResultUtil.data(ygglMainEmps);
}
/**
* 添加/修改部门
*
* @param
* @return
*/
@PostMapping(value = "/dept")
@ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明")
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM){
Boolean a = zzglBmgwM.getId() == null;
if (a && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0);
zzglBmgwM.setOrgCode(userBean.getOrgCode());
zzglBmgwM.insertOrUpdate();
if (a)
return ResultUtil.data(zzglBmgwM);
return ResultUtil.success();
}
/**
* 删除部门岗位
*
* @param 部门岗位ids [1,2,3,4]
* @return
*/
@DeleteMapping(value = "/dept")
@ApiOperation(value = "删除部门岗位", httpMethod = "DELETE", notes = "接口发布说明")
public Result<Integer> deldepts(@CurrentUser UserBean userBean, @RequestBody List<Integer> ids) {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", null).in("bmgw_id", ids);
zzglLogDgjlMapper.insertbydeldept(ids, userBean.getEmpNum());
ygglMainEmp.update(updateWrapper);
zzglBmgwMMapper.deleteBatchIds(ids);
return ResultUtil.success();
}
/**
* 批量修改/删除员工部门
*
* @param 部门岗位id
* @return
*/
@PostMapping(value = "/empdept")
@ApiOperation(value = "批量修改/删除员工部门", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> updatelistempdept(@CurrentUser UserBean userBean, @RequestBody UpEmpDeptDto upEmpDeptDto) {
Integer dpetId = upEmpDeptDto.getDpetId();
List<Integer> empNums = upEmpDeptDto.getEmpNum();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
// zzglLogDgjlMapper
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", dpetId).eq("org_code", userBean.getOrgCode()).in("emp_num", empNums);
zzglLogDgjlMapper.insertbyaddemp(empNums, userBean.getEmpNum(), dpetId, userBean.getOrgCode(),
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
ygglMainEmp.update(updateWrapper);
// zzglLogDgjlMapper.insert
return ResultUtil.success();
}
/**
* 岗位权限
*
* @param 部门岗位id
* @return
*/
@GetMapping(value = "/auth/{id}")
@ApiOperation(value = "获取岗位岗位权限", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglAuth>> auth(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
ZzglBmgwM.getupDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
LambdaQueryWrapper<ZzglAuth> wp = new LambdaQueryWrapper<>();
wp.select(ZzglAuth::getMenuId, ZzglAuth::getBmgwId).eq(ZzglAuth::getOrgCode, orgCode)
.and(i -> i.in(ZzglAuth::getBmgwId, list.toArray()));
List<ZzglAuth> zas = ZzglAuth.builder().build().selectList(wp);
return ResultUtil.data(zas);
}
}
/**
* 批量修改/删除岗位权限
*
* @param 部门岗位id
* @param 菜单ids
* @return
*/
@PostMapping(value = "/auth/{id}")
@ApiOperation(value = "批量修改/删除岗位权限", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> auth(@CurrentUser UserBean userBean, @PathVariable Integer id, @RequestBody List<String> ids) {
Integer orgCode = userBean.getOrgCode();
ZzglAuth.builder().build().delete(
new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getOrgCode, orgCode).eq(ZzglAuth::getBmgwId, id));
ids.forEach(o -> {
ZzglAuth za = ZzglAuth.builder().build();
za.setBmgwId(id);
za.setOrgCode(orgCode);
za.setMenuId(o);
za.insert();
});
return ResultUtil.success();
}
}
package cn.timer.api.dao.htzz;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAdminZzda;
/**
* 合同证照档案表
*
* @author Tang 2019-12-04
*/
@Repository
public interface HtzzAdminZzdaMapper extends BaseMapper<HtzzAdminZzda> {
}
package cn.timer.api.dao.htzz;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAdminZzda;
/**
* 合同证照档案表
*
* @author Tang 2019-12-04
*/
@Repository
public interface HtzzAdminZzdaMapper extends BaseMapper<HtzzAdminZzda> {
}
package cn.timer.api.dao.htzz;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAssoHtgx;
/**
* 合同关系表
*
* @author Tang 2019-12-18
*/
@Repository
public interface HtzzAssoHtgxMapper extends BaseMapper<HtzzAssoHtgx> {
}
package cn.timer.api.dao.htzz;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAssoHtgx;
/**
* 合同关系表
*
* @author Tang 2019-12-18
*/
@Repository
public interface HtzzAssoHtgxMapper extends BaseMapper<HtzzAssoHtgx> {
}
package cn.timer.api.dao.htzz;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAssoZztx;
/**
* 证照提醒表
*
* @author Tang 2019-12-04
*/
@Repository
public interface HtzzAssoZztxMapper extends BaseMapper<HtzzAssoZztx> {
public static void main(String[] args) {
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
String a = format1.format(new Date());
System.err.println(a);
}
}
package cn.timer.api.dao.htzz;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAssoZztx;
/**
* 证照提醒表
*
* @author Tang 2019-12-04
*/
@Repository
public interface HtzzAssoZztxMapper extends BaseMapper<HtzzAssoZztx> {
public static void main(String[] args) {
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
String a = format1.format(new Date());
System.err.println(a);
}
}
package cn.timer.api.dao.yggl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgglCartogramDto;
/**
* 员工档案+统计图查询
*
* @author dsc 2019-11-23
*/
@Repository
public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
/**
* 查询员工信息
* @param userBean
* @return
*/
List<YgQueryDto> queryEmpMessage(UserBean userBean);
/**
* 查询在职员工(试用员工人数+正式员工人数)
* @param userBean
* @return
*/
YgglCartogramDto queryInservice(UserBean userBean);
/**
* 查询当月入职人数
* @param userBean
* @return
*/
YgglCartogramDto queryInduction(UserBean userBean);
/**
* 查询本月转正人数
* @param userBean
* @return
*/
YgglCartogramDto queryPositive(UserBean userBean);
/**
* 查询员工平均年龄
* @param userBean
* @return
*/
YgglCartogramDto queryAvgAge(UserBean userBean);
/**
* 查询部门名称及人数
* @param userBean
* @return
*/
List<YgglCartogramDto> queryDepartmentNum(UserBean userBean);
/**
* 查询岗位名称及人数
* @param userBean
* @return
*/
List<YgglCartogramDto> queryJobsNum(UserBean userBean);
/**
* 学历及人数查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEducation(UserBean userBean);
/**
* 员工年龄分布查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEmpAge(UserBean userBean);
/**
* 籍贯统计(省份)人数分布查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryNativeplace(UserBean userBean);
/**
* 员工工龄分布查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryWorkingAge(UserBean userBean);
}
package cn.timer.api.dao.yggl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgbintuDto;
import cn.timer.api.dto.yggl.YgglCartogramDto;
/**
* 员工档案+统计图查询
*
* @author dsc 2019-11-23
*/
@Repository
public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
/**
* 人事仪表盘
* @param userBean
* @return
*/
List<YgbintuDto> rsybp();
/**
* 查询员工信息
* @param userBean
* @return
*/
List<YgQueryDto> queryEmpMessage(UserBean userBean);
/**
* 查询在职员工(试用员工人数+正式员工人数)
* @param userBean
* @return
*/
YgglCartogramDto queryInservice(UserBean userBean);
/**
* 查询当月入职人数
* @param userBean
* @return
*/
YgglCartogramDto queryInduction(UserBean userBean);
/**
* 查询本月转正人数
* @param userBean
* @return
*/
YgglCartogramDto queryPositive(UserBean userBean);
/**
* 查询员工平均年龄
* @param userBean
* @return
*/
YgglCartogramDto queryAvgAge(UserBean userBean);
/**
* 查询部门名称及人数
* @param userBean
* @return
*/
List<YgglCartogramDto> queryDepartmentNum(UserBean userBean);
/**
* 查询岗位名称及人数
* @param userBean
* @return
*/
List<YgglCartogramDto> queryJobsNum(UserBean userBean);
/**
* 学历及人数查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEducation(UserBean userBean);
/**
* 员工年龄分布查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEmpAge(UserBean userBean);
/**
* 籍贯统计(省份)人数分布查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryNativeplace(UserBean userBean);
/**
* 员工工龄分布查询
* @param userBean
* @return
*/
List<YgglCartogramDto> queryWorkingAge(UserBean userBean);
}
package cn.timer.api.dao.yggl;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.dto.yggl.YgtitleDto;
/**
* 人事仪表盘饼图表
* @author Tang 2019-11-15
*/
@Repository
public interface YgtitleDtoMapper extends BaseMapper<YgtitleDto> {
}
/**
* @date 2020年4月1日
* @author 翁东州
* @方法中文名称:
*/
package cn.timer.api.dto.yggl;
import io.swagger.annotations.ApiModelProperty;
/**
* @date 2020年4月1日
* @author 翁东州
* @方法中文名称:
*/
public class YgCartogramDto {
@ApiModelProperty(value="统计图--标头 ",example="标头")
private YgtitleDto ygtitleDto;
@ApiModelProperty(value="统计图--饼图和直方图 ",example="饼图和直方图")
private YgbintuDto ygbintuDto;
}
package cn.timer.api.dto.yggl;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2019-11-15
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("统计图--饼图和直方图")
public class YgbintuDto{
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="编号",example="1")
private Integer id;
@ApiModelProperty(value="年龄 ",example="省编码")
private Integer age;
@ApiModelProperty(value="部门岗位id",example="市编码")
private Integer bmgwId;
@ApiModelProperty(value="岗位名",example="市编码")
private String gw;
@ApiModelProperty(value="部门名",example="市编码")
private String bm;
@ApiModelProperty(value="籍贯省份",example="名字")
private String proname;
@ApiModelProperty(value="学历",example="名字")
private String eduname;
@ApiModelProperty(value="员工状态",example="名字")
private Integer jobStatus;
@ApiModelProperty(value="工龄天数",example="名字")
private Integer workage;
}
package cn.timer.api.dto.yggl;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2019-11-15
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("yggl_atta_title")
@ApiModel("统计图--标头")
public class YgtitleDto{
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="id编号",example="1")
private Integer id;
@ApiModelProperty(value="在职人数",example="1")
private Integer zaizhi;
@ApiModelProperty(value="本月新入职 ",example="1")
private Integer xinruzhi;
@ApiModelProperty(value="本月离职",example="1")
private Integer lizhi;
@ApiModelProperty(value="本月转正",example="1")
private Integer zhuanzhen;
@ApiModelProperty(value="平均年龄",example="22")
private Integer nianlin;
@ApiModelProperty(value="组织机构代码",example="117")
private Integer orgCode;
}
package cn.timer.api.utils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.timer.api.bean.htzz.HtzzAdminZzda;
import cn.timer.api.bean.htzz.HtzzAssoHtgx;
/**
* 记录当前时间循环输出 遍历合同提醒关系表,每天固定时间(8点)查询是否提醒
*
* @author Administrator
*
*/
@Component
@Lazy(false)
@EnableScheduling
public class RemindUtil {
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
/**
* 间隔时间提醒 10min/次
*/
@Scheduled(fixedRate = 30 * 60 * 1000)
private void now() {
System.err.println("当前时间:" + dateFormat.format(new Date()));
}
/**
* 每天固定时间提醒
*/
@Scheduled(cron = "0 0 8 * * ?") // 每天8点扫一下看有没要提醒的,有就发一个
// @Scheduled(cron = "0 8 15 * * ?") // 测试合同提醒
public static void reportCurrentTime() {
List<HtzzAssoHtgx> htgxs = HtzzAssoHtgx.builder().build().selectAll();
for (HtzzAssoHtgx htgx : htgxs) {
QueryWrapper<HtzzAdminZzda> q = new QueryWrapper<HtzzAdminZzda>();
q.select("id", "zjmc", "txkg_type", "yxdqr").eq("id", htgx.getHtid()).eq("is_delete", 0).eq("txkg_type", 0);
HtzzAdminZzda zzda = HtzzAdminZzda.builder().build().selectOne(q);
if (zzda != null) {
String name = htgx.getName(); // 员工姓名
String phone = htgx.getPhone(); // 员工手机
String htname = zzda.getZjmc(); // 合同名称
Date now = new Date(); // 当前时间
Date dqsj = zzda.getYxdqr(); // 到期时间
String time = DateUtil.formatDate(dqsj); // 到期時間格式
Long betweenDay = DateUtil.between(dqsj, now, DateUnit.DAY); // 时间差天数
Long sjc = dqsj.getTime() - now.getTime(); // 时间差数值
System.err.println(betweenDay);
if (sjc > 0) {
if (betweenDay <= 1) {
AliyunSMS.tx(name, htname, time, phone); // 少于1天短信提醒
} else if (betweenDay == 3) {
AliyunSMS.tx(name, htname, time, phone); // 少于3天短信提醒
} else if (betweenDay == 7) {
AliyunSMS.tx(name, htname, time, phone); // 少于7天短信提醒
} else if (betweenDay == 30) {
AliyunSMS.tx(name, htname, time, phone); // 少于30天短信提醒
}
} else {
zzda.setTxkgType(1); // 关闭提醒
zzda.updateById();
}
}
}
}
package cn.timer.api.utils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.timer.api.bean.htzz.HtzzAdminZzda;
import cn.timer.api.bean.htzz.HtzzAssoHtgx;
/**
* 记录当前时间循环输出 遍历合同提醒关系表,每天固定时间(8点)查询是否提醒
*
* @author Administrator
*
*/
@Component
@Lazy(false)
@EnableScheduling
public class RemindUtil {
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
/**
* 间隔时间提醒 10min/次
*/
@Scheduled(fixedRate = 30 * 60 * 1000)
private void now() {
System.err.println("当前时间:" + dateFormat.format(new Date()));
}
/**
* 每天固定时间提醒
*/
@Scheduled(cron = "0 0 8 * * ?") // 每天8点扫一下看有没要提醒的,有就发一个
// @Scheduled(cron = "0 8 15 * * ?") // 测试合同提醒
public static void reportCurrentTime() {
List<HtzzAssoHtgx> htgxs = HtzzAssoHtgx.builder().build().selectAll();
for (HtzzAssoHtgx htgx : htgxs) {
QueryWrapper<HtzzAdminZzda> q = new QueryWrapper<HtzzAdminZzda>();
q.select("id", "zjmc", "txkg_type", "yxdqr").eq("id", htgx.getHtid()).eq("is_delete", 0).eq("txkg_type", 0);
HtzzAdminZzda zzda = HtzzAdminZzda.builder().build().selectOne(q);
if (zzda != null) {
String name = htgx.getName(); // 员工姓名
String phone = htgx.getPhone(); // 员工手机
String htname = zzda.getZjmc(); // 合同名称
Date now = new Date(); // 当前时间
Date dqsj = zzda.getYxdqr(); // 到期时间
String time = DateUtil.formatDate(dqsj); // 到期時間格式
Long betweenDay = DateUtil.between(dqsj, now, DateUnit.DAY); // 时间差天数
Long sjc = dqsj.getTime() - now.getTime(); // 时间差数值
System.err.println(betweenDay);
if (sjc > 0) {
if (betweenDay <= 1) {
AliyunSMS.tx(name, htname, time, phone); // 少于1天短信提醒
} else if (betweenDay == 3) {
AliyunSMS.tx(name, htname, time, phone); // 少于3天短信提醒
} else if (betweenDay == 7) {
AliyunSMS.tx(name, htname, time, phone); // 少于7天短信提醒
} else if (betweenDay == 30) {
AliyunSMS.tx(name, htname, time, phone); // 少于30天短信提醒
}
} else {
zzda.setTxkgType(1); // 关闭提醒
zzda.updateById();
}
}
}
}
}
\ No newline at end of file
#生产环境
server:
port: 8089
servlet:
# context-path: /YoulinghrApiV100
session:
timeout: 3600 # session会话过期时间
spring:
servlet:
multipart:
max-file-size: 20MB
max-request-size: 20MB
jpa:
# 配置生成表 存储引擎InnoDB
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# database:
open-in-view: false
# naming:
# spring boot jpa hibernate 根据实体类生成表以及字段的命名策略
# 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# 遇到大写字母 加”_”的命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
hibernate:
ddl-auto: update
show-sql: true
datasource:
# username: root
# password: youlingHR73!
username: youling8timer
password: (!0YouLing8Timer0!)
# username: tang
# password: Tang123456!
# url: jdbc:mysql://120.24.172.51:3306/youlingrc_tang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
url: jdbc:mysql://120.24.24.239:3306/8timer_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://192.168.172.200:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000 # 配置获取连接等待超时的时间
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位是毫秒
validation-query: SELECT 1 FROM DUAL
test-while-idle: true # 当连接空闲时,是否执行连接测试
test-on-borrow: false # 当从连接池借用连接时,是否测试该连接
test-on-return: false # 在连接归还到连接池时是否测试该连接
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters: stat,slf4j
use-global-data-source-stat: true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 配置监控服务器
stat-view-servlet:
login-username: Tang
login-password: 123
reset-enable: false
url-pattern: /druid/*
# 添加IP白名单
#allow:
# 添加IP黑名单,当白名单和黑名单重复时,黑名单优先级更高
#deny:
web-stat-filter:
# 添加过滤规则
url-pattern: /*
# 忽略过滤格式
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
# 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
# spring boot启动打印横幅 配置
banner:
charset: UTF-8 # Banner file encoding.
location: banner.txt # Banner text resource location.
image:
location: banner.gif # Banner image file location (jpg or png can also be used).
width: 76 # Width of the banner image in chars.
height: 76 # Height of the banner image in chars (default based on image height).
margin: 2 # Left hand image margin in chars.
invert: false # Whether images should be inverted for dark terminal themes.
# mybatis-plus
mybatis-plus:
mapper-locations: classpath:mapping/**/*Mapper.xml # dao到xml文件映射
type-aliases-package: cn.timer.api.bean # xml中#全局类名别名
configuration:
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # sql日志打印
call-setters-on-nulls: true # Map做返回体时 字段值为null依然返回
cache-enabled: true
global-config:
db-config:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
#id-type: uuid
id-type: auto
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
# field-strategy: not_null
#驼峰下划线转换
table-underline: true
#逻辑删除配置
#logic-delete-value: 0
#logic-not-delete-value: 1
# 分页插件
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
#showSql
logging:
level:
root: info
cn.timer.api.dao: error
pattern:
console: '--%p--%m%n'
#swagger:
# ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
#生产环境
server:
port: 8089
servlet:
# context-path: /YoulinghrApiV100
session:
timeout: 3600 # session会话过期时间
spring:
servlet:
multipart:
max-file-size: 20MB
max-request-size: 20MB
jpa:
# 配置生成表 存储引擎InnoDB
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# database:
open-in-view: false
# naming:
# spring boot jpa hibernate 根据实体类生成表以及字段的命名策略
# 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# 遇到大写字母 加”_”的命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
hibernate:
ddl-auto: update
show-sql: true
datasource:
# username: root
# password: youlingHR73!
username: youling8timer
password: (!0YouLing8Timer0!)
# username: tang
# password: Tang123456!
# url: jdbc:mysql://120.24.172.51:3306/youlingrc_tang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
url: jdbc:mysql://120.24.24.239:3306/8timer_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://192.168.172.200:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000 # 配置获取连接等待超时的时间
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位是毫秒
validation-query: SELECT 1 FROM DUAL
test-while-idle: true # 当连接空闲时,是否执行连接测试
test-on-borrow: false # 当从连接池借用连接时,是否测试该连接
test-on-return: false # 在连接归还到连接池时是否测试该连接
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters: stat,slf4j
use-global-data-source-stat: true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 配置监控服务器
stat-view-servlet:
login-username: Tang
login-password: 123
reset-enable: false
url-pattern: /druid/*
# 添加IP白名单
#allow:
# 添加IP黑名单,当白名单和黑名单重复时,黑名单优先级更高
#deny:
web-stat-filter:
# 添加过滤规则
url-pattern: /*
# 忽略过滤格式
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
# 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
# spring boot启动打印横幅 配置
banner:
charset: UTF-8 # Banner file encoding.
location: banner.txt # Banner text resource location.
image:
location: banner.gif # Banner image file location (jpg or png can also be used).
width: 76 # Width of the banner image in chars.
height: 76 # Height of the banner image in chars (default based on image height).
margin: 2 # Left hand image margin in chars.
invert: false # Whether images should be inverted for dark terminal themes.
# mybatis-plus
mybatis-plus:
mapper-locations: classpath:mapping/**/*Mapper.xml # dao到xml文件映射
type-aliases-package: cn.timer.api.bean # xml中#全局类名别名
configuration:
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # sql日志打印
call-setters-on-nulls: true # Map做返回体时 字段值为null依然返回
cache-enabled: true
global-config:
db-config:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
#id-type: uuid
id-type: auto
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
# field-strategy: not_null
#驼峰下划线转换
table-underline: true
#逻辑删除配置
#logic-delete-value: 0
#logic-not-delete-value: 1
# 分页插件
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
#showSql
logging:
level:
root: info
cn.timer.api.dao: error
pattern:
console: '--%p--%m%n'
#swagger:
# ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.yggl.YgglMainEmpMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.yggl.YgglMainEmp" >
<id column="id" property="id" />
<result column="emp_num" property="empNum" />
<result column="phone" property="phone" />
<result column="password" property="password" />
<result column="head_url" property="headUrl" />
<result column="name" property="name" />
<result column="english_name" property="englishName" />
<result column="sex" property="sex" />
<result column="zj_type" property="zjType" />
<result column="zj_num" property="zjNum" />
<result column="sfzyx_time" property="sfzyxTime" />
<result column="birthday" property="birthday" />
<result column="age" property="age" />
<result column="is_married" property="isMarried" />
<result column="is_pregnant" property="isPregnant" />
<result column="area" property="area" />
<result column="mz" property="mz" />
<result column="zzmm" property="zzmm" />
<result column="jg" property="jg" />
<result column="city" property="city" />
<result column="hk_type" property="hkType" />
<result column="hk_address" property="hkAddress" />
<result column="qq" property="qq" />
<result column="wechat" property="wechat" />
<result column="email" property="email" />
<result column="blood_type" property="bloodType" />
<result column="language" property="language" />
<result column="edu" property="edu" />
<result column="zy" property="zy" />
<result column="zz_remark" property="zzRemark" />
<result column="job_type" property="jobType" />
<result column="job_status" property="jobStatus" />
<result column="rz_time" property="rzTime" />
<result column="syq" property="syq" />
<result column="zz_time" property="zzTime" />
<result column="sjzz_time" property="sjzzTime" />
<result column="is_jrkq" property="isJrkq" />
<result column="job_num" property="jobNum" />
<result column="work_address" property="workAddress" />
<result column="work_phone" property="workPhone" />
<result column="work_email" property="workEmail" />
<result column="zpqd" property="zpqd" />
<result column="bmgw_id" property="bmgwId" />
<result column="org_code" property="orgCode" />
<result column="unionid" property="unionid" />
<result column="openid" property="openid" />
<result column="mpopenid" property="mpopenid" />
<result column="appopenid" property="appopenid" />
</resultMap>
<sql id="Base_Column_List">
id,
emp_num,
phone,
password,
head_url,
name,
english_name,
sex,
zj_type,
zj_num,
sfzyx_time,
birthday,
age,
is_married,
is_pregnant,
area,
mz,
zzmm,
jg,
city,
hk_type,
hk_address,
qq,
wechat,
email,
blood_type,
language,
edu,
zy,
zz_remark,
job_type,
job_status,
rz_time,
syq,
zz_time,
sjzz_time,
is_jrkq,
job_num,
work_address,
work_phone,
work_email,
zpqd,
bmgw_id,
org_code,
unionid,
openid,
mpopenid,
appopenid
</sql>
<sql id="Base_Column_List_Alias">
id YgglMainEmp_id,
emp_num YgglMainEmp_emp_num,
phone YgglMainEmp_phone,
password YgglMainEmp_password,
head_url YgglMainEmp_head_url,
name YgglMainEmp_name,
english_name YgglMainEmp_english_name,
sex YgglMainEmp_sex,
zj_type YgglMainEmp_zj_type,
zj_num YgglMainEmp_zj_num,
sfzyx_time YgglMainEmp_sfzyx_time,
birthday YgglMainEmp_birthday,
age YgglMainEmp_age,
is_married YgglMainEmp_is_married,
is_pregnant YgglMainEmp_is_pregnant,
area YgglMainEmp_area,
mz YgglMainEmp_mz,
zzmm YgglMainEmp_zzmm,
jg YgglMainEmp_jg,
city YgglMainEmp_city,
hk_type YgglMainEmp_hk_type,
hk_address YgglMainEmp_hk_address,
qq YgglMainEmp_qq,
wechat YgglMainEmp_wechat,
email YgglMainEmp_email,
blood_type YgglMainEmp_blood_type,
language YgglMainEmp_language,
edu YgglMainEmp_edu,
zy YgglMainEmp_zy,
zz_remark YgglMainEmp_zz_remark,
job_type YgglMainEmp_job_type,
job_status YgglMainEmp_job_status,
rz_time YgglMainEmp_rz_time,
syq YgglMainEmp_syq,
zz_time YgglMainEmp_zz_time,
sjzz_time YgglMainEmp_sjzz_time,
is_jrkq YgglMainEmp_is_jrkq,
job_num YgglMainEmp_job_num,
work_address YgglMainEmp_work_address,
work_phone YgglMainEmp_work_phone,
work_email YgglMainEmp_work_email,
zpqd YgglMainEmp_zpqd,
bmgw_id YgglMainEmp_bmgw_id,
org_code YgglMainEmp_org_code,
unionid YgglMainEmp_unionid,
openid YgglMainEmp_openid,
mpopenid YgglMainEmp_mpopenid,
appopenid YgglMainEmp_appopenid
</sql>
<!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT
a. NAME empName,
a.emp_num empNum,
b. NAME deptName,
a.rz_time rzTime,
a.job_type jobType,
a.phone phone,
a.job_status jobStatus
FROM
yggl_main_emp a
LEFT JOIN zzgl_bmgw_m b ON a.bmgw_id = b.id
WHERE
a.org_code = #{orgCode}
AND
a.job_status != 4
ORDER BY
emp_num DESC
</select>
<!-- 查询在职员工(试用员工人数+正式员工人数) -->
<select id="queryInservice" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
SUM(job_status=1) AS probation,
SUM(job_status=2) AS regular
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询当月入职人数 -->
<select id="queryInduction" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM rz_time) AS month,
COUNT(emp_num) induction
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询本月转正人数 -->
<select id="queryPositive" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM sjzz_time) AS month,
COUNT(emp_num) positive
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询员工平均年龄 -->
<select id="queryAvgAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
avg(age) avgAge
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询岗位上级部门id及名称及人数 -->
<select id="queryDepartmentNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(c.name,'null') updeptname,
IFNULL(b.up_id,0) updeptid,
count(1) updeptnum
FROM
yggl_main_emp y
LEFT JOIN zzgl_bmgw_m b ON y.bmgw_id = b.id
LEFT JOIN zzgl_bmgw_m c ON c.id = b.up_id
WHERE
y.org_code = #{orgCode}
GROUP BY
c.name,
b.up_id
</select>
<!-- 查询岗位名称及人数 -->
<select id="queryJobsNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(b.name,'null') jobname,
IFNULL(y.bmgw_id,0) jobid,
count(1) jobnum
FROM
yggl_main_emp y
LEFT JOIN zzgl_bmgw_m b ON y.bmgw_id = b.id
WHERE
y.org_code = #{orgCode}
GROUP BY
y.bmgw_id,
b.name;
</select>
<!-- 学历及人数查询 -->
<select id="queryEducation" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(e.name,'null') education,count(y.edu) educationNum
FROM
yggl_main_emp y
LEFT JOIN
education_class e
ON
y.edu = e.id
WHERE
org_code = #{orgCode}
GROUP BY
e.name
ORDER BY
e.id ASC
</select>
<!-- 员工年龄分布查询 -->
<select id="queryEmpAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SUM((CASE WHEN age < 0.5 THEN 1 ELSE 0 END)) AS lowerEighteen,
SUM((CASE WHEN age >= 18 AND age < 25 THEN 1 ELSE 0 END)) AS eighteenToTwentyfive,
SUM((CASE WHEN age >= 25 AND age < 32 THEN 1 ELSE 0 END)) AS twentyfiveToThirtytwo,
SUM((CASE WHEN age >= 32 AND age < 38 THEN 1 ELSE 0 END)) AS thirtytwoToThirtyeight,
SUM((CASE WHEN age >= 38 AND age < 45 THEN 1 ELSE 0 END)) AS thirtyeightToFortyfive,
SUM((CASE WHEN age >=45 THEN 1 ELSE 0 END)) AS higherFortyfive
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
<!-- 籍贯统计(省份)查询 -->
<select id="queryNativeplace" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(c.name,'null') province,count(y.jg) provinceNum
FROM
yggl_main_emp y
LEFT JOIN
city_class c
ON
y.jg = c.id
WHERE
org_code = #{orgCode}
GROUP BY
c.name
</select>
<!-- 员工工龄分布查询 -->
<select id="queryWorkingAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 < 0.5 THEN 1 ELSE 0 END)) AS lowerHalfyear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 0.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1 THEN 1 ELSE 0 END)) AS halfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1.5 THEN 1 ELSE 0 END)) AS oneYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2 THEN 1 ELSE 0 END)) AS onehalfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 2 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2.5 THEN 1 ELSE 0 END)) AS twoYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >=2.5 THEN 1 ELSE 0 END)) AS higherTwohalfYear
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.yggl.YgglMainEmp">
INSERT INTO yggl_main_emp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != empNum'>
emp_num,
</if>
<if test ='null != phone'>
phone,
</if>
<if test ='null != password'>
password,
</if>
<if test ='null != headUrl'>
head_url,
</if>
<if test ='null != name'>
name,
</if>
<if test ='null != englishName'>
english_name,
</if>
<if test ='null != sex'>
sex,
</if>
<if test ='null != zjType'>
zj_type,
</if>
<if test ='null != zjNum'>
zj_num,
</if>
<if test ='null != sfzyxTime'>
sfzyx_time,
</if>
<if test ='null != birthday'>
birthday,
</if>
<if test ='null != age'>
age,
</if>
<if test ='null != isMarried'>
is_married,
</if>
<if test ='null != isPregnant'>
is_pregnant,
</if>
<if test ='null != area'>
area,
</if>
<if test ='null != mz'>
mz,
</if>
<if test ='null != zzmm'>
zzmm,
</if>
<if test ='null != jg'>
jg,
</if>
<if test ='null != city'>
city,
</if>
<if test ='null != hkType'>
hk_type,
</if>
<if test ='null != hkAddress'>
hk_address,
</if>
<if test ='null != qq'>
qq,
</if>
<if test ='null != wechat'>
wechat,
</if>
<if test ='null != email'>
email,
</if>
<if test ='null != bloodType'>
blood_type,
</if>
<if test ='null != language'>
language,
</if>
<if test ='null != edu'>
edu,
</if>
<if test ='null != zy'>
zy,
</if>
<if test ='null != zzRemark'>
zz_remark,
</if>
<if test ='null != jobType'>
job_type,
</if>
<if test ='null != jobStatus'>
job_status,
</if>
<if test ='null != rzTime'>
rz_time,
</if>
<if test ='null != syq'>
syq,
</if>
<if test ='null != zzTime'>
zz_time,
</if>
<if test ='null != sjzzTime'>
sjzz_time,
</if>
<if test ='null != isJrkq'>
is_jrkq,
</if>
<if test ='null != jobNum'>
job_num,
</if>
<if test ='null != workAddress'>
work_address,
</if>
<if test ='null != workPhone'>
work_phone,
</if>
<if test ='null != workEmail'>
work_email,
</if>
<if test ='null != zpqd'>
zpqd,
</if>
<if test ='null != bmgwId'>
bmgw_id,
</if>
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != unionid'>
unionid,
</if>
<if test ='null != openid'>
openid,
</if>
<if test ='null != mpopenid'>
mpopenid,
</if>
<if test ='null != appopenid'>
appopenid
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != empNum'>
#{empNum},
</if>
<if test ='null != phone'>
#{phone},
</if>
<if test ='null != password'>
#{password},
</if>
<if test ='null != headUrl'>
#{headUrl},
</if>
<if test ='null != name'>
#{name},
</if>
<if test ='null != englishName'>
#{englishName},
</if>
<if test ='null != sex'>
#{sex},
</if>
<if test ='null != zjType'>
#{zjType},
</if>
<if test ='null != zjNum'>
#{zjNum},
</if>
<if test ='null != sfzyxTime'>
#{sfzyxTime},
</if>
<if test ='null != birthday'>
#{birthday},
</if>
<if test ='null != age'>
#{age},
</if>
<if test ='null != isMarried'>
#{isMarried},
</if>
<if test ='null != isPregnant'>
#{isPregnant},
</if>
<if test ='null != area'>
#{area},
</if>
<if test ='null != mz'>
#{mz},
</if>
<if test ='null != zzmm'>
#{zzmm},
</if>
<if test ='null != jg'>
#{jg},
</if>
<if test ='null != city'>
#{city},
</if>
<if test ='null != hkType'>
#{hkType},
</if>
<if test ='null != hkAddress'>
#{hkAddress},
</if>
<if test ='null != qq'>
#{qq},
</if>
<if test ='null != wechat'>
#{wechat},
</if>
<if test ='null != email'>
#{email},
</if>
<if test ='null != bloodType'>
#{bloodType},
</if>
<if test ='null != language'>
#{language},
</if>
<if test ='null != edu'>
#{edu},
</if>
<if test ='null != zy'>
#{zy},
</if>
<if test ='null != zzRemark'>
#{zzRemark},
</if>
<if test ='null != jobType'>
#{jobType},
</if>
<if test ='null != jobStatus'>
#{jobStatus},
</if>
<if test ='null != rzTime'>
#{rzTime},
</if>
<if test ='null != syq'>
#{syq},
</if>
<if test ='null != zzTime'>
#{zzTime},
</if>
<if test ='null != sjzzTime'>
#{sjzzTime},
</if>
<if test ='null != isJrkq'>
#{isJrkq},
</if>
<if test ='null != jobNum'>
#{jobNum},
</if>
<if test ='null != workAddress'>
#{workAddress},
</if>
<if test ='null != workPhone'>
#{workPhone},
</if>
<if test ='null != workEmail'>
#{workEmail},
</if>
<if test ='null != zpqd'>
#{zpqd},
</if>
<if test ='null != bmgwId'>
#{bmgwId},
</if>
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != unionid'>
#{unionid},
</if>
<if test ='null != openid'>
#{openid},
</if>
<if test ='null != mpopenid'>
#{mpopenid},
</if>
<if test ='null != appopenid'>
#{appopenid}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM yggl_main_emp
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.yggl.YgglMainEmp">
UPDATE yggl_main_emp
<set>
<if test ='null != empNum'>emp_num = #{empNum},</if>
<if test ='null != phone'>phone = #{phone},</if>
<if test ='null != password'>password = #{password},</if>
<if test ='null != headUrl'>head_url = #{headUrl},</if>
<if test ='null != name'>name = #{name},</if>
<if test ='null != englishName'>english_name = #{englishName},</if>
<if test ='null != sex'>sex = #{sex},</if>
<if test ='null != zjType'>zj_type = #{zjType},</if>
<if test ='null != zjNum'>zj_num = #{zjNum},</if>
<if test ='null != sfzyxTime'>sfzyx_time = #{sfzyxTime},</if>
<if test ='null != birthday'>birthday = #{birthday},</if>
<if test ='null != age'>age = #{age},</if>
<if test ='null != isMarried'>is_married = #{isMarried},</if>
<if test ='null != isPregnant'>is_pregnant = #{isPregnant},</if>
<if test ='null != area'>area = #{area},</if>
<if test ='null != mz'>mz = #{mz},</if>
<if test ='null != zzmm'>zzmm = #{zzmm},</if>
<if test ='null != jg'>jg = #{jg},</if>
<if test ='null != city'>city = #{city},</if>
<if test ='null != hkType'>hk_type = #{hkType},</if>
<if test ='null != hkAddress'>hk_address = #{hkAddress},</if>
<if test ='null != qq'>qq = #{qq},</if>
<if test ='null != wechat'>wechat = #{wechat},</if>
<if test ='null != email'>email = #{email},</if>
<if test ='null != bloodType'>blood_type = #{bloodType},</if>
<if test ='null != language'>language = #{language},</if>
<if test ='null != edu'>edu = #{edu},</if>
<if test ='null != zy'>zy = #{zy},</if>
<if test ='null != zzRemark'>zz_remark = #{zzRemark},</if>
<if test ='null != jobType'>job_type = #{jobType},</if>
<if test ='null != jobStatus'>job_status = #{jobStatus},</if>
<if test ='null != rzTime'>rz_time = #{rzTime},</if>
<if test ='null != syq'>syq = #{syq},</if>
<if test ='null != zzTime'>zz_time = #{zzTime},</if>
<if test ='null != sjzzTime'>sjzz_time = #{sjzzTime},</if>
<if test ='null != isJrkq'>is_jrkq = #{isJrkq},</if>
<if test ='null != jobNum'>job_num = #{jobNum},</if>
<if test ='null != workAddress'>work_address = #{workAddress},</if>
<if test ='null != workPhone'>work_phone = #{workPhone},</if>
<if test ='null != workEmail'>work_email = #{workEmail},</if>
<if test ='null != zpqd'>zpqd = #{zpqd},</if>
<if test ='null != bmgwId'>bmgw_id = #{bmgwId},</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != unionid'>unionid = #{unionid},</if>
<if test ='null != openid'>openid = #{openid},</if>
<if test ='null != mpopenid'>mpopenid = #{mpopenid},</if>
<if test ='null != appopenid'>appopenid = #{appopenid}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM yggl_main_emp
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM yggl_main_emp
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM yggl_main_emp
</select>
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.yggl.YgglMainEmpMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.yggl.YgglMainEmp" >
<id column="id" property="id" />
<result column="emp_num" property="empNum" />
<result column="phone" property="phone" />
<result column="password" property="password" />
<result column="head_url" property="headUrl" />
<result column="name" property="name" />
<result column="english_name" property="englishName" />
<result column="sex" property="sex" />
<result column="zj_type" property="zjType" />
<result column="zj_num" property="zjNum" />
<result column="sfzyx_time" property="sfzyxTime" />
<result column="birthday" property="birthday" />
<result column="age" property="age" />
<result column="is_married" property="isMarried" />
<result column="is_pregnant" property="isPregnant" />
<result column="area" property="area" />
<result column="mz" property="mz" />
<result column="zzmm" property="zzmm" />
<result column="jg" property="jg" />
<result column="city" property="city" />
<result column="hk_type" property="hkType" />
<result column="hk_address" property="hkAddress" />
<result column="qq" property="qq" />
<result column="wechat" property="wechat" />
<result column="email" property="email" />
<result column="blood_type" property="bloodType" />
<result column="language" property="language" />
<result column="edu" property="edu" />
<result column="zy" property="zy" />
<result column="zz_remark" property="zzRemark" />
<result column="job_type" property="jobType" />
<result column="job_status" property="jobStatus" />
<result column="rz_time" property="rzTime" />
<result column="syq" property="syq" />
<result column="zz_time" property="zzTime" />
<result column="sjzz_time" property="sjzzTime" />
<result column="is_jrkq" property="isJrkq" />
<result column="job_num" property="jobNum" />
<result column="work_address" property="workAddress" />
<result column="work_phone" property="workPhone" />
<result column="work_email" property="workEmail" />
<result column="zpqd" property="zpqd" />
<result column="bmgw_id" property="bmgwId" />
<result column="org_code" property="orgCode" />
<result column="unionid" property="unionid" />
<result column="openid" property="openid" />
<result column="mpopenid" property="mpopenid" />
<result column="appopenid" property="appopenid" />
</resultMap>
<resultMap id="Bintu" type="cn.timer.api.dto.yggl.YgbintuDto" >
<id column="id" property="id" />
<result column="age" property="age" />
<result column="bmgwId" property="bmgwId" />
<result column="gw" property="gw" />
<result column="bm" property="bm" />
<result column="proname" property="proname" />
<result column="eduname" property="eduname" />
<result column="jobStatus" property="jobStatus" />
<result column="workage" property="workage" />
</resultMap>
<sql id="Base_Column_List">
id,
emp_num,
phone,
password,
head_url,
name,
english_name,
sex,
zj_type,
zj_num,
sfzyx_time,
birthday,
age,
is_married,
is_pregnant,
area,
mz,
zzmm,
jg,
city,
hk_type,
hk_address,
qq,
wechat,
email,
blood_type,
language,
edu,
zy,
zz_remark,
job_type,
job_status,
rz_time,
syq,
zz_time,
sjzz_time,
is_jrkq,
job_num,
work_address,
work_phone,
work_email,
zpqd,
bmgw_id,
org_code,
unionid,
openid,
mpopenid,
appopenid
</sql>
<sql id="Base_Column_List_Alias">
id YgglMainEmp_id,
emp_num YgglMainEmp_emp_num,
phone YgglMainEmp_phone,
password YgglMainEmp_password,
head_url YgglMainEmp_head_url,
name YgglMainEmp_name,
english_name YgglMainEmp_english_name,
sex YgglMainEmp_sex,
zj_type YgglMainEmp_zj_type,
zj_num YgglMainEmp_zj_num,
sfzyx_time YgglMainEmp_sfzyx_time,
birthday YgglMainEmp_birthday,
age YgglMainEmp_age,
is_married YgglMainEmp_is_married,
is_pregnant YgglMainEmp_is_pregnant,
area YgglMainEmp_area,
mz YgglMainEmp_mz,
zzmm YgglMainEmp_zzmm,
jg YgglMainEmp_jg,
city YgglMainEmp_city,
hk_type YgglMainEmp_hk_type,
hk_address YgglMainEmp_hk_address,
qq YgglMainEmp_qq,
wechat YgglMainEmp_wechat,
email YgglMainEmp_email,
blood_type YgglMainEmp_blood_type,
language YgglMainEmp_language,
edu YgglMainEmp_edu,
zy YgglMainEmp_zy,
zz_remark YgglMainEmp_zz_remark,
job_type YgglMainEmp_job_type,
job_status YgglMainEmp_job_status,
rz_time YgglMainEmp_rz_time,
syq YgglMainEmp_syq,
zz_time YgglMainEmp_zz_time,
sjzz_time YgglMainEmp_sjzz_time,
is_jrkq YgglMainEmp_is_jrkq,
job_num YgglMainEmp_job_num,
work_address YgglMainEmp_work_address,
work_phone YgglMainEmp_work_phone,
work_email YgglMainEmp_work_email,
zpqd YgglMainEmp_zpqd,
bmgw_id YgglMainEmp_bmgw_id,
org_code YgglMainEmp_org_code,
unionid YgglMainEmp_unionid,
openid YgglMainEmp_openid,
mpopenid YgglMainEmp_mpopenid,
appopenid YgglMainEmp_appopenid
</sql>
<!-- rsybp人事仪表盘 -->
<select id="rsybp" resultMap="Bintu">
SELECT e.id AS id,e.age AS age,e.bmgw_id AS bmgwId,b.`name` AS gw,bb.`name` AS bm, p.`name` AS proname,d.`name` AS eduname,e.job_status AS jobStatus,datediff(CURDATE(),e.rz_time) AS workage
FROM yggl_main_emp e
LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id
LEFT JOIN zzgl_bmgw_m bb ON bb.id = b.up_id
LEFT JOIN province_class p ON left (e.`jg`,2) = p.province
LEFT JOIN education_class d ON d.number = e.edu
WHERE e.org_code = 117 AND b.org_code =117;
</select>
<!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT
a. NAME empName,
a.emp_num empNum,
b. NAME deptName,
a.rz_time rzTime,
a.job_type jobType,
a.phone phone,
a.job_status jobStatus
FROM
yggl_main_emp a
LEFT JOIN zzgl_bmgw_m b ON a.bmgw_id = b.id
WHERE
a.org_code = #{orgCode}
AND
a.job_status != 4
ORDER BY
emp_num DESC
</select>
<!-- 查询在职员工(试用员工人数+正式员工人数) -->
<select id="queryInservice" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
SUM(job_status=1) AS probation,
SUM(job_status=2) AS regular
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询当月入职人数 -->
<select id="queryInduction" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM rz_time) AS month,
COUNT(emp_num) induction
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询本月转正人数 -->
<select id="queryPositive" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM sjzz_time) AS month,
COUNT(emp_num) positive
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询员工平均年龄 -->
<select id="queryAvgAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
avg(age) avgAge
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询岗位上级部门id及名称及人数 -->
<select id="queryDepartmentNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(c.name,'null') updeptname,
IFNULL(b.up_id,0) updeptid,
count(1) updeptnum
FROM
yggl_main_emp y
LEFT JOIN zzgl_bmgw_m b ON y.bmgw_id = b.id
LEFT JOIN zzgl_bmgw_m c ON c.id = b.up_id
WHERE
y.org_code = #{orgCode}
GROUP BY
c.name,
b.up_id
</select>
<!-- 查询岗位名称及人数 -->
<select id="queryJobsNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(b.name,'null') jobname,
IFNULL(y.bmgw_id,0) jobid,
count(1) jobnum
FROM
yggl_main_emp y
LEFT JOIN zzgl_bmgw_m b ON y.bmgw_id = b.id
WHERE
y.org_code = #{orgCode}
GROUP BY
y.bmgw_id,
b.name;
</select>
<!-- 学历及人数查询 -->
<select id="queryEducation" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(e.name,'null') education,count(y.edu) educationNum
FROM
yggl_main_emp y
LEFT JOIN
education_class e
ON
y.edu = e.id
WHERE
org_code = #{orgCode}
GROUP BY
e.name
ORDER BY
e.id ASC
</select>
<!-- 员工年龄分布查询 -->
<select id="queryEmpAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SUM((CASE WHEN age < 0.5 THEN 1 ELSE 0 END)) AS lowerEighteen,
SUM((CASE WHEN age >= 18 AND age < 25 THEN 1 ELSE 0 END)) AS eighteenToTwentyfive,
SUM((CASE WHEN age >= 25 AND age < 32 THEN 1 ELSE 0 END)) AS twentyfiveToThirtytwo,
SUM((CASE WHEN age >= 32 AND age < 38 THEN 1 ELSE 0 END)) AS thirtytwoToThirtyeight,
SUM((CASE WHEN age >= 38 AND age < 45 THEN 1 ELSE 0 END)) AS thirtyeightToFortyfive,
SUM((CASE WHEN age >=45 THEN 1 ELSE 0 END)) AS higherFortyfive
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
<!-- 籍贯统计(省份)查询 -->
<select id="queryNativeplace" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
IFNULL(c.name,'null') province,count(y.jg) provinceNum
FROM
yggl_main_emp y
LEFT JOIN
city_class c
ON
y.jg = c.id
WHERE
org_code = #{orgCode}
GROUP BY
c.name
</select>
<!-- 员工工龄分布查询 -->
<select id="queryWorkingAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 < 0.5 THEN 1 ELSE 0 END)) AS lowerHalfyear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 0.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1 THEN 1 ELSE 0 END)) AS halfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1.5 THEN 1 ELSE 0 END)) AS oneYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2 THEN 1 ELSE 0 END)) AS onehalfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 2 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2.5 THEN 1 ELSE 0 END)) AS twoYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >=2.5 THEN 1 ELSE 0 END)) AS higherTwohalfYear
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.yggl.YgglMainEmp">
INSERT INTO yggl_main_emp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != empNum'>
emp_num,
</if>
<if test ='null != phone'>
phone,
</if>
<if test ='null != password'>
password,
</if>
<if test ='null != headUrl'>
head_url,
</if>
<if test ='null != name'>
name,
</if>
<if test ='null != englishName'>
english_name,
</if>
<if test ='null != sex'>
sex,
</if>
<if test ='null != zjType'>
zj_type,
</if>
<if test ='null != zjNum'>
zj_num,
</if>
<if test ='null != sfzyxTime'>
sfzyx_time,
</if>
<if test ='null != birthday'>
birthday,
</if>
<if test ='null != age'>
age,
</if>
<if test ='null != isMarried'>
is_married,
</if>
<if test ='null != isPregnant'>
is_pregnant,
</if>
<if test ='null != area'>
area,
</if>
<if test ='null != mz'>
mz,
</if>
<if test ='null != zzmm'>
zzmm,
</if>
<if test ='null != jg'>
jg,
</if>
<if test ='null != city'>
city,
</if>
<if test ='null != hkType'>
hk_type,
</if>
<if test ='null != hkAddress'>
hk_address,
</if>
<if test ='null != qq'>
qq,
</if>
<if test ='null != wechat'>
wechat,
</if>
<if test ='null != email'>
email,
</if>
<if test ='null != bloodType'>
blood_type,
</if>
<if test ='null != language'>
language,
</if>
<if test ='null != edu'>
edu,
</if>
<if test ='null != zy'>
zy,
</if>
<if test ='null != zzRemark'>
zz_remark,
</if>
<if test ='null != jobType'>
job_type,
</if>
<if test ='null != jobStatus'>
job_status,
</if>
<if test ='null != rzTime'>
rz_time,
</if>
<if test ='null != syq'>
syq,
</if>
<if test ='null != zzTime'>
zz_time,
</if>
<if test ='null != sjzzTime'>
sjzz_time,
</if>
<if test ='null != isJrkq'>
is_jrkq,
</if>
<if test ='null != jobNum'>
job_num,
</if>
<if test ='null != workAddress'>
work_address,
</if>
<if test ='null != workPhone'>
work_phone,
</if>
<if test ='null != workEmail'>
work_email,
</if>
<if test ='null != zpqd'>
zpqd,
</if>
<if test ='null != bmgwId'>
bmgw_id,
</if>
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != unionid'>
unionid,
</if>
<if test ='null != openid'>
openid,
</if>
<if test ='null != mpopenid'>
mpopenid,
</if>
<if test ='null != appopenid'>
appopenid
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != empNum'>
#{empNum},
</if>
<if test ='null != phone'>
#{phone},
</if>
<if test ='null != password'>
#{password},
</if>
<if test ='null != headUrl'>
#{headUrl},
</if>
<if test ='null != name'>
#{name},
</if>
<if test ='null != englishName'>
#{englishName},
</if>
<if test ='null != sex'>
#{sex},
</if>
<if test ='null != zjType'>
#{zjType},
</if>
<if test ='null != zjNum'>
#{zjNum},
</if>
<if test ='null != sfzyxTime'>
#{sfzyxTime},
</if>
<if test ='null != birthday'>
#{birthday},
</if>
<if test ='null != age'>
#{age},
</if>
<if test ='null != isMarried'>
#{isMarried},
</if>
<if test ='null != isPregnant'>
#{isPregnant},
</if>
<if test ='null != area'>
#{area},
</if>
<if test ='null != mz'>
#{mz},
</if>
<if test ='null != zzmm'>
#{zzmm},
</if>
<if test ='null != jg'>
#{jg},
</if>
<if test ='null != city'>
#{city},
</if>
<if test ='null != hkType'>
#{hkType},
</if>
<if test ='null != hkAddress'>
#{hkAddress},
</if>
<if test ='null != qq'>
#{qq},
</if>
<if test ='null != wechat'>
#{wechat},
</if>
<if test ='null != email'>
#{email},
</if>
<if test ='null != bloodType'>
#{bloodType},
</if>
<if test ='null != language'>
#{language},
</if>
<if test ='null != edu'>
#{edu},
</if>
<if test ='null != zy'>
#{zy},
</if>
<if test ='null != zzRemark'>
#{zzRemark},
</if>
<if test ='null != jobType'>
#{jobType},
</if>
<if test ='null != jobStatus'>
#{jobStatus},
</if>
<if test ='null != rzTime'>
#{rzTime},
</if>
<if test ='null != syq'>
#{syq},
</if>
<if test ='null != zzTime'>
#{zzTime},
</if>
<if test ='null != sjzzTime'>
#{sjzzTime},
</if>
<if test ='null != isJrkq'>
#{isJrkq},
</if>
<if test ='null != jobNum'>
#{jobNum},
</if>
<if test ='null != workAddress'>
#{workAddress},
</if>
<if test ='null != workPhone'>
#{workPhone},
</if>
<if test ='null != workEmail'>
#{workEmail},
</if>
<if test ='null != zpqd'>
#{zpqd},
</if>
<if test ='null != bmgwId'>
#{bmgwId},
</if>
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != unionid'>
#{unionid},
</if>
<if test ='null != openid'>
#{openid},
</if>
<if test ='null != mpopenid'>
#{mpopenid},
</if>
<if test ='null != appopenid'>
#{appopenid}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM yggl_main_emp
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.yggl.YgglMainEmp">
UPDATE yggl_main_emp
<set>
<if test ='null != empNum'>emp_num = #{empNum},</if>
<if test ='null != phone'>phone = #{phone},</if>
<if test ='null != password'>password = #{password},</if>
<if test ='null != headUrl'>head_url = #{headUrl},</if>
<if test ='null != name'>name = #{name},</if>
<if test ='null != englishName'>english_name = #{englishName},</if>
<if test ='null != sex'>sex = #{sex},</if>
<if test ='null != zjType'>zj_type = #{zjType},</if>
<if test ='null != zjNum'>zj_num = #{zjNum},</if>
<if test ='null != sfzyxTime'>sfzyx_time = #{sfzyxTime},</if>
<if test ='null != birthday'>birthday = #{birthday},</if>
<if test ='null != age'>age = #{age},</if>
<if test ='null != isMarried'>is_married = #{isMarried},</if>
<if test ='null != isPregnant'>is_pregnant = #{isPregnant},</if>
<if test ='null != area'>area = #{area},</if>
<if test ='null != mz'>mz = #{mz},</if>
<if test ='null != zzmm'>zzmm = #{zzmm},</if>
<if test ='null != jg'>jg = #{jg},</if>
<if test ='null != city'>city = #{city},</if>
<if test ='null != hkType'>hk_type = #{hkType},</if>
<if test ='null != hkAddress'>hk_address = #{hkAddress},</if>
<if test ='null != qq'>qq = #{qq},</if>
<if test ='null != wechat'>wechat = #{wechat},</if>
<if test ='null != email'>email = #{email},</if>
<if test ='null != bloodType'>blood_type = #{bloodType},</if>
<if test ='null != language'>language = #{language},</if>
<if test ='null != edu'>edu = #{edu},</if>
<if test ='null != zy'>zy = #{zy},</if>
<if test ='null != zzRemark'>zz_remark = #{zzRemark},</if>
<if test ='null != jobType'>job_type = #{jobType},</if>
<if test ='null != jobStatus'>job_status = #{jobStatus},</if>
<if test ='null != rzTime'>rz_time = #{rzTime},</if>
<if test ='null != syq'>syq = #{syq},</if>
<if test ='null != zzTime'>zz_time = #{zzTime},</if>
<if test ='null != sjzzTime'>sjzz_time = #{sjzzTime},</if>
<if test ='null != isJrkq'>is_jrkq = #{isJrkq},</if>
<if test ='null != jobNum'>job_num = #{jobNum},</if>
<if test ='null != workAddress'>work_address = #{workAddress},</if>
<if test ='null != workPhone'>work_phone = #{workPhone},</if>
<if test ='null != workEmail'>work_email = #{workEmail},</if>
<if test ='null != zpqd'>zpqd = #{zpqd},</if>
<if test ='null != bmgwId'>bmgw_id = #{bmgwId},</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != unionid'>unionid = #{unionid},</if>
<if test ='null != openid'>openid = #{openid},</if>
<if test ='null != mpopenid'>mpopenid = #{mpopenid},</if>
<if test ='null != appopenid'>appopenid = #{appopenid}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM yggl_main_emp
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM yggl_main_emp
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM yggl_main_emp
</select>
-->
</mapper>
\ 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