8 changed files with 804 additions and 93 deletions
@ -1,94 +1,100 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
<parent> |
||||
<artifactId>EmergencyService</artifactId> |
<artifactId>EmergencyService</artifactId> |
||||
<groupId>EmergencyService</groupId> |
<groupId>EmergencyService</groupId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</parent> |
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
<artifactId>zdxtEmergencyBootStart</artifactId> |
<artifactId>zdxtEmergencyBootStart</artifactId> |
||||
|
|
||||
<dependencies> |
<dependencies> |
||||
|
|
||||
|
|
||||
<dependency> |
<dependency> |
||||
<groupId>EmergencyService</groupId> |
<groupId>EmergencyService</groupId> |
||||
<artifactId>zdxtEmergencyAuthService</artifactId> |
<artifactId>zdxtEmergencyAuthService</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
|
|
||||
<dependency> |
<dependency> |
||||
<groupId>EmergencyService</groupId> |
<groupId>EmergencyService</groupId> |
||||
<artifactId>zdxtEmergencyAppService</artifactId> |
<artifactId>zdxtEmergencyAppService</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
|
|
||||
<dependency> |
<dependency> |
||||
<groupId>EmergencyService</groupId> |
<groupId>EmergencyService</groupId> |
||||
<artifactId>zdxtEmergencyMessageService</artifactId> |
<artifactId>zdxtEmergencyMessageService</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
|
|
||||
<dependency> |
<dependency> |
||||
<groupId>ZdxtComponent</groupId> |
<groupId>ZdxtComponent</groupId> |
||||
<artifactId>zdxtVisualizationComponent</artifactId> |
<artifactId>zdxtVisualizationComponent</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
<dependency> |
<dependency> |
||||
<groupId>ZdxtComponent</groupId> |
<groupId>ZdxtComponent</groupId> |
||||
<artifactId>zdxtBaiduUeditorComponent</artifactId> |
<artifactId>zdxtBaiduUeditorComponent</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
<dependency> |
<dependency> |
||||
<groupId>ZdxtComponent</groupId> |
<groupId>ZdxtComponent</groupId> |
||||
<artifactId>zdxtTableManagementComponent</artifactId> |
<artifactId>zdxtTableManagementComponent</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
<dependency> |
<dependency> |
||||
<groupId>EmergencyService</groupId> |
<groupId>EmergencyService</groupId> |
||||
<artifactId>zdxtEmergencyExcelService</artifactId> |
<artifactId>zdxtEmergencyExcelService</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
|
|
||||
<dependency> |
<dependency> |
||||
<groupId>ZdxtComponent</groupId> |
<groupId>ZdxtComponent</groupId> |
||||
<artifactId>zdxtAutoCodeComponent</artifactId> |
<artifactId>zdxtAutoCodeComponent</artifactId> |
||||
<version>1.0</version> |
<version>1.0</version> |
||||
</dependency> |
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>EmergencyService</groupId> |
||||
<dependency> |
<artifactId>zdxtEmergencyKnowledgeService</artifactId> |
||||
<groupId>EmergencyService</groupId> |
<version>1.0</version> |
||||
<artifactId>zdxtEmergencyJt808Service</artifactId> |
</dependency> |
||||
<version>1.0</version> |
|
||||
</dependency> |
|
||||
<!--<dependency>--> |
|
||||
<!--<groupId>ZdxtComponent</groupId>--> |
<dependency> |
||||
<!--<artifactId>zdxtDynamicFormComponent</artifactId>--> |
<groupId>EmergencyService</groupId> |
||||
<!--<version>1.0</version>--> |
<artifactId>zdxtEmergencyJt808Service</artifactId> |
||||
<!--</dependency>--> |
<version>1.0</version> |
||||
<!-- <dependency>--> |
</dependency> |
||||
<!-- <groupId>zdxtFlowComponent</groupId>--> |
<!--<dependency>--> |
||||
<!-- <artifactId>zdxtFlowComponent</artifactId>--> |
<!--<groupId>ZdxtComponent</groupId>--> |
||||
<!-- <version>1.0</version>--> |
<!--<artifactId>zdxtDynamicFormComponent</artifactId>--> |
||||
<!-- </dependency>--> |
<!--<version>1.0</version>--> |
||||
</dependencies> |
<!--</dependency>--> |
||||
|
<!-- <dependency>--> |
||||
<build> |
<!-- <groupId>zdxtFlowComponent</groupId>--> |
||||
<finalName>${project.artifactId}</finalName> |
<!-- <artifactId>zdxtFlowComponent</artifactId>--> |
||||
<plugins> |
<!-- <version>1.0</version>--> |
||||
<plugin> |
<!-- </dependency>--> |
||||
<groupId>org.springframework.boot</groupId> |
</dependencies> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
|
||||
<configuration> |
<build> |
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> |
<finalName>${project.artifactId}</finalName> |
||||
</configuration> |
<plugins> |
||||
</plugin> |
<plugin> |
||||
</plugins> |
<groupId>org.springframework.boot</groupId> |
||||
</build> |
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
<configuration> |
||||
|
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> |
||||
|
</configuration> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
</project> |
</project> |
||||
@ -0,0 +1,151 @@ |
|||||
|
<!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="post-form"> |
||||
|
<div class="select-list"> |
||||
|
<ul> |
||||
|
<!--<li> |
||||
|
职务编码:<input type="text" name="postCode" placeholder="请输入职务编码"/> |
||||
|
</li>--> |
||||
|
<li> |
||||
|
职务名称:<input type="text" name="postName" placeholder="请输入职务名称"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
职务状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}"> |
||||
|
<option value="">所有</option> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
||||
|
th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li class="select-time"> |
||||
|
<p>创建时间:</p> |
||||
|
<input type="text" class="time-input" id="createTime" placeholder="年-月-日" name="createTime" style="width: 200px;"/> |
||||
|
</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.add(100,813,420)" shiro:hasPermission="system:post:add"> |
||||
|
<i class="fa fa-plus"></i> 新增 |
||||
|
</a> |
||||
|
<!--<a class="btn btn-primary single disabled" onclick="$.operate.edit(null,813,420)" |
||||
|
shiro:hasPermission="system:post:edit"> |
||||
|
<i class="fa fa-edit"></i> 修改 |
||||
|
</a>--> |
||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" |
||||
|
shiro:hasPermission="system:post:remove"> |
||||
|
<i class="fa fa-remove"></i> 全部删除 |
||||
|
</a> |
||||
|
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export"> |
||||
|
<i class="fa fa-upload"></i> 导出 |
||||
|
</a>--> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-sm-12 select-table table-bordered"> |
||||
|
<table id="bootstrap-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer"/> |
||||
|
<script th:inline="javascript"> |
||||
|
var editFlag = [[${@permission.hasPermi('system:post:edit')}]]; |
||||
|
var removeFlag = [[${@permission.hasPermi('system:post:remove')}]]; |
||||
|
var datas = [[${@dict.getType('sys_normal_disable')}]]; |
||||
|
var prefix = ctx + "small/library"; |
||||
|
|
||||
|
$(function () { |
||||
|
var exportb = [[${@permission.hasPermi('system:post:export')}]]; |
||||
|
var exportboolen = (exportb==""?true:false) |
||||
|
|
||||
|
var options = { |
||||
|
url: prefix + "/list", |
||||
|
createUrl: prefix + "/add", |
||||
|
updateUrl: prefix + "/edit/{id}", |
||||
|
detailUrl: prefix + "/detail/{id}", |
||||
|
removeUrl: prefix + "/remove", |
||||
|
exportUrl: prefix + "/export", |
||||
|
sortName: "postSort", |
||||
|
modalName: "职务", |
||||
|
uniqueId:"postId", |
||||
|
showCustomExport:exportboolen, |
||||
|
customExportFunction:function(){ |
||||
|
$.table.exportExcel(); |
||||
|
}, |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
title: '序号', |
||||
|
align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
return $.table.serialNumber(index); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'title', |
||||
|
title: '标题', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'flag', |
||||
|
title: '标签', |
||||
|
sortable: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'state', |
||||
|
title: '状态', |
||||
|
align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
return $.table.selectDictLabel(datas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'publishdate', |
||||
|
title: '发布时间', |
||||
|
sortable: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'publishstate', |
||||
|
title: '发布状态', |
||||
|
align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
return $.table.selectDictLabel(datas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'examinestate', |
||||
|
title: '审核状态', |
||||
|
align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
return $.table.selectDictLabel(datas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
title: '操作', |
||||
|
align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
var actions = []; |
||||
|
// actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.postId + '\',813,420)"><i class="fa fa-eye"></i> 查看</a> '); |
||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.postId + '\',813,420)"><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.postId + '\')"><i class="fa fa-remove"></i> 删除</a>'); |
||||
|
return actions.join(''); |
||||
|
} |
||||
|
}] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,107 @@ |
|||||
|
package com.zdxt.knowledge.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import com.zdxt.knowledge.domain.KnowledgeLibrary; |
||||
|
import com.zdxt.knowledge.service.IKnowledgeLibraryService; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 知识库Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2023-12-25 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/small/library") |
||||
|
public class KnowledgeLibraryController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "project/smallProgram/library"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IKnowledgeLibraryService knowledgeLibraryService; |
||||
|
|
||||
|
@RequiresPermissions("small:library:view") |
||||
|
@GetMapping() |
||||
|
public String library() |
||||
|
{ |
||||
|
return prefix + "/view"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询知识库列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("small:library:view") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(KnowledgeLibrary knowledgeLibrary) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<KnowledgeLibrary> list = knowledgeLibraryService.selectKnowledgeLibraryList(knowledgeLibrary); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增知识库 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存知识库 |
||||
|
*/ |
||||
|
@RequiresPermissions("small:library:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(KnowledgeLibrary knowledgeLibrary) |
||||
|
{ |
||||
|
return ZDResponse.success("操作成功", knowledgeLibraryService.insertKnowledgeLibrary(knowledgeLibrary)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改知识库 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{guid}") |
||||
|
public String edit(@PathVariable("guid") String guid, ModelMap mmap) |
||||
|
{ |
||||
|
KnowledgeLibrary knowledgeLibrary = knowledgeLibraryService.selectKnowledgeLibraryById(guid); |
||||
|
mmap.put("knowledgeLibrary", knowledgeLibrary); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存知识库 |
||||
|
*/ |
||||
|
@RequiresPermissions("small:library:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(KnowledgeLibrary knowledgeLibrary) |
||||
|
{ |
||||
|
return ZDResponse.success("操作成功", knowledgeLibraryService.updateKnowledgeLibrary(knowledgeLibrary)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除知识库 |
||||
|
*/ |
||||
|
@RequiresPermissions("small:library:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return ZDResponse.success("操作成功", knowledgeLibraryService.deleteKnowledgeLibraryByIds(ids)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,116 @@ |
|||||
|
package com.zdxt.knowledge.domain; |
||||
|
|
||||
|
import com.zdxt.common.BaseDomain; |
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 知识库对象 knowledge_library |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2023-12-25 |
||||
|
*/ |
||||
|
public class KnowledgeLibrary extends BaseDomain |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 主键 */ |
||||
|
private String guid; |
||||
|
|
||||
|
/** 标题 */ |
||||
|
private String title; |
||||
|
|
||||
|
/** 内容 */ |
||||
|
private String content; |
||||
|
|
||||
|
/** 标签(关联字典表) */ |
||||
|
private String flag; |
||||
|
|
||||
|
/** 排序 */ |
||||
|
private Long srot; |
||||
|
|
||||
|
/** 状态 */ |
||||
|
private String state; |
||||
|
|
||||
|
/** 发布时间 */ |
||||
|
private String publishdate; |
||||
|
|
||||
|
/** 发布状态(0:待发布,1:已发布,2:已上线,3已下线) */ |
||||
|
private Integer publishstate; |
||||
|
|
||||
|
/** 审核状态(0:未审核,1:已审核) */ |
||||
|
private Integer examinestate; |
||||
|
|
||||
|
public String getGuid() { |
||||
|
return guid; |
||||
|
} |
||||
|
|
||||
|
public void setGuid(String guid) { |
||||
|
this.guid = guid; |
||||
|
} |
||||
|
|
||||
|
public String getTitle() { |
||||
|
return title; |
||||
|
} |
||||
|
|
||||
|
public void setTitle(String title) { |
||||
|
this.title = title; |
||||
|
} |
||||
|
|
||||
|
public String getContent() { |
||||
|
return content; |
||||
|
} |
||||
|
|
||||
|
public void setContent(String content) { |
||||
|
this.content = content; |
||||
|
} |
||||
|
|
||||
|
public String getFlag() { |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
public void setFlag(String flag) { |
||||
|
this.flag = flag; |
||||
|
} |
||||
|
|
||||
|
public Long getSrot() { |
||||
|
return srot; |
||||
|
} |
||||
|
|
||||
|
public void setSrot(Long srot) { |
||||
|
this.srot = srot; |
||||
|
} |
||||
|
|
||||
|
public String getState() { |
||||
|
return state; |
||||
|
} |
||||
|
|
||||
|
public void setState(String state) { |
||||
|
this.state = state; |
||||
|
} |
||||
|
|
||||
|
public String getPublishdate() { |
||||
|
return publishdate; |
||||
|
} |
||||
|
|
||||
|
public void setPublishdate(String publishdate) { |
||||
|
this.publishdate = publishdate; |
||||
|
} |
||||
|
|
||||
|
public Integer getPublishstate() { |
||||
|
return publishstate; |
||||
|
} |
||||
|
|
||||
|
public void setPublishstate(Integer publishstate) { |
||||
|
this.publishstate = publishstate; |
||||
|
} |
||||
|
|
||||
|
public Integer getExaminestate() { |
||||
|
return examinestate; |
||||
|
} |
||||
|
|
||||
|
public void setExaminestate(Integer examinestate) { |
||||
|
this.examinestate = examinestate; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,62 @@ |
|||||
|
package com.zdxt.knowledge.mapper; |
||||
|
|
||||
|
import com.zdxt.knowledge.domain.KnowledgeLibrary; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 知识库Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2023-12-25 |
||||
|
*/ |
||||
|
public interface KnowledgeLibraryMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询知识库 |
||||
|
* |
||||
|
* @param guid 知识库ID |
||||
|
* @return 知识库 |
||||
|
*/ |
||||
|
public KnowledgeLibrary selectKnowledgeLibraryById(String guid); |
||||
|
|
||||
|
/** |
||||
|
* 查询知识库列表 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 知识库集合 |
||||
|
*/ |
||||
|
public List<KnowledgeLibrary> selectKnowledgeLibraryList(KnowledgeLibrary knowledgeLibrary); |
||||
|
|
||||
|
/** |
||||
|
* 新增知识库 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertKnowledgeLibrary(KnowledgeLibrary knowledgeLibrary); |
||||
|
|
||||
|
/** |
||||
|
* 修改知识库 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateKnowledgeLibrary(KnowledgeLibrary knowledgeLibrary); |
||||
|
|
||||
|
/** |
||||
|
* 删除知识库 |
||||
|
* |
||||
|
* @param guid 知识库ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteKnowledgeLibraryById(String guid); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除知识库 |
||||
|
* |
||||
|
* @param guids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteKnowledgeLibraryByIds(String[] guids); |
||||
|
} |
||||
@ -0,0 +1,62 @@ |
|||||
|
package com.zdxt.knowledge.service; |
||||
|
|
||||
|
import com.zdxt.knowledge.domain.KnowledgeLibrary; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 知识库Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2023-12-25 |
||||
|
*/ |
||||
|
public interface IKnowledgeLibraryService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询知识库 |
||||
|
* |
||||
|
* @param guid 知识库ID |
||||
|
* @return 知识库 |
||||
|
*/ |
||||
|
public KnowledgeLibrary selectKnowledgeLibraryById(String guid); |
||||
|
|
||||
|
/** |
||||
|
* 查询知识库列表 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 知识库集合 |
||||
|
*/ |
||||
|
public List<KnowledgeLibrary> selectKnowledgeLibraryList(KnowledgeLibrary knowledgeLibrary); |
||||
|
|
||||
|
/** |
||||
|
* 新增知识库 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertKnowledgeLibrary(KnowledgeLibrary knowledgeLibrary); |
||||
|
|
||||
|
/** |
||||
|
* 修改知识库 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateKnowledgeLibrary(KnowledgeLibrary knowledgeLibrary); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除知识库 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteKnowledgeLibraryByIds(String ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除知识库信息 |
||||
|
* |
||||
|
* @param guid 知识库ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteKnowledgeLibraryById(String guid); |
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
package com.zdxt.knowledge.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.zdxt.common.util.Convert; |
||||
|
import com.zdxt.knowledge.domain.KnowledgeLibrary; |
||||
|
import com.zdxt.knowledge.mapper.KnowledgeLibraryMapper; |
||||
|
import com.zdxt.knowledge.service.IKnowledgeLibraryService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 知识库Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2023-12-25 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class KnowledgeLibraryServiceImpl implements IKnowledgeLibraryService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private KnowledgeLibraryMapper knowledgeLibraryMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询知识库 |
||||
|
* |
||||
|
* @param guid 知识库ID |
||||
|
* @return 知识库 |
||||
|
*/ |
||||
|
@Override |
||||
|
public KnowledgeLibrary selectKnowledgeLibraryById(String guid) |
||||
|
{ |
||||
|
return knowledgeLibraryMapper.selectKnowledgeLibraryById(guid); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询知识库列表 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 知识库 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<KnowledgeLibrary> selectKnowledgeLibraryList(KnowledgeLibrary knowledgeLibrary) |
||||
|
{ |
||||
|
return knowledgeLibraryMapper.selectKnowledgeLibraryList(knowledgeLibrary); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增知识库 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertKnowledgeLibrary(KnowledgeLibrary knowledgeLibrary) |
||||
|
{ |
||||
|
return knowledgeLibraryMapper.insertKnowledgeLibrary(knowledgeLibrary); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改知识库 |
||||
|
* |
||||
|
* @param knowledgeLibrary 知识库 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateKnowledgeLibrary(KnowledgeLibrary knowledgeLibrary) |
||||
|
{ |
||||
|
return knowledgeLibraryMapper.updateKnowledgeLibrary(knowledgeLibrary); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除知识库对象 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteKnowledgeLibraryByIds(String ids) |
||||
|
{ |
||||
|
return knowledgeLibraryMapper.deleteKnowledgeLibraryByIds(Convert.toStrArray(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除知识库信息 |
||||
|
* |
||||
|
* @param guid 知识库ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteKnowledgeLibraryById(String guid) |
||||
|
{ |
||||
|
return knowledgeLibraryMapper.deleteKnowledgeLibraryById(guid); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,112 @@ |
|||||
|
<?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.KnowledgeLibraryMapper"> |
||||
|
|
||||
|
<resultMap type="com.zdxt.knowledge.domain.KnowledgeLibrary" id="KnowledgeLibraryResult"> |
||||
|
<result property="guid" column="guid" /> |
||||
|
<result property="title" column="title" /> |
||||
|
<result property="content" column="content" /> |
||||
|
<result property="flag" column="flag" /> |
||||
|
<result property="srot" column="srot" /> |
||||
|
<result property="state" column="state" /> |
||||
|
<result property="publishdate" column="publishDate" /> |
||||
|
<result property="publishstate" column="publishState" /> |
||||
|
<result property="examinestate" column="examineState" /> |
||||
|
<result property="creator" column="creator" /> |
||||
|
<result property="createTime" column="create_time" /> |
||||
|
<result property="updator" column="updator" /> |
||||
|
<result property="updateTime" column="update_time" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectKnowledgeLibraryVo"> |
||||
|
select guid, title, content, flag, srot, state, publishDate, publishState, examineState, creator, create_time, updator, update_time from knowledge_library |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectKnowledgeLibraryList" parameterType="KnowledgeLibrary" resultMap="KnowledgeLibraryResult"> |
||||
|
<include refid="selectKnowledgeLibraryVo"/> |
||||
|
<where> |
||||
|
<if test="title != null and title != ''"> and title = #{title}</if> |
||||
|
<if test="content != null and content != ''"> and content = #{content}</if> |
||||
|
<if test="flag != null and flag != ''"> and flag = #{flag}</if> |
||||
|
<if test="srot != null "> and srot = #{srot}</if> |
||||
|
<if test="state != null and state != ''"> and state = #{state}</if> |
||||
|
<if test="publishdate != null and publishdate != ''"> and publishDate = #{publishdate}</if> |
||||
|
<if test="publishstate != null "> and publishState = #{publishstate}</if> |
||||
|
<if test="examinestate != null "> and examineState = #{examinestate}</if> |
||||
|
<if test="creator != null and creator != ''"> and creator = #{creator}</if> |
||||
|
<if test="updator != null and updator != ''"> and updator = #{updator}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectKnowledgeLibraryById" parameterType="String" resultMap="KnowledgeLibraryResult"> |
||||
|
<include refid="selectKnowledgeLibraryVo"/> |
||||
|
where guid = #{guid} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertKnowledgeLibrary" parameterType="KnowledgeLibrary"> |
||||
|
insert into knowledge_library |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="guid != null and guid != ''">guid,</if> |
||||
|
<if test="title != null and title != ''">title,</if> |
||||
|
<if test="content != null and content != ''">content,</if> |
||||
|
<if test="flag != null and flag != ''">flag,</if> |
||||
|
<if test="srot != null ">srot,</if> |
||||
|
<if test="state != null and state != ''">state,</if> |
||||
|
<if test="publishdate != null and publishdate != ''">publishDate,</if> |
||||
|
<if test="publishstate != null ">publishState,</if> |
||||
|
<if test="examinestate != null ">examineState,</if> |
||||
|
<if test="creator != null and creator != ''">creator,</if> |
||||
|
<if test="createTime != null ">create_time,</if> |
||||
|
<if test="updator != null and updator != ''">updator,</if> |
||||
|
<if test="updateTime != null ">update_time,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="guid != null and guid != ''">#{guid},</if> |
||||
|
<if test="title != null and title != ''">#{title},</if> |
||||
|
<if test="content != null and content != ''">#{content},</if> |
||||
|
<if test="flag != null and flag != ''">#{flag},</if> |
||||
|
<if test="srot != null ">#{srot},</if> |
||||
|
<if test="state != null and state != ''">#{state},</if> |
||||
|
<if test="publishdate != null and publishdate != ''">#{publishdate},</if> |
||||
|
<if test="publishstate != null ">#{publishstate},</if> |
||||
|
<if test="examinestate != null ">#{examinestate},</if> |
||||
|
<if test="creator != null and creator != ''">#{creator},</if> |
||||
|
<if test="createTime != null ">#{createTime},</if> |
||||
|
<if test="updator != null and updator != ''">#{updator},</if> |
||||
|
<if test="updateTime != null ">#{updateTime},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateKnowledgeLibrary" parameterType="KnowledgeLibrary"> |
||||
|
update knowledge_library |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="title != null and title != ''">title = #{title},</if> |
||||
|
<if test="content != null and content != ''">content = #{content},</if> |
||||
|
<if test="flag != null and flag != ''">flag = #{flag},</if> |
||||
|
<if test="srot != null ">srot = #{srot},</if> |
||||
|
<if test="state != null and state != ''">state = #{state},</if> |
||||
|
<if test="publishdate != null and publishdate != ''">publishDate = #{publishdate},</if> |
||||
|
<if test="publishstate != null ">publishState = #{publishstate},</if> |
||||
|
<if test="examinestate != null ">examineState = #{examinestate},</if> |
||||
|
<if test="creator != null and creator != ''">creator = #{creator},</if> |
||||
|
<if test="createTime != null ">create_time = #{createTime},</if> |
||||
|
<if test="updator != null and updator != ''">updator = #{updator},</if> |
||||
|
<if test="updateTime != null ">update_time = #{updateTime},</if> |
||||
|
</trim> |
||||
|
where guid = #{guid} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteKnowledgeLibraryById" parameterType="String"> |
||||
|
delete from knowledge_library where guid = #{guid} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteKnowledgeLibraryByIds" parameterType="String"> |
||||
|
delete from knowledge_library where guid in |
||||
|
<foreach item="guid" collection="array" open="(" separator="," close=")"> |
||||
|
#{guid} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue