知识库界面
This commit is contained in:
parent
f8d625ae33
commit
9bc3ceb319
@ -25,4 +25,6 @@ public class XmKnowledge {
|
||||
private String bz;
|
||||
private String zjf;
|
||||
private String xsbz;
|
||||
|
||||
private String inputData;
|
||||
}
|
||||
|
||||
@ -28,5 +28,6 @@ public class SysLogConstants {
|
||||
public static final String XMMEDGROUP_LOG = "常用抗生素组";
|
||||
public static final String XMMEDINSTR_LOG = "抗生素通道号设定";
|
||||
public static final String XMMEDMAIN_LOG = "细菌抗生素组对照";
|
||||
public static final String XMKNOWLEDGE_LOG = "知识库";
|
||||
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ public class WebSocketInstrComm extends WebSocketServer {
|
||||
|
||||
/**
|
||||
* 接收消息
|
||||
* 格式:{"yq":""}
|
||||
* @param message 客户端发送过来的消息
|
||||
* @param sid
|
||||
*/
|
||||
|
||||
@ -10,6 +10,7 @@ import com.czlis.common.core.domain.entity.lis.ComDict;
|
||||
import com.czlis.common.enums.BusinessType;
|
||||
import com.czlis.common.utils.poi.ExcelUtil;
|
||||
import com.czlis.interfaceCommon.constants.SysLogConstants;
|
||||
import com.czlis.interfaceCommon.websocket.WebSocketInstrComm;
|
||||
import com.czlis.liswork.service.ComDictService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -32,6 +33,8 @@ public class DictController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ComDictService comDictService;
|
||||
@Autowired
|
||||
WebSocketInstrComm webSocketInstrComm;
|
||||
|
||||
/**
|
||||
* 获取字典列表
|
||||
@ -104,4 +107,11 @@ public class DictController extends BaseController {
|
||||
return comDictService.insertComDictList(comDictList, updateSupport);
|
||||
}
|
||||
|
||||
@ApiOperation("测试服务")
|
||||
@GetMapping("/test1")
|
||||
public Result test1(){
|
||||
String jsonStr = "{\"data\":\"1234\"}";
|
||||
webSocketInstrComm.sendToAllClient(jsonStr);
|
||||
return new Result("0","成功!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package com.czlis.liswork.controller.xtwh;
|
||||
|
||||
import com.czlis.common.annotation.Log;
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.XmKnowledge;
|
||||
import com.czlis.common.core.page.TableDataInfo;
|
||||
import com.czlis.common.enums.BusinessType;
|
||||
import com.czlis.interfaceCommon.constants.SysLogConstants;
|
||||
import com.czlis.liswork.service.XmKnowledgeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "知识库")
|
||||
@RestController
|
||||
@RequestMapping("/xmKnowledge")
|
||||
@Slf4j
|
||||
public class XmKnowledgeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private XmKnowledgeService xmKnowledgeService;
|
||||
|
||||
@ApiOperation("获取数据")
|
||||
@GetMapping("/query")
|
||||
public TableDataInfo queryData(XmKnowledge xmKnowledge) {
|
||||
startPage();
|
||||
List<XmKnowledge> xmKnowledgeList = xmKnowledgeService.queryData(xmKnowledge);
|
||||
return getDataTable(xmKnowledgeList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取明细数据")
|
||||
@GetMapping("/detail")
|
||||
public Result queryDetail(XmKnowledge xmKnowledge){
|
||||
return xmKnowledgeService.queryDetail(xmKnowledge);
|
||||
}
|
||||
|
||||
@ApiOperation("新增数据")
|
||||
@Log(title = SysLogConstants.XMKNOWLEDGE_LOG,businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public Result add(XmKnowledge xmKnowledge) {
|
||||
return xmKnowledgeService.add(xmKnowledge);
|
||||
}
|
||||
|
||||
@ApiOperation("修改数据")
|
||||
@Log(title = SysLogConstants.XMKNOWLEDGE_LOG,businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public Result update(XmKnowledge xmKnowledge){
|
||||
return xmKnowledgeService.update(xmKnowledge);
|
||||
}
|
||||
|
||||
@ApiOperation("删除数据")
|
||||
@Log(title = SysLogConstants.XMKNOWLEDGE_LOG,businessType = BusinessType.DELETE)
|
||||
@GetMapping("/del")
|
||||
public Result delete(String xmid) {
|
||||
return xmKnowledgeService.delete(xmid);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.czlis.liswork.mapper.xtwh;
|
||||
|
||||
import com.czlis.common.core.domain.entity.lis.XmKnowledge;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public interface XmKnowledgeMapper {
|
||||
List<XmKnowledge> query(XmKnowledge knowledge);
|
||||
|
||||
void add(XmKnowledge xmKnowledge);
|
||||
|
||||
void update(XmKnowledge xmKnowledge);
|
||||
|
||||
void delete(String xmid);
|
||||
|
||||
List<Map<String, Objects>> queryDetail(XmKnowledge xmKnowledge);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.czlis.liswork.service;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.XmKnowledge;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface XmKnowledgeService {
|
||||
List<XmKnowledge> queryData(XmKnowledge xmKnowledge);
|
||||
|
||||
Result add(XmKnowledge xmKnowledge);
|
||||
|
||||
Result update(XmKnowledge xmKnowledge);
|
||||
|
||||
Result delete(String xmid);
|
||||
|
||||
Result queryDetail(XmKnowledge xmKnowledge);
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.czlis.liswork.service.impl.xtwh;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.XmKnowledge;
|
||||
import com.czlis.liswork.mapper.xtwh.XmKnowledgeMapper;
|
||||
import com.czlis.liswork.service.XmKnowledgeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class XmKnowledgeServiceImpl implements XmKnowledgeService {
|
||||
|
||||
@Autowired
|
||||
private XmKnowledgeMapper xmKnowledgeMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<XmKnowledge> queryData(XmKnowledge xmKnowledge) {
|
||||
return xmKnowledgeMapper.query(xmKnowledge);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result add(XmKnowledge xmKnowledge) {
|
||||
xmKnowledgeMapper.add(xmKnowledge);
|
||||
return new Result("0","新增数据成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result update(XmKnowledge xmKnowledge) {
|
||||
xmKnowledgeMapper.update(xmKnowledge);
|
||||
return new Result("0","修改数据成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result delete(String xmid) {
|
||||
xmKnowledgeMapper.delete(xmid);
|
||||
return new Result("0","删除成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result queryDetail(XmKnowledge xmKnowledge) {
|
||||
List<Map<String, Objects>> mapList = xmKnowledgeMapper.queryDetail(xmKnowledge);
|
||||
return new Result("0","获取数据成功!",mapList);
|
||||
}
|
||||
}
|
||||
103
liswork/src/main/resources/mapper/XmKnowledgeMapper.xml
Normal file
103
liswork/src/main/resources/mapper/XmKnowledgeMapper.xml
Normal file
@ -0,0 +1,103 @@
|
||||
<?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.czlis.liswork.mapper.xtwh.XmKnowledgeMapper">
|
||||
<select id="query" resultType="com.czlis.common.core.domain.entity.lis.XmKnowledge">
|
||||
select * from xm_knowledge
|
||||
<where>
|
||||
<if test="xmid != null and xmid != ''"> and xmid = #{xmid}</if>
|
||||
<if test="xmdh != null and xmdh != ''"> and xmdh = #{xmdh}</if>
|
||||
<if test="xmmc != null and xmmc != ''"> and xmmc like '%'+#{xmdh}+'%' </if>
|
||||
<if test="inputData != null and inputData !=''">and (xmdh like '%'+#{inputData}+'%' or xmmc like '%'+#{inputData}+'%' or zjf like '%'+#{inputData}+'%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="add">
|
||||
insert into xm_knowledge(
|
||||
<if test="xmdh != null and xmdh != ''">xmdh,</if>
|
||||
<if test="xmmc != null and xmmc != ''">xmmc,</if>
|
||||
<if test="xmlb != null and xmlb != ''">xmlb,</if>
|
||||
<if test="xmz != null and xmz != ''">xmz,</if>
|
||||
<if test="dw != null and dw != ''">dw,</if>
|
||||
<if test="cksx != null">cksx,</if>
|
||||
<if test="ckxx != null">ckxx,</if>
|
||||
<if test="dyckz != null and dyckz !=''">dyckz,</if>
|
||||
<if test="dyxh != null">dyxh,</if>
|
||||
<if test="jsgs != null and jsgs !=''">jsgs,</if>
|
||||
<if test="lcyy != null and lcyy !=''">lcyy,</if>
|
||||
<if test="bz != null and bz !=''">bz,</if>
|
||||
<if test="zjf != null and zjf !=''">zjf,</if>
|
||||
<if test="xsbz != null and xsbz !=''">xsbz,</if>
|
||||
xmid
|
||||
)values(
|
||||
<if test="xmdh != null and xmdh != ''">#{xmdh},</if>
|
||||
<if test="xmmc != null and xmmc != ''">#{xmmc},</if>
|
||||
<if test="xmlb != null and xmlb != ''">#{xmlb},</if>
|
||||
<if test="xmz != null and xmz != ''">#{xmz},</if>
|
||||
<if test="dw != null and dw != ''">#{dw},</if>
|
||||
<if test="cksx != null">#{cksx},</if>
|
||||
<if test="ckxx != null">#{ckxx},</if>
|
||||
<if test="dyckz != null and dyckz !=''">#{dyckz},</if>
|
||||
<if test="dyxh != null">#{dyxh},</if>
|
||||
<if test="jsgs != null and jsgs !=''">#{jsgs},</if>
|
||||
<if test="lcyy != null and lcyy !=''">#{lcyy},</if>
|
||||
<if test="bz != null and bz !=''">#{bz},</if>
|
||||
<if test="zjf != null and zjf !=''">#{zjf},</if>
|
||||
<if test="xsbz != null and xsbz !=''">#{xsbz},</if>
|
||||
#{xmid}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update xm_knowledge
|
||||
<set>
|
||||
<if test="xmdh != null and xmdh != ''">xmdh = #{xmdh},</if>
|
||||
<if test="xmmc != null and xmmc != ''">xmmc = #{xmmc},</if>
|
||||
<if test="xmlb != null and xmlb != ''">xmlb = #{xmlb},</if>
|
||||
<if test="xmz != null and xmz != ''">xmz = #{xmz},</if>
|
||||
<if test="dw != null and dw != ''">dw = #{dw},</if>
|
||||
<if test="cksx != null">cksx = #{cksx},</if>
|
||||
<if test="ckxx != null">ckxx = #{ckxx},</if>
|
||||
<if test="dyckz != null and dyckz !=''">dyckz = #{dyckz},</if>
|
||||
<if test="dyxh != null">dyxh = #{dyxh},</if>
|
||||
<if test="jsgs != null and jsgs !=''">jsgs = #{jsgs},</if>
|
||||
<if test="lcyy != null and lcyy !=''">lcyy = #{lcyy},</if>
|
||||
<if test="bz != null and bz !=''">bz = #{bz},</if>
|
||||
<if test="zjf != null and zjf !=''">zjf = #{zjf},</if>
|
||||
<if test="xsbz != null and xsbz !=''">xsbz = #{xsbz},</if>
|
||||
xmid = #{xmid}
|
||||
</set>
|
||||
where xmid = #{xmid}
|
||||
</update>
|
||||
|
||||
<delete id="delete">
|
||||
delete from xm_knowledge where xmid = #{xmid}
|
||||
</delete>
|
||||
|
||||
<select id="queryDetail" resultType="map">
|
||||
select reserve_info.reserve,
|
||||
xm_textresult.yq,
|
||||
xm_textresult.xmdh,
|
||||
xm_textresult.xh,
|
||||
(case xm_textresult.reserve when '1' then yxjs else cjyy end) as textresult,
|
||||
xm_textresult.zd
|
||||
from
|
||||
(select '1' as reserve
|
||||
union all
|
||||
select 'H' as reserve
|
||||
union all
|
||||
select 'L' as reserve
|
||||
union all
|
||||
select 'P' as reserve
|
||||
union all
|
||||
select 'Q' as reserve
|
||||
union all
|
||||
select 'J' as reserve) reserve_info
|
||||
left outer join xm_textresult on xm_textresult.reserve = reserve_info.reserve and xm_textresult.xmdh = #{xmdh}
|
||||
order by reserve_info.reserve
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user