renyuanpeixun

master
20918 12 months ago
parent 9d05b53f00
commit b464b9811a

@ -133,10 +133,4 @@ public class TdExamnumController extends BaseController
* @param
*/
// 新增提交
@PostMapping("/add")
@ResponseBody
public AjaxResult addSaveExamnum(@Validated TdExamnum tdExamnum)
{
return toAjax(tdExamnumService.insertTdExamnum(tdExamnum));
}
}

@ -0,0 +1,138 @@
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.TdTrain;
import com.ruoyi.system.service.ITdTrainService;
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-11
*/
@Controller
@RequestMapping("/system/train")
public class TdTrainController extends BaseController
{
private String prefix = "system/train";
@Autowired
private ITdTrainService tdTrainService;
@RequiresPermissions("system:train:view")
@GetMapping()
public String train()
{
return prefix + "/train";
}
/**
*
*/
@RequiresPermissions("system:train:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TdTrain tdTrain)
{
startPage();
List<TdTrain> list = tdTrainService.selectTdTrainList(tdTrain);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:train:export")
@Log(title = "涉密人员培训", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TdTrain tdTrain)
{
List<TdTrain> list = tdTrainService.selectTdTrainList(tdTrain);
ExcelUtil<TdTrain> util = new ExcelUtil<TdTrain>(TdTrain.class);
return util.exportExcel(list, "涉密人员培训数据");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:train:add")
@Log(title = "涉密人员培训", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TdTrain tdTrain)
{
return toAjax(tdTrainService.insertTdTrain(tdTrain));
}
/**
*
*/
@RequiresPermissions("system:train:edit")
@GetMapping("/edit/{ID}")
public String edit(@PathVariable("ID") Long ID, ModelMap mmap)
{
TdTrain tdTrain = tdTrainService.selectTdTrainByID(ID);
mmap.put("tdTrain", tdTrain);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:train:edit")
@Log(title = "涉密人员培训", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TdTrain tdTrain)
{
return toAjax(tdTrainService.updateTdTrain(tdTrain));
}
/**
*
*/
@RequiresPermissions("system:train:remove")
@Log(title = "涉密人员培训", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(tdTrainService.deleteTdTrainByIDs(ids));
}
/**
*
*/
@RequiresPermissions("monitor:train:detail")
@GetMapping("/detail/{operId}")
public String detail(@PathVariable("id") Long operId, ModelMap mmap)
{
mmap.put("train", tdTrainService.selectTdTrainByID(operId));
return prefix + "/detail";
}
}

@ -0,0 +1,144 @@
<!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-train-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属地市:</label>
<div class="col-sm-8">
<input name="AREAID" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属区县:</label>
<div class="col-sm-8">
<input name="FRAMEWORK" 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="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="deptName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">培训类型:</label>
<div class="col-sm-8">
<select name="trainType" class="form-control m-b" th:with="type=${@dict.getType('sys_usertrain_typer')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">培训对象:</label>
<div class="col-sm-8">
<select name="trainSubject" class="form-control m-b" th:with="type=${@dict.getType('sys_usertrain_obj')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">培训地点:</label>
<div class="col-sm-8">
<textarea name="trainAddress" class="form-control"></textarea>
</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="trainDate" 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">
<div class="input-group date">
<input name="trainTimeend" 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="createStaffid" 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="createDate" 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="trainName" 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="PART" 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/train"
$("#form-train-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-train-add').serialize());
}
}
$("input[name='trainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='createDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updateDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='trainTimeend']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

@ -0,0 +1,122 @@
<!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-train-edit" th:object="${tdTrain}">
<input name="ID" th:field="*{ID}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属地市:</label>
<div class="col-sm-8">
<input name="AREAID" th:field="*{AREAID}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属区县:</label>
<div class="col-sm-8">
<input name="FRAMEWORK" th:field="*{FRAMEWORK}" 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="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="deptName" th:field="*{deptName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">培训类型:</label>
<div class="col-sm-8">
<select name="trainType" class="form-control m-b" th:with="type=${@dict.getType('sys_usertrain_typer')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{trainType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">培训对象:</label>
<div class="col-sm-8">
<select name="trainSubject" class="form-control m-b" th:with="type=${@dict.getType('sys_usertrain_obj')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{trainSubject}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">培训地点:</label>
<div class="col-sm-8">
<textarea name="trainAddress" class="form-control">[[*{trainAddress}]]</textarea>
</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="trainDate" th:value="${#dates.format(tdTrain.trainDate, '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="trainName" th:field="*{trainName}" 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="trainTimeend" th:value="${#dates.format(tdTrain.trainTimeend, '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>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/train";
$("#form-train-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-train-edit').serialize());
}
}
$("input[name='trainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='createDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updateDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='trainTimeend']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

@ -0,0 +1,203 @@
<!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="trainName"/>
</li>
<li>
<label>所属地市:</label>
<input type="text" name="AREAID"/>
</li>
<li>
<label>培训日期:</label>
<input type="text" class="time-input" placeholder="请选择培训日期" name="trainDate"/>
</li>
<li>
<label>培训状态:</label>
<select name="trainState" th:with="type=${@dict.getType('sys_examine_state')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</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:train:add">
<i class="fa fa-plus"></i> 记录
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:train:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:train:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:train: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 detailFlag = [[${@permission.hasPermi('monitor:train:detail')}]];
var editFlag = [[${@permission.hasPermi('system:train:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:train:remove')}]];
var trainTypeDatas = [[${@dict.getType('sys_usertrain_typer')}]];
var trainSubjectDatas = [[${@dict.getType('sys_usertrain_obj')}]];
var trainStateDatas = [[${@dict.getType('sys_examine_state')}]];
var prefix = ctx + "system/train";
$(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: 'AREAID',
title: '所属地市',
visible: false
},
{
field: 'trainName',
title: '培训人员'
},
{
field: 'FRAMEWORK',
title: '所属区县',
visible: false
},
{
field: 'USERNAME',
title: '人员名称',
visible: false
},
{
field: 'deptName',
title: '单位名称',
visible: false
},
{
field: 'trainType',
title: '培训类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(trainTypeDatas, value);
}
},
{
field: 'trainSubject',
title: '培训对象',
formatter: function(value, row, index) {
return $.table.selectDictLabel(trainSubjectDatas, value);
}
},
{
field: 'trainAddress',
title: '培训地点'
},
{
field: 'trainDate',
title: '培训开始日期'
},
{
field: 'trainTimeend',
title: '培训结束时间'
},
{
field: 'createStaffid',
title: '创建人',
visible: false
},
{
field: 'createDepartid',
title: '创建单位',
visible: false
},
{
field: 'createDate',
title: '创建日期',
visible: false
},
{
field: 'updateDepartid',
title: '更新单位',
visible: false
},
{
field: 'updateStaffid',
title: '审核人员'
},
{
field: 'updateDate',
title: '审核时间',
visible: false
},
{
field: 'trainState',
title: '培训状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(trainStateDatas, value);
}
},
{
field: 'PART',
title: '部门',
visible: false
},
{
field: 'TRAININFO',
title: '培训评价',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>详细</a> ');
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-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,22 @@
package com.ruoyi.common.utils;
import java.util.ArrayList;
import java.util.Random;
public class ArrayListRandom {
public static ArrayList<Integer> generateRandomIDs(int min, int max, int total) {
ArrayList<Integer> ids = new ArrayList<>();
Random random = new Random();
for (int i = 0; i < total; i++) {
int id = random.nextInt(max - min + 1) + min;
if (!ids.contains(id)) {
ids.add(id);
} else {
i--; // 如果ID已存在重新生成
}
}
return ids;
}
}

@ -0,0 +1,309 @@
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_train
*
* @author ruoyi
* @date 2024-04-11
*/
public class TdTrain extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** ID */
private Long ID;
/** 人员名称 */
@Excel(name = "人员名称")
private String USERNAME;
/** 单位名称 */
@Excel(name = "单位名称")
private String deptName;
/** 培训类型 */
@Excel(name = "培训类型")
private String trainType;
/** 培训对象 */
@Excel(name = "培训对象")
private String trainSubject;
/** 培训地点 */
@Excel(name = "培训地点")
private String trainAddress;
/** 培训日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "培训日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date trainDate;
/** 创建人 */
@Excel(name = "创建人")
private String createStaffid;
/** 创建单位 */
@Excel(name = "创建单位")
private String createDepartid;
/** 创建日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 更新单位 */
@Excel(name = "更新单位")
private String updateDepartid;
/** 更新人员 */
@Excel(name = "更新人员")
private String updateStaffid;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updateDate;
/** 所属地市 */
@Excel(name = "所属地市")
private String AREAID;
/** 所属区县 */
@Excel(name = "所属区县")
private String FRAMEWORK;
/** 培训人员 */
@Excel(name = "培训人员")
private String trainName;
/** 培训状态 */
@Excel(name = "培训状态")
private Long trainState;
/** 培训结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "培训结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date trainTimeend;
/** 部门 */
@Excel(name = "部门")
private String PART;
/** 培训评价 */
@Excel(name = "培训评价")
private String TRAININFO;
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 setDeptName(String deptName)
{
this.deptName = deptName;
}
public String getDeptName()
{
return deptName;
}
public void setTrainType(String trainType)
{
this.trainType = trainType;
}
public String getTrainType()
{
return trainType;
}
public void setTrainSubject(String trainSubject)
{
this.trainSubject = trainSubject;
}
public String getTrainSubject()
{
return trainSubject;
}
public void setTrainAddress(String trainAddress)
{
this.trainAddress = trainAddress;
}
public String getTrainAddress()
{
return trainAddress;
}
public void setTrainDate(Date trainDate)
{
this.trainDate = trainDate;
}
public Date getTrainDate()
{
return trainDate;
}
public void setCreateStaffid(String createStaffid)
{
this.createStaffid = createStaffid;
}
public String getCreateStaffid()
{
return createStaffid;
}
public void setCreateDepartid(String createDepartid)
{
this.createDepartid = createDepartid;
}
public String getCreateDepartid()
{
return createDepartid;
}
public void setCreateDate(Date createDate)
{
this.createDate = createDate;
}
public Date getCreateDate()
{
return createDate;
}
public void setUpdateDepartid(String updateDepartid)
{
this.updateDepartid = updateDepartid;
}
public String getUpdateDepartid()
{
return updateDepartid;
}
public void setUpdateStaffid(String updateStaffid)
{
this.updateStaffid = updateStaffid;
}
public String getUpdateStaffid()
{
return updateStaffid;
}
public void setUpdateDate(Date updateDate)
{
this.updateDate = updateDate;
}
public Date getUpdateDate()
{
return updateDate;
}
public void setAREAID(String AREAID)
{
this.AREAID = AREAID;
}
public String getAREAID()
{
return AREAID;
}
public void setFRAMEWORK(String FRAMEWORK)
{
this.FRAMEWORK = FRAMEWORK;
}
public String getFRAMEWORK()
{
return FRAMEWORK;
}
public void setTrainName(String trainName)
{
this.trainName = trainName;
}
public String getTrainName()
{
return trainName;
}
public void setTrainState(Long trainState)
{
this.trainState = trainState;
}
public Long getTrainState()
{
return trainState;
}
public void setTrainTimeend(Date trainTimeend)
{
this.trainTimeend = trainTimeend;
}
public Date getTrainTimeend()
{
return trainTimeend;
}
public void setPART(String PART)
{
this.PART = PART;
}
public String getPART()
{
return PART;
}
public void setTRAININFO(String TRAININFO)
{
this.TRAININFO = TRAININFO;
}
public String getTRAININFO()
{
return TRAININFO;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("ID", getID())
.append("USERNAME", getUSERNAME())
.append("deptName", getDeptName())
.append("trainType", getTrainType())
.append("trainSubject", getTrainSubject())
.append("trainAddress", getTrainAddress())
.append("trainDate", getTrainDate())
.append("createStaffid", getCreateStaffid())
.append("createDepartid", getCreateDepartid())
.append("createDate", getCreateDate())
.append("updateDepartid", getUpdateDepartid())
.append("updateStaffid", getUpdateStaffid())
.append("updateDate", getUpdateDate())
.append("AREAID", getAREAID())
.append("FRAMEWORK", getFRAMEWORK())
.append("trainName", getTrainName())
.append("trainState", getTrainState())
.append("trainTimeend", getTrainTimeend())
.append("PART", getPART())
.append("TRAININFO", getTRAININFO())
.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.TdTrain;
/**
* Mapper
*
* @author ruoyi
* @date 2024-04-11
*/
public interface TdTrainMapper extends BaseMapper<TdTrain>
{
/**
*
*
* @param ID
* @return
*/
public TdTrain selectTdTrainByID(Long ID);
/**
*
*
* @param tdTrain
* @return
*/
public List<TdTrain> selectTdTrainList(TdTrain tdTrain);
/**
*
*
* @param tdTrain
* @return
*/
public int insertTdTrain(TdTrain tdTrain);
/**
*
*
* @param tdTrain
* @return
*/
public int updateTdTrain(TdTrain tdTrain);
/**
*
*
* @param ID
* @return
*/
public int deleteTdTrainByID(Long ID);
/**
*
*
* @param IDs
* @return
*/
public int deleteTdTrainByIDs(String[] IDs);
}

@ -0,0 +1,64 @@
package com.ruoyi.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.TdTrain;
/**
* Service
*
* @author ruoyi
* @date 2024-04-11
*/
public interface ITdTrainService extends IService<TdTrain>
{
/**
*
*
* @param ID
* @return
*/
public TdTrain selectTdTrainByID(Long ID);
/**
*
*
* @param tdTrain
* @return
*/
public List<TdTrain> selectTdTrainList(TdTrain tdTrain);
/**
*
*
* @param tdTrain
* @return
*/
public int insertTdTrain(TdTrain tdTrain);
/**
*
*
* @param tdTrain
* @return
*/
public int updateTdTrain(TdTrain tdTrain);
/**
*
*
* @param IDs
* @return
*/
public int deleteTdTrainByIDs(String IDs);
/**
*
*
* @param ID
* @return
*/
public int deleteTdTrainByID(Long ID);
}

@ -0,0 +1,142 @@
package com.ruoyi.system.service.impl;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TdTrainMapper;
import com.ruoyi.system.domain.TdTrain;
import com.ruoyi.system.service.ITdTrainService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author ruoyi
* @date 2024-04-11
*/
@Service
public class TdTrainServiceImpl extends ServiceImpl<TdTrainMapper,TdTrain> implements ITdTrainService
{
@Autowired
private TdTrainMapper tdTrainMapper;
/**
*
*
* @param ID
* @return
*/
@Override
public TdTrain selectTdTrainByID(Long ID)
{
return tdTrainMapper.selectTdTrainByID(ID);
}
/**
*
*
* @param tdTrain
* @return
*/
@Override
public List<TdTrain> selectTdTrainList(TdTrain tdTrain)
{
return tdTrainMapper.selectTdTrainList(tdTrain);
}
/**
*
*
* @param tdTrain
* @return
*/
@Override
public int insertTdTrain(TdTrain tdTrain)
{
return tdTrainMapper.insertTdTrain(tdTrain);
}
/**
*
*
* @param tdTrain
* @return
*/
@Override
public int updateTdTrain(TdTrain tdTrain)
{
return tdTrainMapper.updateTdTrain(tdTrain);
}
/**
*
*
* @param IDs
* @return
*/
@Override
public int deleteTdTrainByIDs(String IDs)
{
return tdTrainMapper.deleteTdTrainByIDs(Convert.toStrArray(IDs));
}
/**
*
*
* @param ID
* @return
*/
@Override
public int deleteTdTrainByID(Long ID)
{
return tdTrainMapper.deleteTdTrainByID(ID);
}
@Override
public boolean saveBatch(Collection<TdTrain> entityList, int batchSize) {
return false;
}
@Override
public boolean saveOrUpdateBatch(Collection<TdTrain> entityList, int batchSize) {
return false;
}
@Override
public boolean updateBatchById(Collection<TdTrain> entityList, int batchSize) {
return false;
}
@Override
public boolean saveOrUpdate(TdTrain entity) {
return false;
}
@Override
public TdTrain getOne(Wrapper<TdTrain> queryWrapper, boolean throwEx) {
return null;
}
@Override
public Map<String, Object> getMap(Wrapper<TdTrain> queryWrapper) {
return null;
}
@Override
public <V> V getObj(Wrapper<TdTrain> queryWrapper, Function<? super Object, V> mapper) {
return null;
}
@Override
public Class<TdTrain> getEntityClass() {
return null;
}
}

@ -0,0 +1,147 @@
<?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.TdTrainMapper">
<resultMap type="TdTrain" id="TdTrainResult">
<result property="ID" column="ID" />
<result property="USERNAME" column="USERNAME" />
<result property="deptName" column="DEPT_NAME" />
<result property="trainType" column="TRAIN_TYPE" />
<result property="trainSubject" column="TRAIN_SUBJECT" />
<result property="trainAddress" column="TRAIN_ADDRESS" />
<result property="trainDate" column="TRAIN_DATE" />
<result property="createStaffid" column="CREATE_STAFFID" />
<result property="createDepartid" column="CREATE_DEPARTID" />
<result property="createDate" column="CREATE_DATE" />
<result property="updateDepartid" column="UPDATE_DEPARTID" />
<result property="updateStaffid" column="UPDATE_STAFFID" />
<result property="updateDate" column="UPDATE_DATE" />
<result property="AREAID" column="AREAID" />
<result property="FRAMEWORK" column="FRAMEWORK" />
<result property="trainName" column="TRAIN_NAME" />
<result property="trainState" column="TRAIN_STATE" />
<result property="trainTimeend" column="TRAIN_TIMEEND" />
<result property="PART" column="PART" />
<result property="TRAININFO" column="TRAININFO" />
</resultMap>
<sql id="selectTdTrainVo">
select ID, USERNAME, DEPT_NAME, TRAIN_TYPE, TRAIN_SUBJECT, TRAIN_ADDRESS, TRAIN_DATE, CREATE_STAFFID, CREATE_DEPARTID, CREATE_DATE, UPDATE_DEPARTID, UPDATE_STAFFID, UPDATE_DATE, AREAID, FRAMEWORK, TRAIN_NAME, TRAIN_STATE, TRAIN_TIMEEND, PART, TRAININFO from td_train
</sql>
<select id="selectTdTrainList" parameterType="TdTrain" resultMap="TdTrainResult">
<include refid="selectTdTrainVo"/>
<where>
<if test="USERNAME != null and USERNAME != ''"> and USERNAME like concat('%', #{USERNAME}, '%')</if>
<if test="deptName != null and deptName != ''"> and DEPT_NAME like concat('%', #{deptName}, '%')</if>
<if test="trainType != null and trainType != ''"> and TRAIN_TYPE = #{trainType}</if>
<if test="trainSubject != null and trainSubject != ''"> and TRAIN_SUBJECT = #{trainSubject}</if>
<if test="trainAddress != null and trainAddress != ''"> and TRAIN_ADDRESS = #{trainAddress}</if>
<if test="trainDate != null "> and TRAIN_DATE = #{trainDate}</if>
<if test="createStaffid != null and createStaffid != ''"> and CREATE_STAFFID = #{createStaffid}</if>
<if test="createDepartid != null and createDepartid != ''"> and CREATE_DEPARTID = #{createDepartid}</if>
<if test="createDate != null "> and CREATE_DATE = #{createDate}</if>
<if test="updateDepartid != null and updateDepartid != ''"> and UPDATE_DEPARTID = #{updateDepartid}</if>
<if test="updateStaffid != null and updateStaffid != ''"> and UPDATE_STAFFID = #{updateStaffid}</if>
<if test="updateDate != null "> and UPDATE_DATE = #{updateDate}</if>
<if test="AREAID != null and AREAID != ''"> and AREAID = #{AREAID}</if>
<if test="FRAMEWORK != null and FRAMEWORK != ''"> and FRAMEWORK = #{FRAMEWORK}</if>
<if test="trainName != null and trainName != ''"> and TRAIN_NAME like concat('%', #{trainName}, '%')</if>
<if test="trainState != null "> and TRAIN_STATE = #{trainState}</if>
<if test="trainTimeend != null "> and TRAIN_TIMEEND = #{trainTimeend}</if>
<if test="PART != null and PART != ''"> and PART = #{PART}</if>
<if test="TRAININFO != null and TRAININFO != ''"> and TRAININFO = #{TRAININFO}</if>
</where>
</select>
<select id="selectTdTrainByID" parameterType="Long" resultMap="TdTrainResult">
<include refid="selectTdTrainVo"/>
where ID = #{ID}
</select>
<insert id="insertTdTrain" parameterType="TdTrain" useGeneratedKeys="true" keyProperty="ID">
insert into td_train
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="USERNAME != null">USERNAME,</if>
<if test="deptName != null">DEPT_NAME,</if>
<if test="trainType != null">TRAIN_TYPE,</if>
<if test="trainSubject != null">TRAIN_SUBJECT,</if>
<if test="trainAddress != null">TRAIN_ADDRESS,</if>
<if test="trainDate != null">TRAIN_DATE,</if>
<if test="createStaffid != null">CREATE_STAFFID,</if>
<if test="createDepartid != null">CREATE_DEPARTID,</if>
<if test="createDate != null">CREATE_DATE,</if>
<if test="updateDepartid != null">UPDATE_DEPARTID,</if>
<if test="updateStaffid != null">UPDATE_STAFFID,</if>
<if test="updateDate != null">UPDATE_DATE,</if>
<if test="AREAID != null and AREAID != ''">AREAID,</if>
<if test="FRAMEWORK != null">FRAMEWORK,</if>
<if test="trainName != null">TRAIN_NAME,</if>
<if test="trainState != null">TRAIN_STATE,</if>
<if test="trainTimeend != null">TRAIN_TIMEEND,</if>
<if test="PART != null">PART,</if>
<if test="TRAININFO != null">TRAININFO,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="USERNAME != null">#{USERNAME},</if>
<if test="deptName != null">#{deptName},</if>
<if test="trainType != null">#{trainType},</if>
<if test="trainSubject != null">#{trainSubject},</if>
<if test="trainAddress != null">#{trainAddress},</if>
<if test="trainDate != null">#{trainDate},</if>
<if test="createStaffid != null">#{createStaffid},</if>
<if test="createDepartid != null">#{createDepartid},</if>
<if test="createDate != null">#{createDate},</if>
<if test="updateDepartid != null">#{updateDepartid},</if>
<if test="updateStaffid != null">#{updateStaffid},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="AREAID != null and AREAID != ''">#{AREAID},</if>
<if test="FRAMEWORK != null">#{FRAMEWORK},</if>
<if test="trainName != null">#{trainName},</if>
<if test="trainState != null">#{trainState},</if>
<if test="trainTimeend != null">#{trainTimeend},</if>
<if test="PART != null">#{PART},</if>
<if test="TRAININFO != null">#{TRAININFO},</if>
</trim>
</insert>
<update id="updateTdTrain" parameterType="TdTrain">
update td_train
<trim prefix="SET" suffixOverrides=",">
<if test="USERNAME != null">USERNAME = #{USERNAME},</if>
<if test="deptName != null">DEPT_NAME = #{deptName},</if>
<if test="trainType != null">TRAIN_TYPE = #{trainType},</if>
<if test="trainSubject != null">TRAIN_SUBJECT = #{trainSubject},</if>
<if test="trainAddress != null">TRAIN_ADDRESS = #{trainAddress},</if>
<if test="trainDate != null">TRAIN_DATE = #{trainDate},</if>
<if test="createStaffid != null">CREATE_STAFFID = #{createStaffid},</if>
<if test="createDepartid != null">CREATE_DEPARTID = #{createDepartid},</if>
<if test="createDate != null">CREATE_DATE = #{createDate},</if>
<if test="updateDepartid != null">UPDATE_DEPARTID = #{updateDepartid},</if>
<if test="updateStaffid != null">UPDATE_STAFFID = #{updateStaffid},</if>
<if test="updateDate != null">UPDATE_DATE = #{updateDate},</if>
<if test="AREAID != null and AREAID != ''">AREAID = #{AREAID},</if>
<if test="FRAMEWORK != null">FRAMEWORK = #{FRAMEWORK},</if>
<if test="trainName != null">TRAIN_NAME = #{trainName},</if>
<if test="trainState != null">TRAIN_STATE = #{trainState},</if>
<if test="trainTimeend != null">TRAIN_TIMEEND = #{trainTimeend},</if>
<if test="PART != null">PART = #{PART},</if>
<if test="TRAININFO != null">TRAININFO = #{TRAININFO},</if>
</trim>
where ID = #{ID}
</update>
<delete id="deleteTdTrainByID" parameterType="Long">
delete from td_train where ID = #{ID}
</delete>
<delete id="deleteTdTrainByIDs" parameterType="String">
delete from td_train where ID in
<foreach item="ID" collection="array" open="(" separator="," close=")">
#{ID}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save