16 changed files with 986 additions and 0 deletions
@ -0,0 +1,77 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增场景')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-manage-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">场景名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="name" 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="sourceUnit" 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="type" class="form-control m-b"> |
|||
<option value="1">文字型</option> |
|||
<option value="2">视频型</option> |
|||
<option value="3">图片型</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">创建人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="creator" 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="isOpen" 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="createTime" 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="background" 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="describe" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "system/manage" |
|||
$("#form-manage-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-manage-add').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,65 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('场景详情')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-manage-detail" th:object="${sceneManage}"> |
|||
<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="name" th:field="*{name}" 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="type" th:field="*{type}" 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="url" th:field="*{url}" 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="sourceUnit" th:field="*{sourceUnit}" 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="creator" th:field="*{creator}" 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="createTime" th:field="*{createTime}" 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="isOpen" th:field="*{isOpen}" 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="isOpen" th:field="*{status}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "system/manage"; |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,83 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('场景编辑')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-manage-edit" th:object="${sceneManage}"> |
|||
<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="name" th:field="*{name}" 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="isOpen" class="form-control m-b"> |
|||
<option value="1">文字型</option> |
|||
<option value="2">视频型</option> |
|||
<option value="3">图片型</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">二维码链接:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="url" th:field="*{url}" 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="sourceUnit" th:field="*{sourceUnit}" 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="creator" th:field="*{creator}" 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="createTime" th:field="*{createTime}" 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="isOpen" class="form-control m-b"> |
|||
<option value="0">是</option> |
|||
<option value="1">否</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">状态:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="status" class="form-control m-b"> |
|||
<option value="0">审核</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "system/manage"; |
|||
$("#form-manage-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-manage-edit').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,180 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="zdxtInclude :: 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> |
|||
<p>场景名称:</p> |
|||
<input type="text" name="name"/> |
|||
</li> |
|||
<li> |
|||
<p>创建时间:</p> |
|||
<!-- //<input type="text" class="time-input" id="createTime" placeholder="年-月-日" name="createTime" style="width: 200px;"/>--> |
|||
<input type="text" name="type"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-reset 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.addFull()" shiro:hasPermission="project:scene:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="project:scene:remove"> |
|||
<i class="fa fa-remove"></i> 全部删除 |
|||
</a> |
|||
<a class="btn btn-default" onclick="$.operate.removeAll()" shiro:hasPermission="project:scene:remove"> |
|||
<i class="fa fa-save"></i> 生成二维码 |
|||
</a> |
|||
<a class="btn btn-action" onclick="$.operate.removeAll()" shiro:hasPermission="project:scene:remove"> |
|||
<i class="fa fa-adjust"></i> 提交审核 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="exportWord()" shiro:hasPermission="project:scene:export"> |
|||
<i class="fa fa-download"></i> 导入 |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-bordered"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="zdxtInclude :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('project:manage:edit')}]]; |
|||
var detailFlag = [[${@permission.hasPermi('project:manage:detail')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('project:manage:remove')}]]; |
|||
var exportFlag = [[${@permission.hasPermi('project:manage:export')}]]; |
|||
var exportboolen = (exportFlag==""?true:false) |
|||
var prefix = ctx + "scene/manage"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
detailUrl: prefix + "/detail/{id}", |
|||
modalName: "场景列表", |
|||
showCustomExport: exportboolen, |
|||
customExportFunction:function(){ |
|||
// $.table.exportExcel(); |
|||
exportWord(); |
|||
}, |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field : 'id', |
|||
title : '场景序号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field : 'name', |
|||
title : '场景名称' |
|||
}, |
|||
{ |
|||
field : 'type', |
|||
title : '题目类型', |
|||
formatter: function(value, index) { |
|||
if (value === 0) { |
|||
return "图片"; |
|||
} else if (value === 1) { |
|||
return "文字"; |
|||
} else if (value === 2){ |
|||
return "视频"; |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field : 'url', |
|||
title : '二维码' |
|||
}, |
|||
{ |
|||
field : 'sourceUnit', |
|||
title : '来源单位' |
|||
}, |
|||
{ |
|||
field : 'creator', |
|||
title : '创建人' |
|||
}, |
|||
{ |
|||
field : 'createTime', |
|||
title : '创建日期' |
|||
}, |
|||
{ |
|||
field : 'isOpen', |
|||
title : '是否公开', |
|||
formatter: function(value, index) { |
|||
return value === 0 ? "是" : "否"; |
|||
} |
|||
}, |
|||
{ |
|||
field : 'status', |
|||
title : '状态', |
|||
formatter: function(value, index) { |
|||
if (value === 0) { |
|||
return "审核"; |
|||
} else if (value === 1) { |
|||
return "上架"; |
|||
} else { |
|||
return "下架"; |
|||
} |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
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.editFull(\'' + 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>'); |
|||
actions.push('<a class="btn btn-primary btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detailFull(\'' + row.id + '\')"><i class="fa fa-eye"></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-eject"></i> 题目</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
function exportWord() { |
|||
table.set(); |
|||
var row = $("#" + table.options.id).bootstrapTable('getSelections')[0]; |
|||
if ($.common.isEmpty(row)) { |
|||
$.modal.alertWarning("请选择您要导出的记录"); |
|||
return; |
|||
} |
|||
if (row.length > 0) { |
|||
$.modal.alertWarning("只能选择一条记录"); |
|||
return; |
|||
} |
|||
window.location.href = prefix + "/export/" + row.guid; |
|||
} |
|||
function detailFull(id) { |
|||
table.set(); |
|||
var url = "/404.html"; |
|||
if ($.common.isNotEmpty(id)) { |
|||
url = table.options.detailUrl.replace("{id}", id); |
|||
} else { |
|||
var row = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|||
url = table.options.detailUrl.replace("{id}", row); |
|||
} |
|||
$.modal.openFull("场景详情", url); |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,110 @@ |
|||
package com.zdxt.knowledge.controller; |
|||
|
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import com.zdxt.knowledge.domain.SceneManage; |
|||
import com.zdxt.knowledge.service.ISceneManageService; |
|||
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.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 【请填写功能名称】Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-12-25 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/scene/manage") |
|||
public class SceneManageController extends BaseController { |
|||
private String prefix = "project/scene"; |
|||
|
|||
@Autowired |
|||
private ISceneManageService sceneManageService; |
|||
|
|||
@RequiresPermissions("project:manage:view") |
|||
@GetMapping() |
|||
public String manage() { |
|||
return prefix + "/manage"; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 查询【请填写功能名称】列表 |
|||
*/ |
|||
@RequiresPermissions("project:manage:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(SceneManage sceneManage) { |
|||
startPage(); |
|||
List<SceneManage> list = sceneManageService.selectSceneManageList(sceneManage); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 查看详情 |
|||
*/ |
|||
@RequiresPermissions("project:manage:detail") |
|||
@GetMapping("/detail/{id}") |
|||
public String detail(@PathVariable("id") Long id, ModelMap mmap) { |
|||
SceneManage sceneManage = sceneManageService.selectSceneManageById(id); |
|||
mmap.put("sceneManage", sceneManage); |
|||
return prefix + "/detail"; |
|||
} |
|||
/** |
|||
* 新增场景 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() { |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存 |
|||
*/ |
|||
@RequiresPermissions("project:manage:add") |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public ZDResponse addSave(SceneManage sceneManage) { |
|||
return sceneManageService.insertSceneManage(sceneManage) > 0 |
|||
? ZDResponse.success() : ZDResponse.error("新增失败"); |
|||
} |
|||
|
|||
/** |
|||
* 修改【请填写功能名称】 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") Long id, ModelMap mmap) { |
|||
SceneManage sceneManage = sceneManageService.selectSceneManageById(id); |
|||
mmap.put("sceneManage", sceneManage); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存【请填写功能名称】 |
|||
*/ |
|||
@RequiresPermissions("project:manage:edit") |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public ZDResponse editSave(SceneManage sceneManage) { |
|||
return sceneManageService.updateSceneManage(sceneManage) > 0 |
|||
? ZDResponse.success() : ZDResponse.error("编辑失败"); |
|||
} |
|||
|
|||
/** |
|||
* 删除【请填写功能名称】 |
|||
*/ |
|||
@RequiresPermissions("project:manage:remove") |
|||
@PostMapping("/remove") |
|||
@ResponseBody |
|||
public ZDResponse remove(String ids) { |
|||
return sceneManageService.deleteSceneManageByIds(ids) > 0 |
|||
? ZDResponse.success() : ZDResponse.error("删除失败"); |
|||
} |
|||
} |
|||
@ -0,0 +1,151 @@ |
|||
package com.zdxt.knowledge.domain; |
|||
|
|||
import com.zdxt.common.BaseEntity; |
|||
import com.zdxt.common.annotation.Excel; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
|
|||
|
|||
/** |
|||
* 【请填写功能名称】对象 scene_manage |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-12-25 |
|||
*/ |
|||
public class SceneManage extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键 */ |
|||
private Long id; |
|||
|
|||
/** 场景名称 */ |
|||
@Excel(name = "场景名称") |
|||
private String name; |
|||
|
|||
/** 题目类型 */ |
|||
@Excel(name = "题目类型") |
|||
private Integer type; |
|||
|
|||
/** 二维码链接 */ |
|||
@Excel(name = "二维码链接") |
|||
private String url; |
|||
|
|||
/** 来源单位 */ |
|||
@Excel(name = "来源单位") |
|||
private String sourceUnit; |
|||
|
|||
/** 是否公开0是1否 */ |
|||
@Excel(name = "是否公开0是1否") |
|||
private Integer isOpen; |
|||
|
|||
/** 状态 */ |
|||
@Excel(name = "状态") |
|||
private Integer status; |
|||
|
|||
/** 是否删除0是1否 */ |
|||
@Excel(name = "是否删除0是1否") |
|||
private Integer isDelete; |
|||
|
|||
/** 创建人 */ |
|||
@Excel(name = "创建人") |
|||
private String creator; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setName(String name) |
|||
{ |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getName() |
|||
{ |
|||
return name; |
|||
} |
|||
public void setType(Integer type) |
|||
{ |
|||
this.type = type; |
|||
} |
|||
|
|||
public Integer getType() |
|||
{ |
|||
return type; |
|||
} |
|||
public void setUrl(String url) |
|||
{ |
|||
this.url = url; |
|||
} |
|||
|
|||
public String getUrl() |
|||
{ |
|||
return url; |
|||
} |
|||
public void setSourceUnit(String sourceUnit) |
|||
{ |
|||
this.sourceUnit = sourceUnit; |
|||
} |
|||
|
|||
public String getSourceUnit() |
|||
{ |
|||
return sourceUnit; |
|||
} |
|||
public void setIsOpen(Integer isOpen) |
|||
{ |
|||
this.isOpen = isOpen; |
|||
} |
|||
|
|||
public Integer getIsOpen() |
|||
{ |
|||
return isOpen; |
|||
} |
|||
public void setStatus(Integer status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
public void setIsDelete(Integer isDelete) |
|||
{ |
|||
this.isDelete = isDelete; |
|||
} |
|||
|
|||
public Integer getIsDelete() |
|||
{ |
|||
return isDelete; |
|||
} |
|||
public void setCreator(String creator) |
|||
{ |
|||
this.creator = creator; |
|||
} |
|||
|
|||
public String getCreator() |
|||
{ |
|||
return creator; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("name", getName()) |
|||
.append("type", getType()) |
|||
.append("url", getUrl()) |
|||
.append("sourceUnit", getSourceUnit()) |
|||
.append("isOpen", getIsOpen()) |
|||
.append("status", getStatus()) |
|||
.append("isDelete", getIsDelete()) |
|||
.append("creator", getCreator()) |
|||
.append("createTime", getCreateTime()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,63 @@ |
|||
package com.zdxt.knowledge.mapper; |
|||
|
|||
|
|||
import com.zdxt.knowledge.domain.SceneManage; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 【请填写功能名称】Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-12-25 |
|||
*/ |
|||
public interface SceneManageMapper |
|||
{ |
|||
/** |
|||
* 查询【请填写功能名称】 |
|||
* |
|||
* @param id 【请填写功能名称】ID |
|||
* @return 【请填写功能名称】 |
|||
*/ |
|||
public SceneManage selectSceneManageById(Long id); |
|||
|
|||
/** |
|||
* 查询【请填写功能名称】列表 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 【请填写功能名称】集合 |
|||
*/ |
|||
public List<SceneManage> selectSceneManageList(SceneManage sceneManage); |
|||
|
|||
/** |
|||
* 新增【请填写功能名称】 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSceneManage(SceneManage sceneManage); |
|||
|
|||
/** |
|||
* 修改【请填写功能名称】 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSceneManage(SceneManage sceneManage); |
|||
|
|||
/** |
|||
* 删除【请填写功能名称】 |
|||
* |
|||
* @param id 【请填写功能名称】ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSceneManageById(Long id); |
|||
|
|||
/** |
|||
* 批量删除【请填写功能名称】 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSceneManageByIds(String[] ids); |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package com.zdxt.knowledge.service; |
|||
|
|||
import com.zdxt.knowledge.domain.SceneManage; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 【请填写功能名称】Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-12-25 |
|||
*/ |
|||
public interface ISceneManageService |
|||
{ |
|||
/** |
|||
* 查询【请填写功能名称】 |
|||
* |
|||
* @param id 【请填写功能名称】ID |
|||
* @return 【请填写功能名称】 |
|||
*/ |
|||
public SceneManage selectSceneManageById(Long id); |
|||
|
|||
/** |
|||
* 查询【请填写功能名称】列表 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 【请填写功能名称】集合 |
|||
*/ |
|||
public List<SceneManage> selectSceneManageList(SceneManage sceneManage); |
|||
|
|||
/** |
|||
* 新增【请填写功能名称】 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSceneManage(SceneManage sceneManage); |
|||
|
|||
/** |
|||
* 修改【请填写功能名称】 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSceneManage(SceneManage sceneManage); |
|||
|
|||
/** |
|||
* 批量删除【请填写功能名称】 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSceneManageByIds(String ids); |
|||
|
|||
/** |
|||
* 删除【请填写功能名称】信息 |
|||
* |
|||
* @param id 【请填写功能名称】ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSceneManageById(Long id); |
|||
} |
|||
@ -0,0 +1,99 @@ |
|||
package com.zdxt.knowledge.service.impl; |
|||
|
|||
|
|||
import com.zdxt.common.util.Convert; |
|||
import com.zdxt.common.util.DateUtils; |
|||
import com.zdxt.knowledge.domain.SceneManage; |
|||
import com.zdxt.knowledge.mapper.SceneManageMapper; |
|||
import com.zdxt.knowledge.service.ISceneManageService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 【请填写功能名称】Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-12-25 |
|||
*/ |
|||
@Service |
|||
public class SceneManageServiceImpl implements ISceneManageService |
|||
{ |
|||
@Autowired |
|||
private SceneManageMapper sceneManageMapper; |
|||
|
|||
/** |
|||
* 查询【请填写功能名称】 |
|||
* |
|||
* @param id 【请填写功能名称】ID |
|||
* @return 【请填写功能名称】 |
|||
*/ |
|||
@Override |
|||
public SceneManage selectSceneManageById(Long id) |
|||
{ |
|||
return sceneManageMapper.selectSceneManageById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询【请填写功能名称】列表 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 【请填写功能名称】 |
|||
*/ |
|||
@Override |
|||
public List<SceneManage> selectSceneManageList(SceneManage sceneManage) |
|||
{ |
|||
return sceneManageMapper.selectSceneManageList(sceneManage); |
|||
} |
|||
|
|||
/** |
|||
* 新增【请填写功能名称】 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertSceneManage(SceneManage sceneManage) |
|||
{ |
|||
sceneManage.setCreateTime(DateUtils.getNowDate()); |
|||
return sceneManageMapper.insertSceneManage(sceneManage); |
|||
} |
|||
|
|||
/** |
|||
* 修改【请填写功能名称】 |
|||
* |
|||
* @param sceneManage 【请填写功能名称】 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateSceneManage(SceneManage sceneManage) |
|||
{ |
|||
sceneManage.setUpdateTime(DateUtils.getNowDate()); |
|||
return sceneManageMapper.updateSceneManage(sceneManage); |
|||
} |
|||
|
|||
/** |
|||
* 删除【请填写功能名称】对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSceneManageByIds(String ids) |
|||
{ |
|||
return sceneManageMapper.deleteSceneManageByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除【请填写功能名称】信息 |
|||
* |
|||
* @param id 【请填写功能名称】ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSceneManageById(Long id) |
|||
{ |
|||
return sceneManageMapper.deleteSceneManageById(id); |
|||
} |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
<?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.zdxt.knowledge.mapper.SceneManageMapper"> |
|||
|
|||
<resultMap type="com.zdxt.knowledge.domain.SceneManage" id="SceneManageResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="name" column="name" /> |
|||
<result property="type" column="type" /> |
|||
<result property="url" column="url" /> |
|||
<result property="sourceUnit" column="source_unit" /> |
|||
<result property="isOpen" column="is_open" /> |
|||
<result property="status" column="status" /> |
|||
<result property="isDelete" column="is_delete" /> |
|||
<result property="creator" column="creator" /> |
|||
<result property="createTime" column="create_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectSceneManageVo"> |
|||
select id, name, type, url, source_unit, is_open, status, is_delete, creator, create_time from scene_manage |
|||
</sql> |
|||
|
|||
<select id="selectSceneManageList" parameterType="SceneManage" resultMap="SceneManageResult"> |
|||
<include refid="selectSceneManageVo"/> |
|||
<where> |
|||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
|||
<if test="type != null "> and type = #{type}</if> |
|||
<if test="url != null and url != ''"> and url = #{url}</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''"> and source_unit = #{sourceUnit}</if> |
|||
<if test="isOpen != null "> and is_open = #{isOpen}</if> |
|||
<if test="status != null "> and status = #{status}</if> |
|||
<if test="isDelete != null "> and is_delete = #{isDelete}</if> |
|||
<if test="creator != null and creator != ''"> and creator = #{creator}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectSceneManageById" parameterType="Long" resultMap="SceneManageResult"> |
|||
<include refid="selectSceneManageVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertSceneManage" parameterType="SceneManage" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into scene_manage |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="name != null and name != ''">name,</if> |
|||
<if test="type != null ">type,</if> |
|||
<if test="url != null and url != ''">url,</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">source_unit,</if> |
|||
<if test="isOpen != null ">is_open,</if> |
|||
<if test="status != null ">status,</if> |
|||
<if test="isDelete != null ">is_delete,</if> |
|||
<if test="creator != null and creator != ''">creator,</if> |
|||
<if test="createTime != null ">create_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="name != null and name != ''">#{name},</if> |
|||
<if test="type != null ">#{type},</if> |
|||
<if test="url != null and url != ''">#{url},</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">#{sourceUnit},</if> |
|||
<if test="isOpen != null ">#{isOpen},</if> |
|||
<if test="status != null ">#{status},</if> |
|||
<if test="isDelete != null ">#{isDelete},</if> |
|||
<if test="creator != null and creator != ''">#{creator},</if> |
|||
<if test="createTime != null ">#{createTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateSceneManage" parameterType="SceneManage"> |
|||
update scene_manage |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="name != null and name != ''">name = #{name},</if> |
|||
<if test="type != null ">type = #{type},</if> |
|||
<if test="url != null and url != ''">url = #{url},</if> |
|||
<if test="sourceUnit != null and sourceUnit != ''">source_unit = #{sourceUnit},</if> |
|||
<if test="isOpen != null ">is_open = #{isOpen},</if> |
|||
<if test="status != null ">status = #{status},</if> |
|||
<if test="isDelete != null ">is_delete = #{isDelete},</if> |
|||
<if test="creator != null and creator != ''">creator = #{creator},</if> |
|||
<if test="createTime != null ">create_time = #{createTime},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteSceneManageById" parameterType="Long"> |
|||
delete from scene_manage where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteSceneManageByIds" parameterType="String"> |
|||
delete from scene_manage where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue