parent
731b55ff0f
commit
33ffcfec66
@ -0,0 +1,127 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
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.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.TdLeave;
|
||||
import com.ruoyi.system.service.ITdLeaveService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 人员离职Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-16
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/leave")
|
||||
public class TdLeaveController extends BaseController
|
||||
{
|
||||
private String prefix = "system/leave";
|
||||
|
||||
@Autowired
|
||||
private ITdLeaveService tdLeaveService;
|
||||
|
||||
@RequiresPermissions("system:leave:view")
|
||||
@GetMapping()
|
||||
public String leave()
|
||||
{
|
||||
return prefix + "/leave";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询人员离职列表
|
||||
*/
|
||||
@RequiresPermissions("system:leave:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(TdLeave tdLeave)
|
||||
{
|
||||
startPage();
|
||||
List<TdLeave> list = tdLeaveService.selectTdLeaveList(tdLeave);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人员离职列表
|
||||
*/
|
||||
@RequiresPermissions("system:leave:export")
|
||||
@Log(title = "人员离职", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(TdLeave tdLeave)
|
||||
{
|
||||
List<TdLeave> list = tdLeaveService.selectTdLeaveList(tdLeave);
|
||||
ExcelUtil<TdLeave> util = new ExcelUtil<TdLeave>(TdLeave.class);
|
||||
return util.exportExcel(list, "人员离职数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员离职
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存人员离职
|
||||
*/
|
||||
@RequiresPermissions("system:leave:add")
|
||||
@Log(title = "人员离职", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(TdLeave tdLeave)
|
||||
{
|
||||
return toAjax(tdLeaveService.insertTdLeave(tdLeave));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人员离职
|
||||
*/
|
||||
@RequiresPermissions("system:leave:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
TdLeave tdLeave = tdLeaveService.selectTdLeaveById(id);
|
||||
mmap.put("tdLeave", tdLeave);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存人员离职
|
||||
*/
|
||||
@RequiresPermissions("system:leave:edit")
|
||||
@Log(title = "人员离职", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(TdLeave tdLeave)
|
||||
{
|
||||
return toAjax(tdLeaveService.updateTdLeave(tdLeave));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人员离职
|
||||
*/
|
||||
@RequiresPermissions("system:leave:remove")
|
||||
@Log(title = "人员离职", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(tdLeaveService.deleteTdLeaveByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增人员离职')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-leave-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">提交人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="username" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">城市:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="country" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">地区:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="areaname" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职原因:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="leavereason" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">单位:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="depart" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="leavedate" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="leavestate" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="examinename" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核日期:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="examinedate" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核意见:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="examinestate" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/leave"
|
||||
$("#form-leave-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-leave-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='leavedate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("input[name='examinedate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改人员离职')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-leave-edit" th:object="${tdLeave}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">提交人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="username" th:field="*{username}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">城市:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="country" th:field="*{country}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">地区:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="areaname" th:field="*{areaname}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职原因:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="leavereason" class="form-control">[[*{leavereason}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">单位:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="depart" th:field="*{depart}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="leavedate" th:value="${#dates.format(tdLeave.leavedate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="leavestate" th:field="*{leavestate}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="examinename" th:field="*{examinename}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核日期:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="examinedate" th:value="${#dates.format(tdLeave.examinedate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核意见:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="examinestate" th:field="*{examinestate}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/leave";
|
||||
$("#form-leave-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-leave-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='leavedate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("input[name='examinedate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,162 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('人员离职列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>提交人:</label>
|
||||
<input type="text" name="username"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>城市:</label>
|
||||
<input type="text" name="country"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>地区:</label>
|
||||
<input type="text" name="areaname"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>单位:</label>
|
||||
<input type="text" name="depart"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>离职时间:</label>
|
||||
<input type="text" class="time-input" placeholder="请选择离职时间" name="leavedate"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>离职状态:</label>
|
||||
<input type="text" name="leavestate"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>审核人:</label>
|
||||
<input type="text" name="examinename"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>审核日期:</label>
|
||||
<input type="text" class="time-input" placeholder="请选择审核日期" name="examinedate"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>审核意见:</label>
|
||||
<input type="text" name="examinestate"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:leave:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:leave:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:leave:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:leave:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:leave:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:leave:remove')}]];
|
||||
var examinestateDatas = [[${@dict.getType('sys_examine_state')}]];
|
||||
var prefix = ctx + "system/leave";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "人员离职",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'id',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'username',
|
||||
title: '提交人'
|
||||
},
|
||||
{
|
||||
field: 'country',
|
||||
title: '城市'
|
||||
},
|
||||
{
|
||||
field: 'areaname',
|
||||
title: '地区'
|
||||
},
|
||||
{
|
||||
field: 'leavereason',
|
||||
title: '离职原因'
|
||||
},
|
||||
{
|
||||
field: 'depart',
|
||||
title: '单位'
|
||||
},
|
||||
{
|
||||
field: 'leavedate',
|
||||
title: '离职时间'
|
||||
},
|
||||
{
|
||||
field: 'workstate',
|
||||
title: '工作交接'
|
||||
},
|
||||
{
|
||||
field: 'leavestate',
|
||||
title: '离职状态'
|
||||
},
|
||||
{
|
||||
field: 'examinename',
|
||||
title: '审核人'
|
||||
},
|
||||
{
|
||||
field: 'examinedate',
|
||||
title: '审核日期'
|
||||
},
|
||||
{
|
||||
field: 'examinestate',
|
||||
title: '审核意见',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(examinestateDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.domain.TdLeave;
|
||||
|
||||
/**
|
||||
* 人员离职Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-16
|
||||
*/
|
||||
public interface TdLeaveMapper extends BaseMapper<TdLeave>
|
||||
{
|
||||
/**
|
||||
* 查询人员离职
|
||||
*
|
||||
* @param id 人员离职主键
|
||||
* @return 人员离职
|
||||
*/
|
||||
public TdLeave selectTdLeaveById(Long id);
|
||||
|
||||
/**
|
||||
* 查询人员离职列表
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 人员离职集合
|
||||
*/
|
||||
public List<TdLeave> selectTdLeaveList(TdLeave tdLeave);
|
||||
|
||||
/**
|
||||
* 新增人员离职
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTdLeave(TdLeave tdLeave);
|
||||
|
||||
/**
|
||||
* 修改人员离职
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTdLeave(TdLeave tdLeave);
|
||||
|
||||
/**
|
||||
* 删除人员离职
|
||||
*
|
||||
* @param id 人员离职主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTdLeaveById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除人员离职
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTdLeaveByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.TdLeave;
|
||||
|
||||
/**
|
||||
* 人员离职Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-16
|
||||
*/
|
||||
public interface ITdLeaveService
|
||||
{
|
||||
/**
|
||||
* 查询人员离职
|
||||
*
|
||||
* @param id 人员离职主键
|
||||
* @return 人员离职
|
||||
*/
|
||||
public TdLeave selectTdLeaveById(Long id);
|
||||
|
||||
/**
|
||||
* 查询人员离职列表
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 人员离职集合
|
||||
*/
|
||||
public List<TdLeave> selectTdLeaveList(TdLeave tdLeave);
|
||||
|
||||
/**
|
||||
* 新增人员离职
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTdLeave(TdLeave tdLeave);
|
||||
|
||||
/**
|
||||
* 修改人员离职
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTdLeave(TdLeave tdLeave);
|
||||
|
||||
/**
|
||||
* 批量删除人员离职
|
||||
*
|
||||
* @param ids 需要删除的人员离职主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTdLeaveByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除人员离职信息
|
||||
*
|
||||
* @param id 人员离职主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTdLeaveById(Long id);
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.TdLeaveMapper;
|
||||
import com.ruoyi.system.domain.TdLeave;
|
||||
import com.ruoyi.system.service.ITdLeaveService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 人员离职Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-16
|
||||
*/
|
||||
@Service
|
||||
public class TdLeaveServiceImpl implements ITdLeaveService
|
||||
{
|
||||
@Autowired
|
||||
private TdLeaveMapper tdLeaveMapper;
|
||||
|
||||
/**
|
||||
* 查询人员离职
|
||||
*
|
||||
* @param id 人员离职主键
|
||||
* @return 人员离职
|
||||
*/
|
||||
@Override
|
||||
public TdLeave selectTdLeaveById(Long id)
|
||||
{
|
||||
return tdLeaveMapper.selectTdLeaveById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询人员离职列表
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 人员离职
|
||||
*/
|
||||
@Override
|
||||
public List<TdLeave> selectTdLeaveList(TdLeave tdLeave)
|
||||
{
|
||||
return tdLeaveMapper.selectTdLeaveList(tdLeave);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员离职
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTdLeave(TdLeave tdLeave)
|
||||
{
|
||||
return tdLeaveMapper.insertTdLeave(tdLeave);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人员离职
|
||||
*
|
||||
* @param tdLeave 人员离职
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTdLeave(TdLeave tdLeave)
|
||||
{
|
||||
return tdLeaveMapper.updateTdLeave(tdLeave);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除人员离职
|
||||
*
|
||||
* @param ids 需要删除的人员离职主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTdLeaveByIds(String ids)
|
||||
{
|
||||
return tdLeaveMapper.deleteTdLeaveByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人员离职信息
|
||||
*
|
||||
* @param id 人员离职主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTdLeaveById(Long id)
|
||||
{
|
||||
return tdLeaveMapper.deleteTdLeaveById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.TdLeaveMapper">
|
||||
|
||||
<resultMap type="TdLeave" id="TdLeaveResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="username" column="username" />
|
||||
<result property="country" column="country" />
|
||||
<result property="areaname" column="areaname" />
|
||||
<result property="leavereason" column="leavereason" />
|
||||
<result property="depart" column="depart" />
|
||||
<result property="leavedate" column="leavedate" />
|
||||
<result property="workstate" column="workstate" />
|
||||
<result property="leavestate" column="leavestate" />
|
||||
<result property="examinename" column="examinename" />
|
||||
<result property="examinedate" column="examinedate" />
|
||||
<result property="examinestate" column="examinestate" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTdLeaveVo">
|
||||
select id, username, country, areaname, leavereason, depart, leavedate, workstate, leavestate, examinename, examinedate, examinestate from td_leave
|
||||
</sql>
|
||||
|
||||
<select id="selectTdLeaveList" parameterType="TdLeave" resultMap="TdLeaveResult">
|
||||
<include refid="selectTdLeaveVo"/>
|
||||
<where>
|
||||
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
||||
<if test="country != null and country != ''"> and country = #{country}</if>
|
||||
<if test="areaname != null and areaname != ''"> and areaname like concat('%', #{areaname}, '%')</if>
|
||||
<if test="leavereason != null and leavereason != ''"> and leavereason = #{leavereason}</if>
|
||||
<if test="depart != null and depart != ''"> and depart = #{depart}</if>
|
||||
<if test="leavedate != null "> and leavedate = #{leavedate}</if>
|
||||
<if test="workstate != null and workstate != ''"> and workstate = #{workstate}</if>
|
||||
<if test="leavestate != null and leavestate != ''"> and leavestate = #{leavestate}</if>
|
||||
<if test="examinename != null and examinename != ''"> and examinename like concat('%', #{examinename}, '%')</if>
|
||||
<if test="examinedate != null "> and examinedate = #{examinedate}</if>
|
||||
<if test="examinestate != null and examinestate != ''"> and examinestate = #{examinestate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTdLeaveById" parameterType="Long" resultMap="TdLeaveResult">
|
||||
<include refid="selectTdLeaveVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTdLeave" parameterType="TdLeave" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into td_leave
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="username != null">username,</if>
|
||||
<if test="country != null">country,</if>
|
||||
<if test="areaname != null">areaname,</if>
|
||||
<if test="leavereason != null">leavereason,</if>
|
||||
<if test="depart != null">depart,</if>
|
||||
<if test="leavedate != null">leavedate,</if>
|
||||
<if test="workstate != null">workstate,</if>
|
||||
<if test="leavestate != null">leavestate,</if>
|
||||
<if test="examinename != null">examinename,</if>
|
||||
<if test="examinedate != null">examinedate,</if>
|
||||
<if test="examinestate != null">examinestate,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="username != null">#{username},</if>
|
||||
<if test="country != null">#{country},</if>
|
||||
<if test="areaname != null">#{areaname},</if>
|
||||
<if test="leavereason != null">#{leavereason},</if>
|
||||
<if test="depart != null">#{depart},</if>
|
||||
<if test="leavedate != null">#{leavedate},</if>
|
||||
<if test="workstate != null">#{workstate},</if>
|
||||
<if test="leavestate != null">#{leavestate},</if>
|
||||
<if test="examinename != null">#{examinename},</if>
|
||||
<if test="examinedate != null">#{examinedate},</if>
|
||||
<if test="examinestate != null">#{examinestate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTdLeave" parameterType="TdLeave">
|
||||
update td_leave
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="username != null">username = #{username},</if>
|
||||
<if test="country != null">country = #{country},</if>
|
||||
<if test="areaname != null">areaname = #{areaname},</if>
|
||||
<if test="leavereason != null">leavereason = #{leavereason},</if>
|
||||
<if test="depart != null">depart = #{depart},</if>
|
||||
<if test="leavedate != null">leavedate = #{leavedate},</if>
|
||||
<if test="workstate != null">workstate = #{workstate},</if>
|
||||
<if test="leavestate != null">leavestate = #{leavestate},</if>
|
||||
<if test="examinename != null">examinename = #{examinename},</if>
|
||||
<if test="examinedate != null">examinedate = #{examinedate},</if>
|
||||
<if test="examinestate != null">examinestate = #{examinestate},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTdLeaveById" parameterType="Long">
|
||||
delete from td_leave where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTdLeaveByIds" parameterType="String">
|
||||
delete from td_leave where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue