master
20918 1 year ago
parent 731b55ff0f
commit 33ffcfec66

@ -98,7 +98,6 @@ public class SysUserExamineController extends BaseController {
@GetMapping("/examineprint/{userId}") @GetMapping("/examineprint/{userId}")
public String paint(@PathVariable("userId") Long userId,ModelMap mmap) public String paint(@PathVariable("userId") Long userId,ModelMap mmap)
{ {
List<SysRole> roles = roleService.selectRolesByUserId(userId);
mmap.put("user",userService.selectUserById(userId)); mmap.put("user",userService.selectUserById(userId));
mmap.put("roles", roleService.selectRolesByUserIds(userId)); mmap.put("roles", roleService.selectRolesByUserIds(userId));
mmap.put("posts", postService.selectPostsByUserIds(userId)); mmap.put("posts", postService.selectPostsByUserIds(userId));

@ -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>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</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>

@ -29,6 +29,11 @@
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version> <version>3.5.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>

@ -0,0 +1,201 @@
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* td_leave
*
* @author ruoyi
* @date 2024-04-16
*/
@Data
@Getter
@Setter
public class TdLeave extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 提交人 */
@Excel(name = "提交人")
private String username;
/** 城市 */
@Excel(name = "城市")
private String country;
/** 地区 */
@Excel(name = "地区")
private String areaname;
/** 离职原因 */
@Excel(name = "离职原因")
private String leavereason;
/** 单位 */
@Excel(name = "单位")
private String depart;
/** 离职时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "离职时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date leavedate;
/** 工作交接 */
@Excel(name = "工作交接")
private String workstate;
/** 离职状态0未离职1已离职 */
@Excel(name = "离职状态", readConverterExp = "0=未离职1已离职")
private String leavestate;
/** 审核人 */
@Excel(name = "审核人")
private String examinename;
/** 审核日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date examinedate;
/** 审核意见0通过1不通过2审核中 */
@Excel(name = "审核意见", readConverterExp = "0=通过1不通过2审核中")
private String examinestate;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUsername(String username)
{
this.username = username;
}
public String getUsername()
{
return username;
}
public void setCountry(String country)
{
this.country = country;
}
public String getCountry()
{
return country;
}
public void setAreaname(String areaname)
{
this.areaname = areaname;
}
public String getAreaname()
{
return areaname;
}
public void setLeavereason(String leavereason)
{
this.leavereason = leavereason;
}
public String getLeavereason()
{
return leavereason;
}
public void setDepart(String depart)
{
this.depart = depart;
}
public String getDepart()
{
return depart;
}
public void setLeavedate(Date leavedate)
{
this.leavedate = leavedate;
}
public Date getLeavedate()
{
return leavedate;
}
public void setWorkstate(String workstate)
{
this.workstate = workstate;
}
public String getWorkstate()
{
return workstate;
}
public void setLeavestate(String leavestate)
{
this.leavestate = leavestate;
}
public String getLeavestate()
{
return leavestate;
}
public void setExaminename(String examinename)
{
this.examinename = examinename;
}
public String getExaminename()
{
return examinename;
}
public void setExaminedate(Date examinedate)
{
this.examinedate = examinedate;
}
public Date getExaminedate()
{
return examinedate;
}
public void setExaminestate(String examinestate)
{
this.examinestate = examinestate;
}
public String getExaminestate()
{
return examinestate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("username", getUsername())
.append("country", getCountry())
.append("areaname", getAreaname())
.append("leavereason", getLeavereason())
.append("depart", getDepart())
.append("leavedate", getLeavedate())
.append("workstate", getWorkstate())
.append("leavestate", getLeavestate())
.append("examinename", getExaminename())
.append("examinedate", getExaminedate())
.append("examinestate", getExaminestate())
.toString();
}
}

@ -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);
}

@ -2,15 +2,18 @@ package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.domain.TdLeave;
/** /**
* *
* *
* @author ruoyi * @author ruoyi
*/ */
public interface ISysRoleService public interface ISysRoleService extends IService<TdLeave>
{ {
/** /**
* *

@ -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);
}

@ -5,6 +5,10 @@ import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.TdLeave;
import com.ruoyi.system.mapper.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -20,10 +24,6 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.domain.SysRoleDept; import com.ruoyi.system.domain.SysRoleDept;
import com.ruoyi.system.domain.SysRoleMenu; import com.ruoyi.system.domain.SysRoleMenu;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysRoleDeptMapper;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysRoleMenuMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
/** /**
@ -32,7 +32,7 @@ import com.ruoyi.system.service.ISysRoleService;
* @author ruoyi * @author ruoyi
*/ */
@Service @Service
public class SysRoleServiceImpl implements ISysRoleService public class SysRoleServiceImpl extends ServiceImpl<TdLeaveMapper, TdLeave> implements ISysRoleService
{ {
@Autowired @Autowired
private SysRoleMapper roleMapper; private SysRoleMapper roleMapper;

@ -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…
Cancel
Save