Repository: lenve/vhr
Branch: master
Commit: 03abbd35af24
Files: 202
Total size: 2.0 MB
Directory structure:
gitextract_awylcubm/
├── .gitattributes
├── .gitignore
├── About.md
├── README.md
├── README_zh.md
├── vhr/
│ ├── mailserver/
│ │ ├── .gitignore
│ │ ├── .mvn/
│ │ │ └── wrapper/
│ │ │ ├── MavenWrapperDownloader.java
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ │ ├── mvnw
│ │ ├── mvnw.cmd
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ └── org/
│ │ │ │ └── javaboy/
│ │ │ │ └── mailserver/
│ │ │ │ ├── MailserverApplication.java
│ │ │ │ └── receiver/
│ │ │ │ └── MailReceiver.java
│ │ │ └── resources/
│ │ │ ├── application.properties
│ │ │ └── templates/
│ │ │ └── mail.html
│ │ └── test/
│ │ └── java/
│ │ └── org/
│ │ └── javaboy/
│ │ └── mailserver/
│ │ └── MailserverApplicationTests.java
│ ├── pom.xml
│ └── vhrserver/
│ ├── pom.xml
│ ├── vhr-mapper/
│ │ ├── pom.xml
│ │ └── src/
│ │ └── main/
│ │ └── java/
│ │ └── org/
│ │ └── javaboy/
│ │ └── vhr/
│ │ └── mapper/
│ │ ├── AdjustSalaryMapper.java
│ │ ├── AdjustSalaryMapper.xml
│ │ ├── AppraiseMapper.java
│ │ ├── AppraiseMapper.xml
│ │ ├── DepartmentMapper.java
│ │ ├── DepartmentMapper.xml
│ │ ├── EmpSalaryMapper.java
│ │ ├── EmpSalaryMapper.xml
│ │ ├── EmployeeMapper.java
│ │ ├── EmployeeMapper.xml
│ │ ├── EmployeeecMapper.java
│ │ ├── EmployeeecMapper.xml
│ │ ├── EmployeeremoveMapper.java
│ │ ├── EmployeeremoveMapper.xml
│ │ ├── EmployeetrainMapper.java
│ │ ├── EmployeetrainMapper.xml
│ │ ├── HrMapper.java
│ │ ├── HrMapper.xml
│ │ ├── HrRoleMapper.java
│ │ ├── HrRoleMapper.xml
│ │ ├── JobLevelMapper.java
│ │ ├── JobLevelMapper.xml
│ │ ├── MailSendLogMapper.java
│ │ ├── MailSendLogMapper.xml
│ │ ├── MenuMapper.java
│ │ ├── MenuMapper.xml
│ │ ├── MenuRoleMapper.java
│ │ ├── MenuRoleMapper.xml
│ │ ├── MsgContentMapper.java
│ │ ├── MsgContentMapper.xml
│ │ ├── NationMapper.java
│ │ ├── NationMapper.xml
│ │ ├── OpLogMapper.java
│ │ ├── OpLogMapper.xml
│ │ ├── PoliticsstatusMapper.java
│ │ ├── PoliticsstatusMapper.xml
│ │ ├── PositionMapper.java
│ │ ├── PositionMapper.xml
│ │ ├── RoleMapper.java
│ │ ├── RoleMapper.xml
│ │ ├── SalaryMapper.java
│ │ ├── SalaryMapper.xml
│ │ ├── SysMsgMapper.java
│ │ └── SysMsgMapper.xml
│ ├── vhr-model/
│ │ ├── pom.xml
│ │ └── src/
│ │ └── main/
│ │ └── java/
│ │ └── org/
│ │ └── javaboy/
│ │ └── vhr/
│ │ └── model/
│ │ ├── AdjustSalary.java
│ │ ├── Appraise.java
│ │ ├── ChatMsg.java
│ │ ├── Department.java
│ │ ├── EmpSalary.java
│ │ ├── Employee.java
│ │ ├── Employeeec.java
│ │ ├── Employeeremove.java
│ │ ├── Employeetrain.java
│ │ ├── Hr.java
│ │ ├── HrRole.java
│ │ ├── JobLevel.java
│ │ ├── MailConstants.java
│ │ ├── MailSendLog.java
│ │ ├── Menu.java
│ │ ├── MenuRole.java
│ │ ├── Meta.java
│ │ ├── MsgContent.java
│ │ ├── Nation.java
│ │ ├── OpLog.java
│ │ ├── Politicsstatus.java
│ │ ├── Position.java
│ │ ├── RespBean.java
│ │ ├── RespPageBean.java
│ │ ├── Role.java
│ │ ├── Salary.java
│ │ └── SysMsg.java
│ ├── vhr-service/
│ │ ├── pom.xml
│ │ └── src/
│ │ └── main/
│ │ └── java/
│ │ └── org/
│ │ └── javaboy/
│ │ └── vhr/
│ │ ├── config/
│ │ │ └── RabbitConfig.java
│ │ ├── service/
│ │ │ ├── DepartmentService.java
│ │ │ ├── EmployeeService.java
│ │ │ ├── HrService.java
│ │ │ ├── JobLevelService.java
│ │ │ ├── MailSendLogService.java
│ │ │ ├── MenuService.java
│ │ │ ├── NationService.java
│ │ │ ├── PoliticsstatusService.java
│ │ │ ├── PositionService.java
│ │ │ ├── RoleService.java
│ │ │ └── SalaryService.java
│ │ ├── task/
│ │ │ └── MailSendTask.java
│ │ └── utils/
│ │ ├── HrUtils.java
│ │ └── POIUtils.java
│ └── vhr-web/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── org/
│ │ │ └── javaboy/
│ │ │ └── vhr/
│ │ │ ├── VhrApplication.java
│ │ │ ├── config/
│ │ │ │ ├── CustomFilterInvocationSecurityMetadataSource.java
│ │ │ │ ├── CustomUrlDecisionManager.java
│ │ │ │ ├── FastDFSUtils.java
│ │ │ │ ├── LoginFilter.java
│ │ │ │ ├── SecurityConfig.java
│ │ │ │ ├── VerificationCode.java
│ │ │ │ └── WebSocketConfig.java
│ │ │ ├── controller/
│ │ │ │ ├── ChatController.java
│ │ │ │ ├── HrInfoController.java
│ │ │ │ ├── LoginController.java
│ │ │ │ ├── WsController.java
│ │ │ │ ├── config/
│ │ │ │ │ └── SystemConfigController.java
│ │ │ │ ├── emp/
│ │ │ │ │ └── EmpBasicController.java
│ │ │ │ ├── salary/
│ │ │ │ │ ├── SalaryController.java
│ │ │ │ │ └── SobConfigController.java
│ │ │ │ └── system/
│ │ │ │ ├── HrController.java
│ │ │ │ └── basic/
│ │ │ │ ├── DepartmentController.java
│ │ │ │ ├── JobLevelController.java
│ │ │ │ ├── PermissController.java
│ │ │ │ └── PositionController.java
│ │ │ ├── converter/
│ │ │ │ └── DateConverter.java
│ │ │ └── exception/
│ │ │ └── GlobalExceptionHandler.java
│ │ └── resources/
│ │ ├── application.yml
│ │ ├── db/
│ │ │ └── migration/
│ │ │ └── V1__vhr.sql
│ │ ├── fastdfs-client.properties
│ │ └── static/
│ │ ├── css/
│ │ │ ├── app.4e8a7623.css
│ │ │ ├── chunk-0c17a57a.42916da5.css
│ │ │ ├── chunk-64435448.3755e146.css
│ │ │ └── chunk-vendors.c805ba07.css
│ │ ├── index.html
│ │ └── js/
│ │ ├── app.36643c7a.js
│ │ ├── chunk-0c17a57a.3d783b80.js
│ │ ├── chunk-18458ebc.2dd3c93a.js
│ │ ├── chunk-2d0d03c8.3a093d55.js
│ │ ├── chunk-2d237c54.0b312051.js
│ │ ├── chunk-33b8cd94.a94483af.js
│ │ ├── chunk-4e552d82.57eb10c5.js
│ │ ├── chunk-64435448.c8d2ed8f.js
│ │ ├── chunk-df7e035a.c9947309.js
│ │ └── chunk-vendors.0a8f9d11.js
│ └── test/
│ └── java/
│ └── org/
│ └── javaboy/
│ └── vhr/
│ └── VhrApplicationTests.java
├── vhr.sql
└── vuehr/
├── .gitignore
├── README.md
├── babel.config.js
├── package.json
├── public/
│ └── index.html
├── src/
│ ├── App.vue
│ ├── components/
│ │ ├── chat/
│ │ │ ├── card.vue
│ │ │ ├── list.vue
│ │ │ ├── message.vue
│ │ │ └── usertext.vue
│ │ └── sys/
│ │ └── basic/
│ │ ├── DepMana.vue
│ │ ├── EcMana.vue
│ │ ├── JobLevelMana.vue
│ │ ├── PermissMana.vue
│ │ └── PosMana.vue
│ ├── main.js
│ ├── router.js
│ ├── store/
│ │ └── index.js
│ ├── utils/
│ │ ├── api.js
│ │ ├── menus.js
│ │ ├── mymessage.js
│ │ ├── sockjs.js
│ │ └── stomp.js
│ └── views/
│ ├── Home.vue
│ ├── HrInfo.vue
│ ├── Login.vue
│ ├── chat/
│ │ └── FriendChat.vue
│ ├── emp/
│ │ ├── EmpAdv.vue
│ │ └── EmpBasic.vue
│ ├── per/
│ │ ├── PerEc.vue
│ │ ├── PerEmp.vue
│ │ ├── PerMv.vue
│ │ ├── PerSalary.vue
│ │ └── PerTrain.vue
│ ├── sal/
│ │ ├── SalMonth.vue
│ │ ├── SalSearch.vue
│ │ ├── SalSob.vue
│ │ ├── SalSobCfg.vue
│ │ └── SalTable.vue
│ ├── sta/
│ │ ├── StaAll.vue
│ │ ├── StaPers.vue
│ │ ├── StaRecord.vue
│ │ └── StaScore.vue
│ └── sys/
│ ├── SysBasic.vue
│ ├── SysCfg.vue
│ ├── SysData.vue
│ ├── SysHr.vue
│ ├── SysInit.vue
│ └── SysLog.vue
└── vue.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
*.css linguist-language=Java
*.less linguist-language=Java
*.js linguist-language=Java
*.html linguist-language=Java
*.vue linguist-language=Java
================================================
FILE: .gitignore
================================================
node_modules/
.DS_Store
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
target/
*.iml
!.mvn/wrapper/maven-wrapper.jar
vhr.wiki
人事管理系统需求规格说明书.doc
================================================
FILE: About.md
================================================
vhr 在发布后,受到了很多小伙伴的关注,因此我也陆陆续续写了很多介绍的文章和相关的视频,但是一直都比较零散,这里将 vhr 相关的视频和文章列一个索引出来,供大家参考。
### 相关视频:
1. [Spring Boot 整合 RabbitMQ,消息重复消费怎么办?](https://mp.weixin.qq.com/s/SMPyyZlRvvKM-kSMbOOQAw)
2. [如何在微人事项目中提高RabbitMQ消息可靠性的?](https://mp.weixin.qq.com/s/aMu1qi46FbzIe0amJ4XJ7w)
3. [手把手教你给微人事添加登录验证码](https://mp.weixin.qq.com/s/aaop_dS9UIOgTtQd0hl_tw)
4. [使用 Spring Security 实现微人事前后端分离登录接口](https://mp.weixin.qq.com/s/eun-ChD5KyN6LsbR9qFfiQ)
5. [Spring Boot 在后端如何控制前端 Vue 中菜单动态加载?](https://mp.weixin.qq.com/s/rH5MeKuTnXbyaDaGsU4wNw)
6. [Spring Boot + Vue,手把手教你做文件上传](https://mp.weixin.qq.com/s/OMgoUfH8lk8hDfuqWXGWTA)
7. [Spring Boot+Vue+FastDFS 实现前后端分离文件上传](https://mp.weixin.qq.com/s/tIFyi2EiQRhdaOZi7bMoGw)
8. [Spring Boot+Vue前后端分离,如何避免前端页面 404](https://mp.weixin.qq.com/s/rXhXFXDhyYDP4F47Uat1DQ)
9. [Spring Security 如何动态更新已登录用户信息?](https://mp.weixin.qq.com/s/jQZx4i4-vqjpBjpoJKJF4A)
10. [手把手带你捋一遍 Spring Security 登录流程](https://mp.weixin.qq.com/s/z6GeR5O-vBzY3SHehmccVA)
11. [手把手教你部署前后端分离项目,再也不用担心跨域问题了](https://mp.weixin.qq.com/s/KWBtHi_au_1pH70OYptjfA)
12. [Spring Boot 结合 WebSocket 实现在线聊天](https://mp.weixin.qq.com/s/Rrj7oco3K8kJBsTxEEdz9g)
13. [说出来你可能不信,Spring Boot 中 Session 共享不超过 5 行代码!](https://mp.weixin.qq.com/s/sgjm09_e8ue5blXqPgeXZA)
### 相关文章:
1. [简化微人事部署,Flyway 搞起来](https://mp.weixin.qq.com/s/yabpyA90D1yUtWRNr330yA)
2. [GitHub 又掉链子,我给微人事 + Spring Boot + Spring Cloud 案例找了新家](https://mp.weixin.qq.com/s/yvJXiX70iNSdd2mbSQbUCQ)
3. [两年了,微人事项目迎来了一次重大更新](https://mp.weixin.qq.com/s/Eo2RRB6zKQuPDMWlnCHDrw)
4. [前后端分离开发中动态菜单的两种实现方案](https://mp.weixin.qq.com/s/NV7pRVnR6sLSjI2Snjl_aQ)
5. [Spring Security 前后端分离登录,非法请求直接返回 JSON](https://mp.weixin.qq.com/s/24pI8CG1zZU4KxOYhizV_g)
6. [使用 Nginx 部署前后端分离项目,解决跨域问题](https://mp.weixin.qq.com/s/C7PIck3SIPPTcA3NX3ELoQ)
7. [喜大普奔,两个开源的 Spring Boot + Vue 前后端分离项目可以在线体验了](https://mp.weixin.qq.com/s/GvqLzCZngQiMqVE_ZTafeA)
8. [前后端分离历险记](https://mp.weixin.qq.com/s/szgfT3tnYMCHSeiE3_QnpA)
9. [公司倒闭 1 年了,而我当年的项目上了 GitHub 热榜](https://mp.weixin.qq.com/s/qGFo2MKkD0AObBJDPR8veQ)
================================================
FILE: README.md
================================================
#### vhr 是一个脚手架,如需业务完整的项目,请移步这里->[TienChin](https://github.com/lenve/tienchin)
#### 本项目已使用 SpringBoot3+Vue3 重构,地址:[https://github.com/lenve/vhr2.0](https://github.com/lenve/vhr2.0)
## 项目介绍
微人事是一个前后端分离的人力资源管理系统,项目采用 SpringBoot+Vue 开发,项目加入常见的企业级应用所涉及到的技术点,例如 Redis、RabbitMQ 等。
- 项目地址:[https://github.com/lenve/vhr](https://github.com/lenve/vhr)
- [项目部署视频教程(旧版)](https://mp.weixin.qq.com/s/qN01Le434FWom0c3jqiQmA)
- [项目部署视频教程(新版)](https://mp.weixin.qq.com/s/dcJv6BIVFPnokI8nBf4IrQ)
- [项目其他相关资料](./README_zh.md)
### 项目技术栈
#### 后端技术栈
1. Spring Boot
2. Spring Security
3. MyBatis
4. MySQL
5. Redis
6. RabbitMQ
7. Spring Cache
8. WebSocket
9. ...
#### 前端技术栈
1. Vue
2. ElementUI
3. axios
4. vue-router
5. Vuex
6. WebSocket
7. vue-cli4
8. ...
### 项目效果图
首先,不同的用户在登录成功之后,根据不同的角色,会看到不同的系统菜单,完整菜单如下:

不同用户登录上来之后,可能看到的会有差异,如下:

每个用户的角色是由系统管理员进行分配的,系统管理员给用户分配角色的页面如下:

系统管理员也可以管理不同角色可以操作的资源,页面如下:

## 快速部署
1. clone 项目到本地 `git@github.com:lenve/vhr.git`
2. 数据库脚本使用 Flyway 管理,**不需要手动导入数据库脚本**,只需要提前在本地 MySQL 中创建一个空的数据库 vhr,并修改项目中关于数据的配置(resources 目录下的 application.properties 文件中)即可
3. 提前准备好 Redis,在 项目的 application.properties 文件中,将 Redis 配置改为自己的
4. 提前准备好 RabbitMQ,在项目的 application.properties 文件中将 RabbitMQ 的配置改为自己的(**注意,RabbitMQ 需要分别修改 mailserver 和 vhrserver 的配置文件**)
5. 在 IntelliJ IDEA 中打开 vhr 项目,启动 mailserver 模块
6. 运行 vhrserver 中的 vhr-web 模块
**OK,至此,服务端就启动成功了,此时我们直接在地址栏输入 `http://localhost:8081/index.html` 即可访问我们的项目,如果要做二次开发,请继续看第七、八步。**
7. 进入到vuehr目录中,在命令行依次输入如下命令:
```
# 安装依赖
npm install
# 在 localhost:8080 启动项目
npm run serve
```
由于我在 vuehr 项目中已经配置了端口转发,将数据转发到 Spring Boot 上,因此项目启动之后,在浏览器中输入 `http://localhost:8080` 就可以访问我们的前端项目了,所有的请求通过端口转发将数据传到 Spring Boot 中(注意此时不要关闭 Sprin gBoot 项目)。
8. 最后可以用 WebStorm 等工具打开 vuehr 项目,继续开发,开发完成后,当项目要上线时,依然进入到 vuehr 目录,然后执行如下命令:
```
npm run build
```
该命令执行成功之后,vuehr 目录下生成一个 dist 文件夹,将该文件夹中的两个文件 static 和 index.html 拷贝到 Spring Boot 项目中 resources/static/ 目录下,然后就可以像第 6 步那样直接访问了(关于前后端分离部署,大家也可以参考这个[使用 Nginx 部署前后端分离项目,解决跨域问题](https://mp.weixin.qq.com/s/C7PIck3SIPPTcA3NX3ELoQ))。
**步骤 7 中需要大家对 NodeJS、NPM 等有一定的使用经验,不熟悉的小伙伴可以先自行搜索学习下,推荐 [Vue 官方教程](https://cn.vuejs.org/v2/guide/)。**
## 文档
文档是对项目开发过程中遇到的一些问题的详细记录,主要是为了帮助没有基础的小伙伴快速理解这个项目。
1. [权限数据库设计](https://github.com/lenve/vhr/wiki/1.%E6%9D%83%E9%99%90%E6%95%B0%E6%8D%AE%E5%BA%93%E8%AE%BE%E8%AE%A1)
2. [服务端环境搭建](https://github.com/lenve/vhr/wiki/2.%E6%9C%8D%E5%8A%A1%E7%AB%AF%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA)
3. [动态处理角色和资源的关系](https://github.com/lenve/vhr/wiki/3.%E5%8A%A8%E6%80%81%E5%A4%84%E7%90%86%E8%A7%92%E8%89%B2%E5%92%8C%E8%B5%84%E6%BA%90%E7%9A%84%E5%85%B3%E7%B3%BB)
4. [密码加密并加盐](https://github.com/lenve/vhr/wiki/4.%E5%AF%86%E7%A0%81%E5%8A%A0%E5%AF%86%E5%B9%B6%E5%8A%A0%E7%9B%90)
5. [服务端异常的统一处理](https://github.com/lenve/vhr/wiki/5.%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%BC%82%E5%B8%B8%E7%9A%84%E7%BB%9F%E4%B8%80%E5%A4%84%E7%90%86)
6. [axios 请求封装,请求异常统一处理](https://github.com/lenve/vhr/wiki/6.axios%E8%AF%B7%E6%B1%82%E5%B0%81%E8%A3%85,%E8%AF%B7%E6%B1%82%E5%BC%82%E5%B8%B8%E7%BB%9F%E4%B8%80%E5%A4%84%E7%90%86)
7. [将请求方法挂到Vue上](https://github.com/lenve/vhr/wiki/7.%E5%B0%86%E8%AF%B7%E6%B1%82%E6%96%B9%E6%B3%95%E6%8C%82%E5%88%B0Vue%E4%B8%8A)
8. [登录状态的保存](https://github.com/lenve/vhr/wiki/8.%E7%99%BB%E5%BD%95%E7%8A%B6%E6%80%81%E7%9A%84%E4%BF%9D%E5%AD%98)
9. [登录成功后动态加载组件](https://github.com/lenve/vhr/wiki/9.%E7%99%BB%E5%BD%95%E6%88%90%E5%8A%9F%E5%90%8E%E5%8A%A8%E6%80%81%E5%8A%A0%E8%BD%BD%E7%BB%84%E4%BB%B6)
10. [角色资源关系管理](https://github.com/lenve/vhr/wiki/10.%E8%A7%92%E8%89%B2%E8%B5%84%E6%BA%90%E5%85%B3%E7%B3%BB%E7%AE%A1%E7%90%86)
11. [用户角色关系管理](https://github.com/lenve/vhr/wiki/11.%E7%94%A8%E6%88%B7%E8%A7%92%E8%89%B2%E5%85%B3%E7%B3%BB%E7%AE%A1%E7%90%86)
### 更新记录
### 2018.1.10 更新
本次更新版本:v20180110
本次更新完成了部门管理功能,页面在 **[系统管理->基础信息设置->部门管理]**
>本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。
#### 相关文档:
12. [部门数据库设计与存储过程编写](https://github.com/lenve/vhr/wiki/12.%E9%83%A8%E9%97%A8%E6%95%B0%E6%8D%AE%E5%BA%93%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B%E7%BC%96%E5%86%99)
13. [递归查询与存储过程调用](https://github.com/lenve/vhr/wiki/13.%E9%80%92%E5%BD%92%E6%9F%A5%E8%AF%A2%E4%B8%8E%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B%E8%B0%83%E7%94%A8)
14. [Tree 树形控件使用要点](https://github.com/lenve/vhr/wiki/14.Tree%E6%A0%91%E5%BD%A2%E6%8E%A7%E4%BB%B6%E4%BD%BF%E7%94%A8%E8%A6%81%E7%82%B9)
### 2018.1.12 更新
本次更新版本:v20180112
本次更新完成了职称管理和职位管理,页面在 **[系统管理->基础信息设置->职位管理]** 和 **[系统管理->基础信息设置->职称管理]**
>本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。
#### 相关文档:
15. [职位管理和职称管理功能介绍](https://github.com/lenve/vhr/wiki/15.%E8%81%8C%E4%BD%8D%E7%AE%A1%E7%90%86%E5%92%8C%E8%81%8C%E7%A7%B0%E7%AE%A1%E7%90%86%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D)
16. [组件复用](https://github.com/lenve/vhr/wiki/16.%E7%BB%84%E4%BB%B6%E5%A4%8D%E7%94%A8)
17. [[题外话]利用 git 标签回退至任意版本](https://github.com/lenve/vhr/wiki/17.%5B%E9%A2%98%E5%A4%96%E8%AF%9D%5D%E5%88%A9%E7%94%A8git%E6%A0%87%E7%AD%BE%E5%9B%9E%E9%80%80%E8%87%B3%E4%BB%BB%E6%84%8F%E7%89%88%E6%9C%AC)
### 2018.1.15 更新
本次更新版本:v20180115
本次更新完成了员工基本信息管理,页面在 **[员工资料->基本资料]**
>本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。
#### 相关文档:
18. [员工基本信息管理功能介绍](https://github.com/lenve/vhr/wiki/18.%E5%91%98%E5%B7%A5%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D)
19. [Spring Boot 中自定义参数绑定](https://github.com/lenve/vhr/wiki/19.SpringBoot%E4%B8%AD%E8%87%AA%E5%AE%9A%E4%B9%89%E5%8F%82%E6%95%B0%E7%BB%91%E5%AE%9A)
### 2018.1.16 更新
本次更新版本:v20180116
本次更新完成了员工的高级搜索功能,页面在 **[员工资料->基本资料]**
#### 相关文档:
20. [高级搜索功能介绍](https://github.com/lenve/vhr/wiki/20.%E9%AB%98%E7%BA%A7%E6%90%9C%E7%B4%A2%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D)
### 2018.1.17 更新
本次更新版本:v20180117
本次更新完成了员工数据的导入导出功能,即可将员工数据导出为Excel,也可以将外部Excel导入到员工数据表中,页面在 **[员工资料->基本资料]**
#### 相关文档:
21. [Excel 导入导出效果图](https://github.com/lenve/vhr/wiki/21.Excel%E5%AF%BC%E5%85%A5%E5%AF%BC%E5%87%BA%E6%95%88%E6%9E%9C%E5%9B%BE)
22. [SpringMVC 文件下载的两种方式](https://github.com/lenve/vhr/wiki/22.SpringMVC%E6%96%87%E4%BB%B6%E4%B8%8B%E8%BD%BD%E7%9A%84%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F)
23. [POI 生成 Excel](https://github.com/lenve/vhr/wiki/23.POI%E7%94%9F%E6%88%90Excel)
24. [axios 下载文件](https://github.com/lenve/vhr/wiki/24.axios%E4%B8%8B%E8%BD%BD%E6%96%87%E4%BB%B6)
25. [使用 POI 实现 Excel 导入](https://github.com/lenve/vhr/wiki/25.%E4%BD%BF%E7%94%A8POI%E5%AE%9E%E7%8E%B0Excel%E5%AF%BC%E5%85%A5)
### 2018.1.19 更新
本次更新版本:v20180119
本次更新主要实现了当管理员添加一个用户时,添加成功后,会根据该用户的邮箱自动向用户发送一封欢迎入职邮件,页面在 **[员工资料->基本资料->添加员工]** 详情可以参考下面的文档。 **注意:邮件发送需要小伙伴小伙伴自己配置授权码,配置方式参考下面的文档,配置文件在[src/main/java/org/sang/common/EmailRunnable.java](https://github.com/lenve/vhr/blob/master/hrserver/src/main/java/org/sang/common/EmailRunnable.java)**
#### 相关文档:
26. [Spring Boot 中使用 Freemarker 邮件模板生成邮件](https://github.com/lenve/vhr/wiki/26.SpringBoot%E4%B8%AD%E4%BD%BF%E7%94%A8Freemarker%E9%82%AE%E4%BB%B6%E6%A8%A1%E6%9D%BF%E7%94%9F%E6%88%90%E9%82%AE%E4%BB%B6)
27. [Java 中邮件的发送](https://github.com/lenve/vhr/wiki/27.Java%E4%B8%AD%E9%82%AE%E4%BB%B6%E7%9A%84%E5%8F%91%E9%80%81)
28. [Spring Boot 中使用新线程发送邮件](https://github.com/lenve/vhr/wiki/28.SpringBoot%E4%B8%AD%E4%BD%BF%E7%94%A8%E6%96%B0%E7%BA%BF%E7%A8%8B%E5%8F%91%E9%80%81%E9%82%AE%E4%BB%B6)
### 2018.1.25 更新
本次更新版本:v20180125
本次更新主要完成了工资账套管理功能,页面在 **[薪资管理->工资账套管理]**
>本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。
#### 相关文档:
29. [工资账套管理功能介绍](https://github.com/lenve/vhr/wiki/29.%E5%B7%A5%E8%B5%84%E8%B4%A6%E5%A5%97%E7%AE%A1%E7%90%86%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D)
### 2018.1.26 更新
本次更新版本:v20180126
本次更新主要完成了员工账套设置功能,页面在 **[薪资管理->员工账套设置]**
>本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。
#### 相关文档:
30. [员工账套设置功能介绍](https://github.com/lenve/vhr/wiki/30.%E5%91%98%E5%B7%A5%E8%B4%A6%E5%A5%97%E8%AE%BE%E7%BD%AE%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D)
### 2018.2.2 更新
本次更新版本:v20180202
本次更新完成了HR在线聊天功能,页面在 **[Home页->右上角铃铛->好友聊天]**
#### 相关文档:
31. [在线聊天功能介绍](https://github.com/lenve/vhr/wiki/31.%E5%9C%A8%E7%BA%BF%E8%81%8A%E5%A4%A9%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D)
32. [在线聊天功能实现](https://github.com/lenve/vhr/wiki/32.%E5%9C%A8%E7%BA%BF%E8%81%8A%E5%A4%A9%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B0)
### 2018.2.5 更新
本次更新版本:v20180205
本次更新完成了管理员发送系统通知功能,页面在 **[Home页->右上角铃铛->系统通知]**
>本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。
#### 相关文档:
33. [系统通知功能实现](https://github.com/lenve/vhr/wiki/33.%E7%B3%BB%E7%BB%9F%E9%80%9A%E7%9F%A5%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B0)
### 2019.12.22 更新
本次更新版本:v20191222
本次更新是一次规模较大的更新,整个项目的版本得到升级,同时引入了多模块、RabbitMQ 等技术栈。
#### 相关文档
34. [两年了,微人事项目迎来了一次重大更新](https://mp.weixin.qq.com/s/Eo2RRB6zKQuPDMWlnCHDrw)
## 其他资料
[50+ 项目需求文档](https://github.com/lenve/javadoc)
## 参考
- [vue-chat](https://github.com/microzz/vue-chat)
## License
Copyright 2018 王松
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README_zh.md
================================================
**最新版部署视频教程:[前后端分离项目(微人事)常见部署问题汇总](https://mp.weixin.qq.com/s/dcJv6BIVFPnokI8nBf4IrQ)**
vhr 在发布后,受到了很多小伙伴的关注,因此我也陆陆续续写了很多介绍的文章和相关的视频,但是一直都比较零散,这里将 vhr 相关的视频和文章列一个索引出来,供大家参考。
### 1.相关视频:
1. [Spring Boot 整合 RabbitMQ,消息重复消费怎么办?](https://mp.weixin.qq.com/s/SMPyyZlRvvKM-kSMbOOQAw)
2. [如何在微人事项目中提高RabbitMQ消息可靠性的?](https://mp.weixin.qq.com/s/aMu1qi46FbzIe0amJ4XJ7w)
3. [手把手教你给微人事添加登录验证码](https://mp.weixin.qq.com/s/aaop_dS9UIOgTtQd0hl_tw)
4. [使用 Spring Security 实现微人事前后端分离登录接口](https://mp.weixin.qq.com/s/eun-ChD5KyN6LsbR9qFfiQ)
5. [Spring Boot 在后端如何控制前端 Vue 中菜单动态加载?](https://mp.weixin.qq.com/s/rH5MeKuTnXbyaDaGsU4wNw)
6. [Spring Boot + Vue,手把手教你做文件上传](https://mp.weixin.qq.com/s/OMgoUfH8lk8hDfuqWXGWTA)
7. [Spring Boot+Vue+FastDFS 实现前后端分离文件上传](https://mp.weixin.qq.com/s/tIFyi2EiQRhdaOZi7bMoGw)
8. [Spring Boot+Vue前后端分离,如何避免前端页面 404](https://mp.weixin.qq.com/s/rXhXFXDhyYDP4F47Uat1DQ)
9. [Spring Security 如何动态更新已登录用户信息?](https://mp.weixin.qq.com/s/jQZx4i4-vqjpBjpoJKJF4A)
10. [手把手带你捋一遍 Spring Security 登录流程](https://mp.weixin.qq.com/s/z6GeR5O-vBzY3SHehmccVA)
11. [手把手教你部署前后端分离项目,再也不用担心跨域问题了](https://mp.weixin.qq.com/s/KWBtHi_au_1pH70OYptjfA)
12. [Spring Boot 结合 WebSocket 实现在线聊天](https://mp.weixin.qq.com/s/Rrj7oco3K8kJBsTxEEdz9g)
13. [说出来你可能不信,Spring Boot 中 Session 共享不超过 5 行代码!](https://mp.weixin.qq.com/s/sgjm09_e8ue5blXqPgeXZA)
### 2.相关文章:
1. [简化微人事部署,Flyway 搞起来](https://mp.weixin.qq.com/s/yabpyA90D1yUtWRNr330yA)
2. [GitHub 又掉链子,我给微人事 + Spring Boot + Spring Cloud 案例找了新家](https://mp.weixin.qq.com/s/yvJXiX70iNSdd2mbSQbUCQ)
3. [两年了,微人事项目迎来了一次重大更新](https://mp.weixin.qq.com/s/Eo2RRB6zKQuPDMWlnCHDrw)
4. [前后端分离开发中动态菜单的两种实现方案](https://mp.weixin.qq.com/s/NV7pRVnR6sLSjI2Snjl_aQ)
5. [Spring Security 前后端分离登录,非法请求直接返回 JSON](https://mp.weixin.qq.com/s/24pI8CG1zZU4KxOYhizV_g)
6. [使用 Nginx 部署前后端分离项目,解决跨域问题](https://mp.weixin.qq.com/s/C7PIck3SIPPTcA3NX3ELoQ)
7. [喜大普奔,两个开源的 Spring Boot + Vue 前后端分离项目可以在线体验了](https://mp.weixin.qq.com/s/GvqLzCZngQiMqVE_ZTafeA)
8. [前后端分离历险记](https://mp.weixin.qq.com/s/szgfT3tnYMCHSeiE3_QnpA)
9. [公司倒闭 1 年了,而我当年的项目上了 GitHub 热榜](https://mp.weixin.qq.com/s/qGFo2MKkD0AObBJDPR8veQ)
### 3. 部署问题
#### 3.1 下载问题
有两个地方可以下载到最新版的微人事,如果在 GitHub 上下载失败,也可以从 Gitee 上下载。
- GitHub:[https://github.com/lenve/vhr](https://github.com/lenve/vhr)
- Gitee:[https://gitee.com/lenve/vhr](https://gitee.com/lenve/vhr)
#### 3.2 提前准备
准备三样东西:
- 空的 vhr 数据库
- redis
- rabbitmq
#### 3.3 项目导入
项目的 Maven 依赖下载失败,可以参考这篇文章:
[依赖下载失败解决方案](https://mp.weixin.qq.com/s/6PPYwrNestz-gvmB4ZkAqQ)
#### 3.4 项目配置
vhrserver 的 web 模块 application.properties 中配置三样:
- 数据库连接
- redis
- rabbitmq
启动 vhr-web 模块。如果只是看效果,可以不启动 mailserver 模块(如果要启动 mailserver,一定先配置 mailserver 的 redis,rabbitmq 以及 邮件发送配置信息,邮件发送配置,可以参考这篇文章:[Spring Boot 中邮件发送](https://mp.weixin.qq.com/s/FKyQNyPDQY8O25Hk2x7rKg))。
#### 3.5 二次开发
这个需要部署前端。前端在运行时,需要准备一个 nodejs。
用 webstorm 打开下载的前端项目。
前端项目打开后,需要在项目根目录下,执行 npm install。
默认安装比较慢,可以修改为淘宝的源。[下载源修改为淘宝](https://mp.weixin.qq.com/s/HWRYAR16vLE1XFep6_i1tA)
npm install 执行成功后,再执行 npm run serve 启动前端项目。
二次开发完成后,执行 npm run build 前端编译打包。把打包后的文件拷贝到后端。
上线部署参考这篇文章:[手把手教你部署前后端分离项目,再也不用担心跨域问题了](https://mp.weixin.qq.com/s/KWBtHi_au_1pH70OYptjfA)
================================================
FILE: vhr/mailserver/.gitignore
================================================
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
================================================
FILE: vhr/mailserver/.mvn/wrapper/MavenWrapperDownloader.java
================================================
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.5";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
================================================
FILE: vhr/mailserver/.mvn/wrapper/maven-wrapper.properties
================================================
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
================================================
FILE: vhr/mailserver/mvnw
================================================
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
================================================
FILE: vhr/mailserver/mvnw.cmd
================================================
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
================================================
FILE: vhr/mailserver/pom.xml
================================================
4.0.0
vhr
org.javaboy
1.0-SNAPSHOT
org.javaboy
mailserver
0.0.1-SNAPSHOT
mailserver
Demo project for Spring Boot
1.8
org.springframework.boot
spring-boot-starter-amqp
org.springframework.boot
spring-boot-starter-data-redis
org.springframework.boot
spring-boot-starter-mail
org.springframework.boot
spring-boot-starter-thymeleaf
org.javaboy
vhr-model
1.0-SNAPSHOT
org.springframework.boot
spring-boot-starter-test
test
org.junit.vintage
junit-vintage-engine
org.springframework.amqp
spring-rabbit-test
test
org.springframework.boot
spring-boot-maven-plugin
================================================
FILE: vhr/mailserver/src/main/java/org/javaboy/mailserver/MailserverApplication.java
================================================
package org.javaboy.mailserver;
import org.javaboy.vhr.model.MailConstants;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class MailserverApplication {
public static void main(String[] args) {
SpringApplication.run(MailserverApplication.class, args);
}
@Bean
Queue queue() {
return new Queue(MailConstants.MAIL_QUEUE_NAME);
}
}
================================================
FILE: vhr/mailserver/src/main/java/org/javaboy/mailserver/receiver/MailReceiver.java
================================================
package org.javaboy.mailserver.receiver;
import com.rabbitmq.client.Channel;
import org.javaboy.vhr.model.Employee;
import org.javaboy.vhr.model.MailConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.mail.MailProperties;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.stereotype.Component;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import java.io.IOException;
import java.util.Date;
/**
* @作者 江南一点雨
* @公众号 江南一点雨
* @微信号 a_java_boy
* @GitHub https://github.com/lenve
* @博客 http://wangsong.blog.csdn.net
* @网站 http://www.javaboy.org
* @时间 2019-11-24 7:59
*/
@Component
public class MailReceiver {
public static final Logger logger = LoggerFactory.getLogger(MailReceiver.class);
@Autowired
JavaMailSender javaMailSender;
@Autowired
MailProperties mailProperties;
@Autowired
TemplateEngine templateEngine;
@Autowired
StringRedisTemplate redisTemplate;
@RabbitListener(queues = MailConstants.MAIL_QUEUE_NAME)
public void handler(Message message, Channel channel) throws IOException {
Employee employee = (Employee) message.getPayload();
MessageHeaders headers = message.getHeaders();
Long tag = (Long) headers.get(AmqpHeaders.DELIVERY_TAG);
String msgId = (String) headers.get("spring_returned_message_correlation");
if (redisTemplate.opsForHash().entries("mail_log").containsKey(msgId)) {
//redis 中包含该 key,说明该消息已经被消费过
logger.info(msgId + ":消息已经被消费");
channel.basicAck(tag, false);//确认消息已消费
return;
}
//收到消息,发送邮件
MimeMessage msg = javaMailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(msg);
try {
helper.setTo(employee.getEmail());
helper.setFrom(mailProperties.getUsername());
helper.setSubject("入职欢迎");
helper.setSentDate(new Date());
Context context = new Context();
context.setVariable("name", employee.getName());
context.setVariable("posName", employee.getPosition().getName());
context.setVariable("joblevelName", employee.getJobLevel().getName());
context.setVariable("departmentName", employee.getDepartment().getName());
String mail = templateEngine.process("mail", context);
helper.setText(mail, true);
javaMailSender.send(msg);
redisTemplate.opsForHash().put("mail_log", msgId, "javaboy");
channel.basicAck(tag, false);
logger.info(msgId + ":邮件发送成功");
} catch (MessagingException e) {
channel.basicNack(tag, false, true);
e.printStackTrace();
logger.error("邮件发送失败:" + e.getMessage());
}
}
}
================================================
FILE: vhr/mailserver/src/main/resources/application.properties
================================================
server.port=8082
spring.mail.host=smtp.qq.com
spring.mail.protocol=smtp
spring.mail.default-encoding=UTF-8
spring.mail.password=
spring.mail.username=
spring.mail.port=587
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.debug=true
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.rabbitmq.host=192.168.91.128
spring.rabbitmq.port=5672
spring.rabbitmq.listener.simple.acknowledge-mode=manual
spring.rabbitmq.listener.simple.prefetch=100
spring.redis.host=192.168.91.128
spring.redis.port=6379
spring.redis.password=123
spring.redis.database=0
================================================
FILE: vhr/mailserver/src/main/resources/templates/mail.html
================================================
入职欢迎邮件
欢迎 加入 Java达摩院 大家庭,您的入职信息如下:
希望在未来的日子里,携手共进!
================================================
FILE: vhr/mailserver/src/test/java/org/javaboy/mailserver/MailserverApplicationTests.java
================================================
package org.javaboy.mailserver;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class MailserverApplicationTests {
@Test
void contextLoads() {
}
}
================================================
FILE: vhr/pom.xml
================================================
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.4.0
org.javaboy
vhr
pom
1.0-SNAPSHOT
vhrserver
mailserver
================================================
FILE: vhr/vhrserver/pom.xml
================================================
vhr
org.javaboy
1.0-SNAPSHOT
4.0.0
vhrserver
pom
vhr-mapper
vhr-model
vhr-service
vhr-web
================================================
FILE: vhr/vhrserver/vhr-mapper/pom.xml
================================================
vhrserver
org.javaboy
1.0-SNAPSHOT
4.0.0
vhr-mapper
org.javaboy
vhr-model
1.0-SNAPSHOT
org.mybatis.spring.boot
mybatis-spring-boot-starter
2.1.0
org.flywaydb
flyway-core
com.alibaba
druid-spring-boot-starter
1.1.10
src/main/java
**/*.xml
src/main/resources
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/AdjustSalaryMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.AdjustSalary;
public interface AdjustSalaryMapper {
int deleteByPrimaryKey(Integer id);
int insert(AdjustSalary record);
int insertSelective(AdjustSalary record);
AdjustSalary selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AdjustSalary record);
int updateByPrimaryKey(AdjustSalary record);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/AdjustSalaryMapper.xml
================================================
id, eid, asDate, beforeSalary, afterSalary, reason, remark
delete from adjustsalary
where id = #{id,jdbcType=INTEGER}
insert into adjustsalary (id, eid, asDate,
beforeSalary, afterSalary, reason,
remark)
values (#{id,jdbcType=INTEGER}, #{eid,jdbcType=INTEGER}, #{asdate,jdbcType=DATE},
#{beforesalary,jdbcType=INTEGER}, #{aftersalary,jdbcType=INTEGER}, #{reason,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
insert into adjustsalary
id,
eid,
asDate,
beforeSalary,
afterSalary,
reason,
remark,
#{id,jdbcType=INTEGER},
#{eid,jdbcType=INTEGER},
#{asdate,jdbcType=DATE},
#{beforesalary,jdbcType=INTEGER},
#{aftersalary,jdbcType=INTEGER},
#{reason,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
update adjustsalary
eid = #{eid,jdbcType=INTEGER},
asDate = #{asdate,jdbcType=DATE},
beforeSalary = #{beforesalary,jdbcType=INTEGER},
afterSalary = #{aftersalary,jdbcType=INTEGER},
reason = #{reason,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER}
update adjustsalary
set eid = #{eid,jdbcType=INTEGER},
asDate = #{asdate,jdbcType=DATE},
beforeSalary = #{beforesalary,jdbcType=INTEGER},
afterSalary = #{aftersalary,jdbcType=INTEGER},
reason = #{reason,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/AppraiseMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.Appraise;
public interface AppraiseMapper {
int deleteByPrimaryKey(Integer id);
int insert(Appraise record);
int insertSelective(Appraise record);
Appraise selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Appraise record);
int updateByPrimaryKey(Appraise record);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/AppraiseMapper.xml
================================================
id, eid, appDate, appResult, appContent, remark
delete from appraise
where id = #{id,jdbcType=INTEGER}
insert into appraise (id, eid, appDate,
appResult, appContent, remark
)
values (#{id,jdbcType=INTEGER}, #{eid,jdbcType=INTEGER}, #{appdate,jdbcType=DATE},
#{appresult,jdbcType=VARCHAR}, #{appcontent,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}
)
insert into appraise
id,
eid,
appDate,
appResult,
appContent,
remark,
#{id,jdbcType=INTEGER},
#{eid,jdbcType=INTEGER},
#{appdate,jdbcType=DATE},
#{appresult,jdbcType=VARCHAR},
#{appcontent,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
update appraise
eid = #{eid,jdbcType=INTEGER},
appDate = #{appdate,jdbcType=DATE},
appResult = #{appresult,jdbcType=VARCHAR},
appContent = #{appcontent,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER}
update appraise
set eid = #{eid,jdbcType=INTEGER},
appDate = #{appdate,jdbcType=DATE},
appResult = #{appresult,jdbcType=VARCHAR},
appContent = #{appcontent,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/DepartmentMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.Department;
import java.util.List;
public interface DepartmentMapper {
int deleteByPrimaryKey(Integer id);
int insert(Department record);
int insertSelective(Department record);
Department selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Department record);
int updateByPrimaryKey(Department record);
List getAllDepartmentsByParentId(Integer pid);
void addDep(Department dep);
void deleteDepById(Department dep);
List getAllDepartmentsWithOutChildren();
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/DepartmentMapper.xml
================================================
id, name, parentId, depPath, enabled, isParent
delete from department
where id = #{id,jdbcType=INTEGER}
insert into department (id, name, parentId,
depPath, enabled, isParent)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
#{depPath,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, #{isParent,jdbcType=BIT})
insert into department
id,
name,
parentId,
depPath,
enabled,
isParent,
#{id,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR},
#{parentId,jdbcType=INTEGER},
#{depPath,jdbcType=VARCHAR},
#{enabled,jdbcType=BIT},
#{isParent,jdbcType=BIT},
update department
name = #{name,jdbcType=VARCHAR},
parentId = #{parentId,jdbcType=INTEGER},
depPath = #{depPath,jdbcType=VARCHAR},
enabled = #{enabled,jdbcType=BIT},
isParent = #{isParent,jdbcType=BIT},
where id = #{id,jdbcType=INTEGER}
update department
set name = #{name,jdbcType=VARCHAR},
parentId = #{parentId,jdbcType=INTEGER},
depPath = #{depPath,jdbcType=VARCHAR},
enabled = #{enabled,jdbcType=BIT},
isParent = #{isParent,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmpSalaryMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.EmpSalary;
public interface EmpSalaryMapper {
int deleteByPrimaryKey(Integer id);
int insert(EmpSalary record);
int insertSelective(EmpSalary record);
EmpSalary selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(EmpSalary record);
int updateByPrimaryKey(EmpSalary record);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmpSalaryMapper.xml
================================================
id, eid, sid
delete from empsalary
where id = #{id,jdbcType=INTEGER}
insert into empsalary (id, eid, sid)
values (#{id,jdbcType=INTEGER}, #{eid,jdbcType=INTEGER}, #{sid,jdbcType=INTEGER})
insert into empsalary
id,
eid,
sid,
#{id,jdbcType=INTEGER},
#{eid,jdbcType=INTEGER},
#{sid,jdbcType=INTEGER},
update empsalary
eid = #{eid,jdbcType=INTEGER},
sid = #{sid,jdbcType=INTEGER},
where id = #{id,jdbcType=INTEGER}
update empsalary
set eid = #{eid,jdbcType=INTEGER},
sid = #{sid,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeeMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.apache.ibatis.annotations.Param;
import org.javaboy.vhr.model.Employee;
import java.util.Date;
import java.util.List;
public interface EmployeeMapper {
int deleteByPrimaryKey(Integer id);
int insert(Employee record);
int insertSelective(Employee record);
Employee selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Employee record);
int updateByPrimaryKey(Employee record);
List getEmployeeByPage(@Param("page") Integer page, @Param("size") Integer size, @Param("emp") Employee employee,@Param("beginDateScope") Date[] beginDateScope);
Long getTotal(@Param("emp") Employee employee,@Param("beginDateScope") Date[] beginDateScope);
Integer maxWorkID();
Integer addEmps(@Param("list") List list);
Employee getEmployeeById(Integer id);
List getEmployeeByPageWithSalary(@Param("page") Integer page, @Param("size") Integer size);
Integer updateEmployeeSalaryById(@Param("eid") Integer eid, @Param("sid") Integer sid);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeeMapper.xml
================================================
id, name, gender, birthday, idCard, wedlock, nationId, nativePlace, politicId, email,
phone, address, departmentId, jobLevelId, posId, engageForm, tiptopDegree, specialty,
school, beginDate, workState, workID, contractTerm, conversionTime, notWorkDate,
beginContract, endContract, workAge
REPLACE INTO empsalary (eid,sid) VALUES(#{eid},#{sid})
delete from employee
where id = #{id,jdbcType=INTEGER}
insert into employee (name, gender,
birthday, idCard, wedlock, nationId,
nativePlace, politicId, email,
phone, address, departmentId,
jobLevelId, posId, engageForm,
tiptopDegree, specialty, school,
beginDate, workState, workID,
contractTerm, conversionTime, notWorkDate,
beginContract, endContract, workAge
)
values
(#{emp.name,jdbcType=VARCHAR}, #{emp.gender,jdbcType=CHAR},
#{emp.birthday,jdbcType=DATE}, #{emp.idCard,jdbcType=CHAR}, #{emp.wedlock,jdbcType=CHAR},
#{emp.nationId,jdbcType=INTEGER},
#{emp.nativePlace,jdbcType=VARCHAR}, #{emp.politicId,jdbcType=INTEGER}, #{emp.email,jdbcType=VARCHAR},
#{emp.phone,jdbcType=VARCHAR}, #{emp.address,jdbcType=VARCHAR}, #{emp.departmentId,jdbcType=INTEGER},
#{emp.jobLevelId,jdbcType=INTEGER}, #{emp.posId,jdbcType=INTEGER}, #{emp.engageForm,jdbcType=VARCHAR},
#{emp.tiptopDegree,jdbcType=CHAR}, #{emp.specialty,jdbcType=VARCHAR}, #{emp.school,jdbcType=VARCHAR},
#{emp.beginDate,jdbcType=DATE}, #{emp.workState,jdbcType=CHAR}, #{emp.workID,jdbcType=CHAR},
#{emp.contractTerm,jdbcType=DOUBLE}, #{emp.conversionTime,jdbcType=DATE}, #{emp.notWorkDate,jdbcType=DATE},
#{emp.beginContract,jdbcType=DATE}, #{emp.endContract,jdbcType=DATE}, #{emp.workAge,jdbcType=INTEGER}
)
insert into employee (id, name, gender,
birthday, idCard, wedlock, nationId,
nativePlace, politicId, email,
phone, address, departmentId,
jobLevelId, posId, engageForm,
tiptopDegree, specialty, school,
beginDate, workState, workID,
contractTerm, conversionTime, notWorkDate,
beginContract, endContract, workAge
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR},
#{birthday,jdbcType=DATE}, #{idCard,jdbcType=CHAR}, #{wedlock,jdbcType=CHAR}, #{nationId,jdbcType=INTEGER},
#{nativePlace,jdbcType=VARCHAR}, #{politicId,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{departmentId,jdbcType=INTEGER},
#{jobLevelId,jdbcType=INTEGER}, #{posId,jdbcType=INTEGER}, #{engageForm,jdbcType=VARCHAR},
#{tiptopDegree,jdbcType=CHAR}, #{specialty,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR},
#{beginDate,jdbcType=DATE}, #{workState,jdbcType=CHAR}, #{workID,jdbcType=CHAR},
#{contractTerm,jdbcType=DOUBLE}, #{conversionTime,jdbcType=DATE}, #{notWorkDate,jdbcType=DATE},
#{beginContract,jdbcType=DATE}, #{endContract,jdbcType=DATE}, #{workAge,jdbcType=INTEGER}
)
insert into employee
id,
name,
gender,
birthday,
idCard,
wedlock,
nationId,
nativePlace,
politicId,
email,
phone,
address,
departmentId,
jobLevelId,
posId,
engageForm,
tiptopDegree,
specialty,
school,
beginDate,
workState,
workID,
contractTerm,
conversionTime,
notWorkDate,
beginContract,
endContract,
workAge,
#{id,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR},
#{gender,jdbcType=CHAR},
#{birthday,jdbcType=DATE},
#{idCard,jdbcType=CHAR},
#{wedlock,jdbcType=CHAR},
#{nationId,jdbcType=INTEGER},
#{nativePlace,jdbcType=VARCHAR},
#{politicId,jdbcType=INTEGER},
#{email,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR},
#{departmentId,jdbcType=INTEGER},
#{jobLevelId,jdbcType=INTEGER},
#{posId,jdbcType=INTEGER},
#{engageForm,jdbcType=VARCHAR},
#{tiptopDegree,jdbcType=CHAR},
#{specialty,jdbcType=VARCHAR},
#{school,jdbcType=VARCHAR},
#{beginDate,jdbcType=DATE},
#{workState,jdbcType=CHAR},
#{workID,jdbcType=CHAR},
#{contractTerm,jdbcType=DOUBLE},
#{conversionTime,jdbcType=DATE},
#{notWorkDate,jdbcType=DATE},
#{beginContract,jdbcType=DATE},
#{endContract,jdbcType=DATE},
#{workAge,jdbcType=INTEGER},
update employee
name = #{name,jdbcType=VARCHAR},
gender = #{gender,jdbcType=CHAR},
birthday = #{birthday,jdbcType=DATE},
idCard = #{idCard,jdbcType=CHAR},
wedlock = #{wedlock,jdbcType=CHAR},
nationId = #{nationId,jdbcType=INTEGER},
nativePlace = #{nativePlace,jdbcType=VARCHAR},
politicId = #{politicId,jdbcType=INTEGER},
email = #{email,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
departmentId = #{departmentId,jdbcType=INTEGER},
jobLevelId = #{jobLevelId,jdbcType=INTEGER},
posId = #{posId,jdbcType=INTEGER},
engageForm = #{engageForm,jdbcType=VARCHAR},
tiptopDegree = #{tiptopDegree,jdbcType=CHAR},
specialty = #{specialty,jdbcType=VARCHAR},
school = #{school,jdbcType=VARCHAR},
beginDate = #{beginDate,jdbcType=DATE},
workState = #{workState,jdbcType=CHAR},
workID = #{workID,jdbcType=CHAR},
contractTerm = #{contractTerm,jdbcType=DOUBLE},
conversionTime = #{conversionTime,jdbcType=DATE},
notWorkDate = #{notWorkDate,jdbcType=DATE},
beginContract = #{beginContract,jdbcType=DATE},
endContract = #{endContract,jdbcType=DATE},
workAge = #{workAge,jdbcType=INTEGER},
where id = #{id,jdbcType=INTEGER}
update employee
set name = #{name,jdbcType=VARCHAR},
gender = #{gender,jdbcType=CHAR},
birthday = #{birthday,jdbcType=DATE},
idCard = #{idCard,jdbcType=CHAR},
wedlock = #{wedlock,jdbcType=CHAR},
nationId = #{nationId,jdbcType=INTEGER},
nativePlace = #{nativePlace,jdbcType=VARCHAR},
politicId = #{politicId,jdbcType=INTEGER},
email = #{email,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
departmentId = #{departmentId,jdbcType=INTEGER},
jobLevelId = #{jobLevelId,jdbcType=INTEGER},
posId = #{posId,jdbcType=INTEGER},
engageForm = #{engageForm,jdbcType=VARCHAR},
tiptopDegree = #{tiptopDegree,jdbcType=CHAR},
specialty = #{specialty,jdbcType=VARCHAR},
school = #{school,jdbcType=VARCHAR},
beginDate = #{beginDate,jdbcType=DATE},
workState = #{workState,jdbcType=CHAR},
workID = #{workID,jdbcType=CHAR},
contractTerm = #{contractTerm,jdbcType=DOUBLE},
conversionTime = #{conversionTime,jdbcType=DATE},
notWorkDate = #{notWorkDate,jdbcType=DATE},
beginContract = #{beginContract,jdbcType=DATE},
endContract = #{endContract,jdbcType=DATE},
workAge = #{workAge,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeeecMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.Employeeec;
public interface EmployeeecMapper {
int deleteByPrimaryKey(Integer id);
int insert(Employeeec record);
int insertSelective(Employeeec record);
Employeeec selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Employeeec record);
int updateByPrimaryKey(Employeeec record);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeeecMapper.xml
================================================
id, eid, ecDate, ecReason, ecPoint, ecType, remark
delete from employeeec
where id = #{id,jdbcType=INTEGER}
insert into employeeec (id, eid, ecDate,
ecReason, ecPoint, ecType,
remark)
values (#{id,jdbcType=INTEGER}, #{eid,jdbcType=INTEGER}, #{ecdate,jdbcType=DATE},
#{ecreason,jdbcType=VARCHAR}, #{ecpoint,jdbcType=INTEGER}, #{ectype,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR})
insert into employeeec
id,
eid,
ecDate,
ecReason,
ecPoint,
ecType,
remark,
#{id,jdbcType=INTEGER},
#{eid,jdbcType=INTEGER},
#{ecdate,jdbcType=DATE},
#{ecreason,jdbcType=VARCHAR},
#{ecpoint,jdbcType=INTEGER},
#{ectype,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
update employeeec
eid = #{eid,jdbcType=INTEGER},
ecDate = #{ecdate,jdbcType=DATE},
ecReason = #{ecreason,jdbcType=VARCHAR},
ecPoint = #{ecpoint,jdbcType=INTEGER},
ecType = #{ectype,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER}
update employeeec
set eid = #{eid,jdbcType=INTEGER},
ecDate = #{ecdate,jdbcType=DATE},
ecReason = #{ecreason,jdbcType=VARCHAR},
ecPoint = #{ecpoint,jdbcType=INTEGER},
ecType = #{ectype,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeeremoveMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.Employeeremove;
public interface EmployeeremoveMapper {
int deleteByPrimaryKey(Integer id);
int insert(Employeeremove record);
int insertSelective(Employeeremove record);
Employeeremove selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Employeeremove record);
int updateByPrimaryKey(Employeeremove record);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeeremoveMapper.xml
================================================
id, eid, afterDepId, afterJobId, removeDate, reason, remark
delete from employeeremove
where id = #{id,jdbcType=INTEGER}
insert into employeeremove (id, eid, afterDepId,
afterJobId, removeDate, reason,
remark)
values (#{id,jdbcType=INTEGER}, #{eid,jdbcType=INTEGER}, #{afterdepid,jdbcType=INTEGER},
#{afterjobid,jdbcType=INTEGER}, #{removedate,jdbcType=DATE}, #{reason,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
insert into employeeremove
id,
eid,
afterDepId,
afterJobId,
removeDate,
reason,
remark,
#{id,jdbcType=INTEGER},
#{eid,jdbcType=INTEGER},
#{afterdepid,jdbcType=INTEGER},
#{afterjobid,jdbcType=INTEGER},
#{removedate,jdbcType=DATE},
#{reason,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
update employeeremove
eid = #{eid,jdbcType=INTEGER},
afterDepId = #{afterdepid,jdbcType=INTEGER},
afterJobId = #{afterjobid,jdbcType=INTEGER},
removeDate = #{removedate,jdbcType=DATE},
reason = #{reason,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER}
update employeeremove
set eid = #{eid,jdbcType=INTEGER},
afterDepId = #{afterdepid,jdbcType=INTEGER},
afterJobId = #{afterjobid,jdbcType=INTEGER},
removeDate = #{removedate,jdbcType=DATE},
reason = #{reason,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeetrainMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.Employeetrain;
public interface EmployeetrainMapper {
int deleteByPrimaryKey(Integer id);
int insert(Employeetrain record);
int insertSelective(Employeetrain record);
Employeetrain selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Employeetrain record);
int updateByPrimaryKey(Employeetrain record);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/EmployeetrainMapper.xml
================================================
id, eid, trainDate, trainContent, remark
delete from employeetrain
where id = #{id,jdbcType=INTEGER}
insert into employeetrain (id, eid, trainDate,
trainContent, remark)
values (#{id,jdbcType=INTEGER}, #{eid,jdbcType=INTEGER}, #{traindate,jdbcType=DATE},
#{traincontent,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR})
insert into employeetrain
id,
eid,
trainDate,
trainContent,
remark,
#{id,jdbcType=INTEGER},
#{eid,jdbcType=INTEGER},
#{traindate,jdbcType=DATE},
#{traincontent,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
update employeetrain
eid = #{eid,jdbcType=INTEGER},
trainDate = #{traindate,jdbcType=DATE},
trainContent = #{traincontent,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER}
update employeetrain
set eid = #{eid,jdbcType=INTEGER},
trainDate = #{traindate,jdbcType=DATE},
trainContent = #{traincontent,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.apache.ibatis.annotations.Param;
import org.javaboy.vhr.model.Hr;
import org.javaboy.vhr.model.Role;
import java.util.List;
public interface HrMapper {
int deleteByPrimaryKey(Integer id);
int insert(Hr record);
int insertSelective(Hr record);
Hr selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Hr record);
int updateByPrimaryKey(Hr record);
Hr loadUserByUsername(String username);
List getHrRolesById(Integer id);
List
getAllHrs(@Param("hrid") Integer hrid, @Param("keywords") String keywords);
List
getAllHrsExceptCurrentHr(Integer id);
Integer updatePasswd(@Param("hrid") Integer hrid, @Param("encodePass") String encodePass);
Integer updateUserface(@Param("url") String url, @Param("id") Integer id);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.xml
================================================
id, name, phone, telephone, address, enabled, username, password, userface, remark
delete from hr
where id = #{id,jdbcType=INTEGER}
insert into hr (id, name, phone,
telephone, address, enabled,
username, password, userface,
remark)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{phone,jdbcType=CHAR},
#{telephone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT},
#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{userface,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
insert into hr
id,
name,
phone,
telephone,
address,
enabled,
username,
password,
userface,
remark,
#{id,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR},
#{phone,jdbcType=CHAR},
#{telephone,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR},
#{enabled,jdbcType=BIT},
#{username,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR},
#{userface,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
update hr
name = #{name,jdbcType=VARCHAR},
phone = #{phone,jdbcType=CHAR},
telephone = #{telephone,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
enabled = #{enabled,jdbcType=BIT},
username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
userface = #{userface,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER}
update hr set userface = #{url} where id=#{id};
update hr set password = #{encodePass} where id=#{hrid};
update hr
set name = #{name,jdbcType=VARCHAR},
phone = #{phone,jdbcType=CHAR},
telephone = #{telephone,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
enabled = #{enabled,jdbcType=BIT},
username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
userface = #{userface,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrRoleMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.apache.ibatis.annotations.Param;
import org.javaboy.vhr.model.HrRole;
public interface HrRoleMapper {
int deleteByPrimaryKey(Integer id);
int insert(HrRole record);
int insertSelective(HrRole record);
HrRole selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(HrRole record);
int updateByPrimaryKey(HrRole record);
void deleteByHrid(Integer hrid);
Integer addRole(@Param("hrid") Integer hrid, @Param("rids") Integer[] rids);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrRoleMapper.xml
================================================
id, hrid, rid
delete from hr_role where hrid=#{hrid}
insert into hr_role (hrid,rid) values
(#{hrid},#{rid})
delete from hr_role
where id = #{id,jdbcType=INTEGER}
insert into hr_role (id, hrid, rid
)
values (#{id,jdbcType=INTEGER}, #{hrid,jdbcType=INTEGER}, #{rid,jdbcType=INTEGER}
)
insert into hr_role
id,
hrid,
rid,
#{id,jdbcType=INTEGER},
#{hrid,jdbcType=INTEGER},
#{rid,jdbcType=INTEGER},
update hr_role
hrid = #{hrid,jdbcType=INTEGER},
rid = #{rid,jdbcType=INTEGER},
where id = #{id,jdbcType=INTEGER}
update hr_role
set hrid = #{hrid,jdbcType=INTEGER},
rid = #{rid,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/JobLevelMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.apache.ibatis.annotations.Param;
import org.javaboy.vhr.model.JobLevel;
import java.util.List;
public interface JobLevelMapper {
int deleteByPrimaryKey(Integer id);
int insert(JobLevel record);
int insertSelective(JobLevel record);
JobLevel selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(JobLevel record);
int updateByPrimaryKey(JobLevel record);
List getAllJobLevels();
Integer deleteJobLevelsByIds(@Param("ids") Integer[] ids);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/JobLevelMapper.xml
================================================
id, name, titleLevel, createDate, enabled
delete from joblevel where id in
#{id}
delete from joblevel
where id = #{id,jdbcType=INTEGER}
insert into joblevel (id, name, titleLevel,
createDate, enabled)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{titleLevel,jdbcType=CHAR},
#{createDate,jdbcType=TIMESTAMP}, #{enabled,jdbcType=BIT})
insert into joblevel
id,
name,
titleLevel,
createDate,
enabled,
#{id,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR},
#{titleLevel,jdbcType=CHAR},
#{createDate,jdbcType=TIMESTAMP},
#{enabled,jdbcType=BIT},
update joblevel
name = #{name,jdbcType=VARCHAR},
titleLevel = #{titleLevel,jdbcType=CHAR},
createDate = #{createDate,jdbcType=TIMESTAMP},
enabled = #{enabled,jdbcType=BIT},
where id = #{id,jdbcType=INTEGER}
update joblevel
set name = #{name,jdbcType=VARCHAR},
titleLevel = #{titleLevel,jdbcType=CHAR},
createDate = #{createDate,jdbcType=TIMESTAMP},
enabled = #{enabled,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/MailSendLogMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.apache.ibatis.annotations.Param;
import org.javaboy.vhr.model.MailSendLog;
import java.util.Date;
import java.util.List;
public interface MailSendLogMapper {
Integer updateMailSendLogStatus(@Param("msgId") String msgId, @Param("status") Integer status);
Integer insert(MailSendLog mailSendLog);
List getMailSendLogsByStatus();
Integer updateCount(@Param("msgId") String msgId, @Param("date") Date date);
}
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/MailSendLogMapper.xml
================================================
update mail_send_log set status = #{status} where msgId=#{msgId};
insert into mail_send_log (msgId,empId,routeKey,exchange,tryTime,createTime) values (#{msgId},#{empId},#{routeKey},#{exchange},#{tryTime},#{createTime});
update mail_send_log set count=count+1,updateTime=#{date} where msgId=#{msgId};
================================================
FILE: vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/MenuMapper.java
================================================
package org.javaboy.vhr.mapper;
import org.javaboy.vhr.model.Menu;
import java.util.List;
public interface MenuMapper {
int deleteByPrimaryKey(Integer id);
int insert(Menu record);
int insertSelective(Menu record);
Menu selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Menu record);
int updateByPrimaryKey(Menu record);
List