知识库复制。
This commit is contained in:
parent
767b2004af
commit
5d7cf4450e
@ -135,6 +135,11 @@ public class ScriptInfo extends BaseEntity {
|
||||
|
||||
private String flowScheme;
|
||||
|
||||
/**
|
||||
* 公共库模板id
|
||||
*/
|
||||
private Long sourceTemplateId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@ -62,6 +62,13 @@ public class SignRouteTriggerCondition extends BaseEntity {
|
||||
@Excel(name = "排序")
|
||||
private Integer triggerConditionSort;
|
||||
|
||||
/**
|
||||
* and、or,说明:如果为or,则根据排序同前面条件或运算
|
||||
*/
|
||||
@ApiModelProperty(value = "and、or,说明:如果为or,则根据排序同前面条件或运算")
|
||||
@Excel(name = "and、or,说明:如果为or,则根据排序同前面条件或运算")
|
||||
private String triggerLogic;
|
||||
|
||||
/** 备注信息 */
|
||||
@ApiModelProperty(value = "备注信息")
|
||||
@Excel(name = "备注信息")
|
||||
|
||||
@ -107,6 +107,11 @@ public class TextMessage extends BaseEntity {
|
||||
@Excel(name = "短信备注")
|
||||
private String textMessageRemark;
|
||||
|
||||
/**
|
||||
* 公共模板库id
|
||||
*/
|
||||
private Long sourceTemplateId;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@ -100,6 +100,8 @@ public class WechatTemplate extends BaseEntity {
|
||||
@Excel(name = "模板备注")
|
||||
private String templateRemark;
|
||||
|
||||
private Long sourceTemplateId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.manage.dto.knowledgebase;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -14,7 +15,7 @@ public class KnowledgeBaseSaveDto {
|
||||
* 模板id
|
||||
*/
|
||||
@ApiModelProperty(value = "公共库模板id")
|
||||
private Long sourceTemplateId;
|
||||
private List<Long> sourceTemplateIds;
|
||||
|
||||
/**
|
||||
* 知识库类型
|
||||
|
||||
@ -56,4 +56,13 @@ public class BaseInfoQueryDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "微信模板名称")
|
||||
private String wechatTemplateName;
|
||||
|
||||
/**
|
||||
* 短信模板名称
|
||||
*/
|
||||
@ApiModelProperty(value = "短信模板名称")
|
||||
private String textMessageName;
|
||||
|
||||
@ApiModelProperty(value = "短信状态,上架:GROUNDING,下架:OFF_SHELF")
|
||||
private String textMessageStatus;
|
||||
}
|
||||
|
||||
@ -113,6 +113,11 @@ public class TextMessageTaskDTO extends BaseEntity {
|
||||
@Excel(name = "短信备注")
|
||||
private String textMessageRemark;
|
||||
|
||||
/**
|
||||
* 公共模板库id
|
||||
*/
|
||||
private Long sourceTemplateId;
|
||||
|
||||
@ApiModelProperty(value = "适用任务类型字典表ids")
|
||||
private Long[] suitTaskTypeIds;
|
||||
}
|
||||
|
||||
@ -108,6 +108,11 @@ public class WechatTemplateTaskDTO extends BaseEntity {
|
||||
@Excel(name = "模板备注")
|
||||
private String templateRemark;
|
||||
|
||||
/**
|
||||
* 公共知识库模板id
|
||||
*/
|
||||
private Long sourceTemplateId;
|
||||
|
||||
@ApiModelProperty(value = "适用任务类型字典表ids")
|
||||
private Long[] suitTaskTypeIds;
|
||||
}
|
||||
|
||||
@ -79,6 +79,8 @@ public interface TextMessageMapper {
|
||||
*/
|
||||
int insertTextMessageSuitTasks(List<TextMessageSuitTask> tasks);
|
||||
|
||||
List<TextMessageSuitTask> selectSuitTaskList(TextMessageSuitTask textMessageSuitTask);
|
||||
|
||||
/**
|
||||
* 批量删除短信模板适用任务类型
|
||||
*/
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xinelu.manage.mapper.wechattemplatesuittask;
|
||||
|
||||
import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 微信模板与适用任务类型关系Mapper接口
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
public interface WechatTemplateSuitTaskMapper {
|
||||
/**
|
||||
* 查询微信模板与适用任务类型关系
|
||||
*
|
||||
* @param id 微信模板与适用任务类型关系主键
|
||||
* @return 微信模板与适用任务类型关系
|
||||
*/
|
||||
WechatTemplateSuitTask selectWechatTemplateSuitTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询微信模板与适用任务类型关系列表
|
||||
*
|
||||
* @param wechatTemplateSuitTask 微信模板与适用任务类型关系
|
||||
* @return 微信模板与适用任务类型关系集合
|
||||
*/
|
||||
List<WechatTemplateSuitTask> selectWechatTemplateSuitTaskList(WechatTemplateSuitTask wechatTemplateSuitTask);
|
||||
|
||||
/**
|
||||
* 新增微信模板与适用任务类型关系
|
||||
*
|
||||
* @param wechatTemplateSuitTask 微信模板与适用任务类型关系
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWechatTemplateSuitTask(WechatTemplateSuitTask wechatTemplateSuitTask);
|
||||
|
||||
/**
|
||||
* 修改微信模板与适用任务类型关系
|
||||
*
|
||||
* @param wechatTemplateSuitTask 微信模板与适用任务类型关系
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWechatTemplateSuitTask(WechatTemplateSuitTask wechatTemplateSuitTask);
|
||||
|
||||
/**
|
||||
* 删除微信模板与适用任务类型关系
|
||||
*
|
||||
* @param id 微信模板与适用任务类型关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWechatTemplateSuitTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除微信模板与适用任务类型关系
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWechatTemplateSuitTaskByIds(Long[] ids);
|
||||
}
|
||||
@ -8,24 +8,38 @@ import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.PageUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType;
|
||||
import com.xinelu.manage.domain.operationInfo.OperationInfo;
|
||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||
import com.xinelu.manage.domain.textmessage.TextMessage;
|
||||
import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask;
|
||||
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
|
||||
import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask;
|
||||
import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto;
|
||||
import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto;
|
||||
import com.xinelu.manage.dto.operationinfo.OperationInfoDto;
|
||||
import com.xinelu.manage.dto.script.ScriptInfoDto;
|
||||
import com.xinelu.manage.dto.textmessage.TextMessageDTO;
|
||||
import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO;
|
||||
import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO;
|
||||
import com.xinelu.manage.dto.wechattemplate.WechatTemplateTaskDTO;
|
||||
import com.xinelu.manage.mapper.operationInfo.OperationInfoMapper;
|
||||
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
|
||||
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
|
||||
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
|
||||
import com.xinelu.manage.mapper.wechattemplatesuittask.WechatTemplateSuitTaskMapper;
|
||||
import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService;
|
||||
import com.xinelu.manage.service.knowledgebase.IKnowledgeBaseService;
|
||||
import com.xinelu.manage.service.operationInfo.IOperationInfoService;
|
||||
import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
|
||||
import com.xinelu.manage.service.textmessage.ITextMessageService;
|
||||
import com.xinelu.manage.service.wechattemplate.IWechatTemplateService;
|
||||
import com.xinelu.manage.vo.textmessage.TextMessageVO;
|
||||
import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -44,9 +58,19 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
|
||||
@Resource
|
||||
private ScriptInfoMapper scriptInfoMapper;
|
||||
@Resource
|
||||
private IScriptInfoService scriptInfoService;
|
||||
@Resource
|
||||
private WechatTemplateMapper wechatTemplateMapper;
|
||||
@Resource
|
||||
private IWechatTemplateService wechatTemplateService;
|
||||
@Resource
|
||||
private WechatTemplateSuitTaskMapper wechatTemplateSuitTaskMapper;
|
||||
@Resource
|
||||
private TextMessageMapper textMessageMapper;
|
||||
@Resource
|
||||
private ITextMessageService textMessageService;
|
||||
@Resource
|
||||
private IDepartmentDiseaseTypeService departmentDiseaseTypeService;
|
||||
|
||||
@Override
|
||||
public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) {
|
||||
@ -112,15 +136,144 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
|
||||
if (ObjectUtils.isEmpty(knowledgeBaseSaveDto.getDepartmentId())) {
|
||||
throw new ServiceException("请选择科室");
|
||||
}
|
||||
if (CollectionUtils.isEmpty(knowledgeBaseSaveDto.getSourceTemplateIds())) {
|
||||
throw new ServiceException("请选择知识库信息");
|
||||
}
|
||||
switch(knowledgeBaseSaveDto.getType()) {
|
||||
case KnowledgeBaseConstants.OPERATOR:
|
||||
OperationInfo operationInfo = operationInfoMapper.selectOperationInfoById(knowledgeBaseSaveDto.getSourceTemplateId());
|
||||
operationInfo.setId(null);
|
||||
operationInfo.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
operationInfo.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
operationInfo.setSourceTemplateId(knowledgeBaseSaveDto.getSourceTemplateId());
|
||||
operationInfoService.insertOperationInfo(operationInfo);
|
||||
saveOperator(knowledgeBaseSaveDto);
|
||||
break;
|
||||
case KnowledgeBaseConstants.SCRIPT:
|
||||
saveScript(knowledgeBaseSaveDto);
|
||||
break;
|
||||
case KnowledgeBaseConstants.WECHAT:
|
||||
saveWechat(knowledgeBaseSaveDto);
|
||||
break;
|
||||
case KnowledgeBaseConstants.MESSAGE:
|
||||
saveMessage(knowledgeBaseSaveDto);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void saveOperator(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
|
||||
knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> {
|
||||
OperationInfo operationInfo = operationInfoMapper.selectOperationInfoById(sourceId);
|
||||
operationInfo.setId(null);
|
||||
operationInfo.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
operationInfo.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
operationInfo.setSourceTemplateId(sourceId);
|
||||
operationInfoService.insertOperationInfo(operationInfo);
|
||||
});
|
||||
}
|
||||
|
||||
private void saveScript(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
|
||||
knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> {
|
||||
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(sourceId);
|
||||
scriptInfo.setId(null);
|
||||
scriptInfo.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
scriptInfo.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
scriptInfo.setSourceTemplateId(sourceId);
|
||||
// 判断病种是否存在,不存在则要先增加病种
|
||||
if (scriptInfo.getDiseaseTypeId() != null) {
|
||||
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
|
||||
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
departmentDiseaseType.setDiseaseTypeName(scriptInfo.getDiseaseTypeName());
|
||||
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
|
||||
if (CollectionUtils.isEmpty(diseaseTypeList)) {
|
||||
// 新增病种
|
||||
DepartmentDiseaseType diseaseTypeSaveObj = new DepartmentDiseaseType();
|
||||
diseaseTypeSaveObj.setDiseaseTypeName(scriptInfo.getDiseaseTypeName());
|
||||
diseaseTypeSaveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
diseaseTypeSaveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
departmentDiseaseTypeService.insertDepartmentDiseaseType(diseaseTypeSaveObj);
|
||||
} else {
|
||||
scriptInfo.setDiseaseTypeId(diseaseTypeList.get(0).getId());
|
||||
scriptInfo.setDiseaseTypeName(diseaseTypeList.get(0).getDiseaseTypeName());
|
||||
}
|
||||
}
|
||||
scriptInfoService.insertScriptInfo(scriptInfo);
|
||||
});
|
||||
}
|
||||
|
||||
private void saveWechat(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
|
||||
knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> {
|
||||
WechatTemplate wechatTemplate = wechatTemplateMapper.selectWechatTemplateById(sourceId);
|
||||
WechatTemplateTaskDTO wechatTemplateTaskDTO = new WechatTemplateTaskDTO();
|
||||
BeanUtils.copyBeanProp(wechatTemplateTaskDTO, wechatTemplate);
|
||||
wechatTemplateTaskDTO.setId(null);
|
||||
wechatTemplateTaskDTO.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
wechatTemplateTaskDTO.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
wechatTemplateTaskDTO.setSourceTemplateId(sourceId);
|
||||
// 判断病种是否存在,不存在则要先增加病种
|
||||
if (wechatTemplate.getDiseaseTypeId() != null) {
|
||||
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
|
||||
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
departmentDiseaseType.setDiseaseTypeName(wechatTemplate.getDiseaseTypeName());
|
||||
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
|
||||
if (CollectionUtils.isEmpty(diseaseTypeList)) {
|
||||
// 新增病种
|
||||
DepartmentDiseaseType diseaseTypeSaveObj = new DepartmentDiseaseType();
|
||||
diseaseTypeSaveObj.setDiseaseTypeName(wechatTemplate.getDiseaseTypeName());
|
||||
diseaseTypeSaveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
diseaseTypeSaveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
departmentDiseaseTypeService.insertDepartmentDiseaseType(diseaseTypeSaveObj);
|
||||
wechatTemplateTaskDTO.setDiseaseTypeId(diseaseTypeSaveObj.getId());
|
||||
wechatTemplateTaskDTO.setDiseaseTypeName(diseaseTypeSaveObj.getDiseaseTypeName());
|
||||
} else {
|
||||
wechatTemplateTaskDTO.setDiseaseTypeId(diseaseTypeList.get(0).getId());
|
||||
wechatTemplateTaskDTO.setDiseaseTypeName(diseaseTypeList.get(0).getDiseaseTypeName());
|
||||
}
|
||||
}
|
||||
// 根据微信库模板id查询适用任务类型
|
||||
WechatTemplateSuitTask wechatTemplateSuitTaskQuery = new WechatTemplateSuitTask();
|
||||
wechatTemplateSuitTaskQuery.setWechatTemplateId(wechatTemplate.getId());
|
||||
List<WechatTemplateSuitTask> wechatTemplateSuitTasks = wechatTemplateSuitTaskMapper.selectWechatTemplateSuitTaskList(wechatTemplateSuitTaskQuery);
|
||||
if (CollectionUtils.isNotEmpty(wechatTemplateSuitTasks)) {
|
||||
List<Long> suitTaskIds = wechatTemplateSuitTasks.stream().map(WechatTemplateSuitTask::getSuitTaskTypeId).collect(Collectors.toList());
|
||||
wechatTemplateTaskDTO.setSuitTaskTypeIds(suitTaskIds.toArray(new Long[0]));
|
||||
}
|
||||
wechatTemplateService.insertWechatTemplate(wechatTemplateTaskDTO);
|
||||
});
|
||||
}
|
||||
|
||||
private void saveMessage(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
|
||||
knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> {
|
||||
TextMessage textMessage = textMessageMapper.selectTextMessageById(sourceId);
|
||||
TextMessageTaskDTO textMessageTaskDTO = new TextMessageTaskDTO();
|
||||
BeanUtils.copyBeanProp(textMessageTaskDTO, textMessage);
|
||||
textMessageTaskDTO.setId(null);
|
||||
textMessageTaskDTO.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
textMessageTaskDTO.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
textMessageTaskDTO.setSourceTemplateId(sourceId);
|
||||
// 判断病种是否存在,不存在则要先增加病种
|
||||
if (textMessage.getDiseaseTypeId() != null) {
|
||||
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
|
||||
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
departmentDiseaseType.setDiseaseTypeName(textMessage.getDiseaseTypeName());
|
||||
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
|
||||
if (CollectionUtils.isEmpty(diseaseTypeList)) {
|
||||
// 新增病种
|
||||
DepartmentDiseaseType diseaseTypeSaveObj = new DepartmentDiseaseType();
|
||||
diseaseTypeSaveObj.setDiseaseTypeName(textMessage.getDiseaseTypeName());
|
||||
diseaseTypeSaveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
|
||||
diseaseTypeSaveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
|
||||
departmentDiseaseTypeService.insertDepartmentDiseaseType(diseaseTypeSaveObj);
|
||||
textMessageTaskDTO.setDiseaseTypeId(diseaseTypeSaveObj.getId());
|
||||
textMessageTaskDTO.setDiseaseTypeName(diseaseTypeSaveObj.getDiseaseTypeName());
|
||||
} else {
|
||||
textMessageTaskDTO.setDiseaseTypeId(diseaseTypeList.get(0).getId());
|
||||
textMessageTaskDTO.setDiseaseTypeName(diseaseTypeList.get(0).getDiseaseTypeName());
|
||||
}
|
||||
}
|
||||
// 根据短信库模板id查询适用任务类型
|
||||
TextMessageSuitTask textMessageSuitTask = new TextMessageSuitTask();
|
||||
textMessageSuitTask.setMessageId(textMessage.getId());
|
||||
List<TextMessageSuitTask> textMessageSuitTasks = textMessageMapper.selectSuitTaskList(textMessageSuitTask);
|
||||
if (CollectionUtils.isNotEmpty(textMessageSuitTasks)) {
|
||||
List<Long> suitTaskIds = textMessageSuitTasks.stream().map(TextMessageSuitTask::getSuitTaskTypeId).collect(Collectors.toList());
|
||||
textMessageTaskDTO.setSuitTaskTypeIds(suitTaskIds.toArray(new Long[0]));
|
||||
}
|
||||
textMessageService.insertTextMessage(textMessageTaskDTO);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -409,6 +409,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
}
|
||||
// 计算主路径节点执行时间
|
||||
specialDiseaseRouteAuditVo.getNodeList().forEach(node -> {
|
||||
node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName());
|
||||
node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
|
||||
});
|
||||
// 计算子路径节点执行时间
|
||||
@ -425,8 +426,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
// 查询节点
|
||||
List<SpecialDiseaseNodeAuditVo> nodeList = signPatientManageRouteNodeMapper.selectByRouteId(route.getId());
|
||||
nodeList.forEach(node-> {
|
||||
node.setExecuteTime(
|
||||
iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
|
||||
node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName());
|
||||
node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
|
||||
});
|
||||
specialDiseaseRouteAuditVo.getChildRouteList().add(
|
||||
SpecialDiseaseChildRouteAuditVo.builder().diseaseTypeName(route.getDiseaseTypeName())
|
||||
|
||||
@ -196,10 +196,18 @@ public interface ISignPatientManageRouteNodeService {
|
||||
String replaceMessageInfo(Long messageTemplateId, List<LabelFieldInfoContentVo> labelFieldContentList);
|
||||
|
||||
/**
|
||||
* 查询触发条件是否满足
|
||||
* 查询专病路径触发条件是否满足
|
||||
* @param specialDiseaseRouteId 专病管理路径主键
|
||||
* @param patientId 患者主键
|
||||
* @return 是否满足触发条件,true:满足,false:不满足
|
||||
*/
|
||||
Boolean getTriggerConditon(Long specialDiseaseRouteId, Long patientId);
|
||||
|
||||
/**
|
||||
* 查询手动船舰路径触发条件是否满足
|
||||
* @param signPatientManageRouteId 专病管理路径主键
|
||||
* @param patientId 患者主键
|
||||
* @return 是否满足触发条件,true:满足,false:不满足
|
||||
*/
|
||||
Boolean getSignTriggerConditon(Long signPatientManageRouteId, Long patientId);
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
|
||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||
import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord;
|
||||
import com.xinelu.manage.domain.signroutetriggercondition.SignRouteTriggerCondition;
|
||||
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.domain.specialdiseasetriggercondition.SpecialDiseaseTriggerCondition;
|
||||
@ -42,6 +43,7 @@ import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
||||
import com.xinelu.manage.mapper.signroutetriggercondition.SignRouteTriggerConditionMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper;
|
||||
@ -127,6 +129,8 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
private PatientAllInfoViewMapper patientAllInfoViewMapper;
|
||||
@Resource
|
||||
private SpecialDiseaseRouteMapper specialDiseaseRouteMapper;
|
||||
@Resource
|
||||
private SignRouteTriggerConditionMapper signRouteTriggerConditionMapper;
|
||||
|
||||
/**
|
||||
* 查询签约患者管理任务路径节点
|
||||
@ -867,6 +871,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
* @param patientId 患者主键
|
||||
* @return 是否满足触发条件,true:满足,false:不满足
|
||||
*/
|
||||
@Override
|
||||
public Boolean getTriggerConditon(Long specialDiseaseRouteId, Long patientId) {
|
||||
boolean generateTask = false;
|
||||
// 查询患者信息
|
||||
@ -914,6 +919,62 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
return generateTask;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询手动船舰路径触发条件是否满足
|
||||
* @param signPatientManageRouteId 专病管理路径主键
|
||||
* @param patientId 患者主键
|
||||
* @return 是否满足触发条件,true:满足,false:不满足
|
||||
*/
|
||||
@Override public Boolean getSignTriggerConditon(Long signPatientManageRouteId, Long patientId) {
|
||||
// 查询患者信息
|
||||
PatientAllInfoViewUppercase patientAllInfo = null;
|
||||
List<PatientAllInfoViewUppercase> patientAllInfoViewList = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId);
|
||||
if (CollectionUtils.isNotEmpty(patientAllInfoViewList)) {
|
||||
patientAllInfo = patientAllInfoViewList.get(0);
|
||||
}
|
||||
// 查询画像信息
|
||||
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(patientId);
|
||||
|
||||
boolean generateTask = false;
|
||||
SignRouteTriggerCondition signRouteTriggerCondition = new SignRouteTriggerCondition();
|
||||
signRouteTriggerCondition.setPatientManageRouteId(signPatientManageRouteId);
|
||||
List<SignRouteTriggerCondition> signRouteTriggerConditions = signRouteTriggerConditionMapper.selectSignRouteTriggerConditionList(signRouteTriggerCondition);
|
||||
if (CollectionUtils.isNotEmpty(signRouteTriggerConditions)) {
|
||||
// 判断条件是否成立
|
||||
SpecialDiseaseTriggerCondition triggerCondition = new SpecialDiseaseTriggerCondition();
|
||||
BeanUtils.copyBeanProp(triggerCondition, signRouteTriggerConditions.get(0));
|
||||
boolean condition1 = judgeTriggerCondition(triggerCondition, patientAllInfo, labelFieldContentList);
|
||||
if (condition1) {
|
||||
// 条件1成立,继续判断条件2,3
|
||||
if (signRouteTriggerConditions.size() > 1) {
|
||||
BeanUtils.copyBeanProp(triggerCondition, signRouteTriggerConditions.get(1));
|
||||
boolean condition2 = judgeTriggerCondition(triggerCondition, patientAllInfo, labelFieldContentList);
|
||||
if (signRouteTriggerConditions.size() > 2) { // 有3个条件
|
||||
BeanUtils.copyBeanProp(triggerCondition, signRouteTriggerConditions.get(2));
|
||||
boolean condition3 = judgeTriggerCondition(triggerCondition, patientAllInfo, labelFieldContentList);
|
||||
switch (signRouteTriggerConditions.get(2).getTriggerLogic()) {
|
||||
case TriggerLogicConstants.AND:
|
||||
generateTask = condition2 && condition3;
|
||||
break;
|
||||
case TriggerLogicConstants.OR:
|
||||
generateTask = condition2 || condition3;
|
||||
break;
|
||||
default:
|
||||
generateTask = condition2 && condition3;
|
||||
break;
|
||||
}
|
||||
} else { // 有两个条件
|
||||
generateTask = condition2;
|
||||
}
|
||||
} else {
|
||||
// 只有1个条件且成立,生成任务
|
||||
generateTask = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return generateTask;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据管理路径生成任务
|
||||
* @param signPatientManageRoute 签约管理路径
|
||||
|
||||
@ -19,6 +19,12 @@ public class SpecialDiseaseNodeAuditVo {
|
||||
@ApiModelProperty(value = "节点名称,出院后:AFTER_DISCHARGE,入院后:AFTER_ADMISSION,就诊后:AFTER_CONSULTATION,就诊/出院后:AFTER_VISIT_DISCHARGE,术前:PREOPERATIVE,术后:POSTOPERATIVE")
|
||||
private String routeNodeName;
|
||||
|
||||
/**
|
||||
* 节点名称中文
|
||||
*/
|
||||
@ApiModelProperty("节点名称中文")
|
||||
private String routeNodeNameCN;
|
||||
|
||||
/**
|
||||
* 节点天数,单位:天
|
||||
*/
|
||||
|
||||
@ -107,6 +107,11 @@ public class TextMessageVO extends BaseEntity {
|
||||
@Excel(name = "短信备注")
|
||||
private String textMessageRemark;
|
||||
|
||||
/**
|
||||
* 公共知识库id
|
||||
*/
|
||||
private Long sourceTemplateId;
|
||||
|
||||
/**
|
||||
* 短信模板适用任务类型列表
|
||||
*/
|
||||
|
||||
@ -255,6 +255,27 @@
|
||||
(select id, department_id, propaganda_status from propaganda_info
|
||||
<where>
|
||||
del_flag = 0
|
||||
<if test="propagandaStatus != null and propagandaStatus != ''">
|
||||
and propaganda_status = #{propagandaStatus}
|
||||
</if>
|
||||
<if test="hospitalAgencyId != null ">
|
||||
and hospital_agency_id = #{hospitalAgencyId}
|
||||
</if>
|
||||
<if test="departmentId != null ">
|
||||
and department_id = #{departmentId}
|
||||
</if>
|
||||
<if test="propagandaType != null and propagandaType != ''">
|
||||
and propaganda_type = #{propagandaType}
|
||||
</if>
|
||||
<if test="propagandaStatus != null and propagandaStatus != ''">
|
||||
and propaganda_status = #{propagandaStatus}
|
||||
</if>
|
||||
<if test="createTimeStart != null">
|
||||
and date_format(create_time, '%y%m%d') >= date_format(#{createTimeStart}, '%y%m%d')
|
||||
</if>
|
||||
<if test="createTimeEnd != null">
|
||||
and date_format(create_time, '%y%m%d') <= date_format(#{createTimeEnd}, '%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
) as p on d.id = p.department_id
|
||||
<where>
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
<result property="scriptRemark" column="script_remark"/>
|
||||
<result property="scriptFilePath" column="script_file_path"/>
|
||||
<result property="flowScheme" column="flow_scheme"/>
|
||||
<result property="sourceTemplateId" column="source_template_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@ -48,6 +49,7 @@
|
||||
script_remark,
|
||||
script_file_path,
|
||||
flow_scheme,
|
||||
source_template_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
@ -70,7 +72,7 @@
|
||||
si.script_sort,
|
||||
si.script_remark,
|
||||
si.script_file_path,
|
||||
si.flow_scheme,
|
||||
si.flow_scheme,si.source_template_id,
|
||||
si.create_by,
|
||||
si.create_time,
|
||||
si.update_by,
|
||||
@ -182,6 +184,8 @@
|
||||
</if>
|
||||
<if test="flowScheme != null">flow_scheme,
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">source_template_id,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
@ -220,6 +224,8 @@
|
||||
</if>
|
||||
<if test="flowScheme != null">#{flowScheme},
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">#{sourceTemplateId},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
@ -272,6 +278,9 @@
|
||||
<if test="flowScheme != null">flow_scheme =
|
||||
#{flowScheme},
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">source_template_id =
|
||||
#{sourceTemplateId},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
<result property="triggerConditionOperator" column="trigger_condition_operator"/>
|
||||
<result property="triggerConditionValue" column="trigger_condition_value"/>
|
||||
<result property="triggerConditionSort" column="trigger_condition_sort"/>
|
||||
<result property="triggerLogic" column="trigger_logic"/>
|
||||
<result property="triggerConditionRemark" column="trigger_condition_remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
@ -21,36 +22,36 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSignRouteTriggerConditionVo">
|
||||
select id, patient_manage_route_id, route_name, trigger_condition_code, trigger_condition_name, trigger_condition_operator, trigger_condition_value, trigger_condition_sort, trigger_condition_remark, create_by, create_time, update_by, update_time from sign_route_trigger_condition
|
||||
select id, patient_manage_route_id, route_name, trigger_condition_code, trigger_condition_name, trigger_condition_operator, trigger_condition_value, trigger_condition_sort, trigger_logic, trigger_condition_remark, create_by, create_time, update_by, update_time from sign_route_trigger_condition
|
||||
</sql>
|
||||
|
||||
<select id="selectSignRouteTriggerConditionList" parameterType="SignRouteTriggerCondition" resultMap="SignRouteTriggerConditionResult">
|
||||
<include refid="selectSignRouteTriggerConditionVo"/>
|
||||
<where>
|
||||
<if test="patientManageRouteId != null ">
|
||||
and patient_manage_route_id = #{patientManageRouteId}
|
||||
</if>
|
||||
<if test="routeName != null and routeName != ''">
|
||||
and route_name like concat('%', #{routeName}, '%')
|
||||
</if>
|
||||
<if test="triggerConditionCode != null and triggerConditionCode != ''">
|
||||
and trigger_condition_code = #{triggerConditionCode}
|
||||
</if>
|
||||
<if test="triggerConditionName != null and triggerConditionName != ''">
|
||||
and trigger_condition_name like concat('%', #{triggerConditionName}, '%')
|
||||
</if>
|
||||
<if test="triggerConditionOperator != null and triggerConditionOperator != ''">
|
||||
and trigger_condition_operator = #{triggerConditionOperator}
|
||||
</if>
|
||||
<if test="triggerConditionValue != null and triggerConditionValue != ''">
|
||||
and trigger_condition_value = #{triggerConditionValue}
|
||||
</if>
|
||||
<if test="triggerConditionSort != null ">
|
||||
and trigger_condition_sort = #{triggerConditionSort}
|
||||
</if>
|
||||
<if test="triggerConditionRemark != null and triggerConditionRemark != ''">
|
||||
and trigger_condition_remark = #{triggerConditionRemark}
|
||||
</if>
|
||||
<if test="patientManageRouteId != null ">
|
||||
and patient_manage_route_id = #{patientManageRouteId}
|
||||
</if>
|
||||
<if test="routeName != null and routeName != ''">
|
||||
and route_name like concat('%', #{routeName}, '%')
|
||||
</if>
|
||||
<if test="triggerConditionCode != null and triggerConditionCode != ''">
|
||||
and trigger_condition_code = #{triggerConditionCode}
|
||||
</if>
|
||||
<if test="triggerConditionName != null and triggerConditionName != ''">
|
||||
and trigger_condition_name like concat('%', #{triggerConditionName}, '%')
|
||||
</if>
|
||||
<if test="triggerConditionOperator != null and triggerConditionOperator != ''">
|
||||
and trigger_condition_operator = #{triggerConditionOperator}
|
||||
</if>
|
||||
<if test="triggerConditionValue != null and triggerConditionValue != ''">
|
||||
and trigger_condition_value = #{triggerConditionValue}
|
||||
</if>
|
||||
<if test="triggerConditionSort != null ">
|
||||
and trigger_condition_sort = #{triggerConditionSort}
|
||||
</if>
|
||||
<if test="triggerConditionRemark != null and triggerConditionRemark != ''">
|
||||
and trigger_condition_remark = #{triggerConditionRemark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -78,6 +79,8 @@
|
||||
</if>
|
||||
<if test="triggerConditionSort != null">trigger_condition_sort,
|
||||
</if>
|
||||
<if test="triggerLogic != null">trigger_logic,
|
||||
</if>
|
||||
<if test="triggerConditionRemark != null">trigger_condition_remark,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
@ -104,6 +107,8 @@
|
||||
</if>
|
||||
<if test="triggerConditionSort != null">#{triggerConditionSort},
|
||||
</if>
|
||||
<if test="triggerLogic != null">#{triggerLogic},
|
||||
</if>
|
||||
<if test="triggerConditionRemark != null">#{triggerConditionRemark},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
@ -144,6 +149,9 @@
|
||||
<if test="triggerConditionRemark != null">trigger_condition_remark =
|
||||
#{triggerConditionRemark},
|
||||
</if>
|
||||
<if test="triggerLogic != null">trigger_logic =
|
||||
#{triggerLogic},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
@ -173,14 +181,14 @@
|
||||
<insert id="insertBatch">
|
||||
insert into sign_route_trigger_condition(id,patient_manage_route_id,route_name,
|
||||
trigger_condition_code,trigger_condition_name,trigger_condition_operator,
|
||||
trigger_condition_value,trigger_condition_sort,trigger_condition_remark,
|
||||
trigger_condition_value,trigger_condition_sort,trigger_logic, trigger_condition_remark,
|
||||
create_by,create_time,
|
||||
update_by,update_time)
|
||||
values
|
||||
<foreach collection="signRouteTriggerConditionCollection" item="item" separator=",">
|
||||
(#{item.id,jdbcType=NUMERIC},#{item.patientManageRouteId,jdbcType=NUMERIC},#{item.routeName,jdbcType=VARCHAR},
|
||||
#{item.triggerConditionCode,jdbcType=VARCHAR},#{item.triggerConditionName,jdbcType=VARCHAR},#{item.triggerConditionOperator,jdbcType=VARCHAR},
|
||||
#{item.triggerConditionValue,jdbcType=VARCHAR},#{item.triggerConditionSort,jdbcType=NUMERIC},#{item.triggerConditionRemark,jdbcType=VARCHAR},
|
||||
#{item.triggerConditionValue,jdbcType=VARCHAR},#{item.triggerConditionSort,jdbcType=NUMERIC},#{item.triggerLogic,jdbcType=VARCHAR},#{item.triggerConditionRemark,jdbcType=VARCHAR},
|
||||
#{item.createBy,jdbcType=VARCHAR},#{item.createTime},
|
||||
#{item.updateBy,jdbcType=VARCHAR},#{item.updateTime})
|
||||
</foreach>
|
||||
|
||||
@ -452,6 +452,7 @@
|
||||
dt.department_code,
|
||||
( SELECT COUNT(1) FROM special_disease_route a WHERE a.department_id = dt.id and (a.parent_route_id = 0 or a.parent_route_id is null)) AS countNum
|
||||
from department dt left join special_disease_route sdr on dt.id = sdr.department_id
|
||||
left join special_disease_route_package sdrp ON sdr.id = sdrp.route_id
|
||||
<where>
|
||||
<if test="hospitalAgencyId != null ">
|
||||
and dt.hospital_agency_id = #{hospitalAgencyId}
|
||||
@ -462,6 +463,9 @@
|
||||
<if test="releaseStatus != null and releaseStatus != ''">
|
||||
AND sdr.release_status= #{releaseStatus}
|
||||
</if>
|
||||
<if test="servicePackageId != null and servicePackageId != ''">
|
||||
AND sdrp.service_package_id= #{servicePackageId}
|
||||
</if>
|
||||
<if test="parentRouteId == null">
|
||||
AND (sdr.parent_route_id = 0 or sdr.parent_route_id is null)
|
||||
</if>
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
<result property="textMessageStatus" column="text_message_status"/>
|
||||
<result property="textMessageSort" column="text_message_sort"/>
|
||||
<result property="textMessageRemark" column="text_message_remark"/>
|
||||
<result property="sourceTemplateId" column="source_template_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@ -36,6 +37,7 @@
|
||||
<result column="text_message_status" property="textMessageStatus"/>
|
||||
<result column="text_message_sort" property="textMessageSort"/>
|
||||
<result column="text_message_remark" property="textMessageRemark"/>
|
||||
<result property="sourceTemplateId" column="source_template_id"/>
|
||||
<collection property="suitTaskList" ofType="com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask">
|
||||
<id column="taskId" property="id"/>
|
||||
<result column="message_id" property="messageId"/>
|
||||
@ -57,6 +59,7 @@
|
||||
text_message_status,
|
||||
text_message_sort,
|
||||
text_message_remark,
|
||||
source_template_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
@ -108,6 +111,7 @@
|
||||
tm.text_message_status,
|
||||
tm.text_message_sort,
|
||||
tm.text_message_remark,
|
||||
tm.source_template_id,
|
||||
tmst.id AS taskId,
|
||||
tmst.message_id,
|
||||
tmst.suit_task_type_id,
|
||||
@ -188,6 +192,8 @@
|
||||
</if>
|
||||
<if test="textMessageRemark != null">text_message_remark,
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">source_template_id,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
@ -220,6 +226,8 @@
|
||||
</if>
|
||||
<if test="textMessageRemark != null">#{textMessageRemark},
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">#{sourceTemplateId},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
@ -241,6 +249,15 @@
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectSuitTaskList" resultType="com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask">
|
||||
select *
|
||||
from text_message_suit_task
|
||||
<where>
|
||||
<if test="messageId != null">
|
||||
and message_id = #{messageId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateTextMessage" parameterType="TextMessage">
|
||||
update text_message
|
||||
@ -274,6 +291,9 @@
|
||||
<if test="textMessageRemark != null">text_message_remark =
|
||||
#{textMessageRemark},
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">source_template_id =
|
||||
#{sourceTemplateId},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
<result property="templateSource" column="template_source"/>
|
||||
<result property="templateSort" column="template_sort"/>
|
||||
<result property="templateRemark" column="template_remark"/>
|
||||
<result property="sourceTemplateId" column="source_template_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@ -53,6 +54,7 @@
|
||||
template_source,
|
||||
template_sort,
|
||||
template_remark,
|
||||
source_template_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
@ -221,6 +223,8 @@
|
||||
</if>
|
||||
<if test="templateRemark != null">template_remark,
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">source_template_id,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
@ -251,6 +255,8 @@
|
||||
</if>
|
||||
<if test="templateRemark != null">#{templateRemark},
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">#{sourceTemplateId},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
@ -264,7 +270,7 @@
|
||||
|
||||
<insert id="insertWechatTemplateSuitTask" parameterType="java.util.List">
|
||||
INSERT INTO wechat_template_suit_task
|
||||
(wechat_template_id, suit_task_type_id, suit_task_type_name, create_by, create_time)
|
||||
(wechat_template_id, suit_task_type_id, suit_task_type_name,create_by, create_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="task" index="index" separator=",">
|
||||
(#{task.wechatTemplateId}, #{task.suitTaskTypeId}, #{task.suitTaskTypeName}, #{task.createBy},
|
||||
@ -301,6 +307,9 @@
|
||||
<if test="templateRemark != null">template_remark =
|
||||
#{templateRemark},
|
||||
</if>
|
||||
<if test="sourceTemplateId != null">source_template_id =
|
||||
#{sourceTemplateId},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
|
||||
@ -0,0 +1,115 @@
|
||||
<?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.xinelu.manage.mapper.wechattemplatesuittask.WechatTemplateSuitTaskMapper">
|
||||
|
||||
<resultMap type="WechatTemplateSuitTask" id="WechatTemplateSuitTaskResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="wechatTemplateId" column="wechat_template_id"/>
|
||||
<result property="suitTaskTypeId" column="suit_task_type_id"/>
|
||||
<result property="suitTaskTypeName" column="suit_task_type_name"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWechatTemplateSuitTaskVo">
|
||||
select id, wechat_template_id, suit_task_type_id, suit_task_type_name, create_by, create_time, update_by, update_time from wechat_template_suit_task
|
||||
</sql>
|
||||
|
||||
<select id="selectWechatTemplateSuitTaskList" parameterType="WechatTemplateSuitTask" resultMap="WechatTemplateSuitTaskResult">
|
||||
<include refid="selectWechatTemplateSuitTaskVo"/>
|
||||
<where>
|
||||
<if test="wechatTemplateId != null ">
|
||||
and wechat_template_id = #{wechatTemplateId}
|
||||
</if>
|
||||
<if test="suitTaskTypeName != null and suitTaskTypeName != ''">
|
||||
and suit_task_type_name like concat('%', #{suitTaskTypeName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWechatTemplateSuitTaskById" parameterType="Long"
|
||||
resultMap="WechatTemplateSuitTaskResult">
|
||||
<include refid="selectWechatTemplateSuitTaskVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWechatTemplateSuitTask" parameterType="WechatTemplateSuitTask" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into wechat_template_suit_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="wechatTemplateId != null">wechat_template_id,
|
||||
</if>
|
||||
<if test="suitTaskTypeId != null">suit_task_type_id,
|
||||
</if>
|
||||
<if test="suitTaskTypeName != null">suit_task_type_name,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="wechatTemplateId != null">#{wechatTemplateId},
|
||||
</if>
|
||||
<if test="suitTaskTypeId != null">#{suitTaskTypeId},
|
||||
</if>
|
||||
<if test="suitTaskTypeName != null">#{suitTaskTypeName},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWechatTemplateSuitTask" parameterType="WechatTemplateSuitTask">
|
||||
update wechat_template_suit_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="wechatTemplateId != null">wechat_template_id =
|
||||
#{wechatTemplateId},
|
||||
</if>
|
||||
<if test="suitTaskTypeId != null">suit_task_type_id =
|
||||
#{suitTaskTypeId},
|
||||
</if>
|
||||
<if test="suitTaskTypeName != null">suit_task_type_name =
|
||||
#{suitTaskTypeName},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWechatTemplateSuitTaskById" parameterType="Long">
|
||||
delete from wechat_template_suit_task where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWechatTemplateSuitTaskByIds" parameterType="String">
|
||||
delete from wechat_template_suit_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user