liusheng
2024-07-23 0123a0bd06f83a2a973023bb2f197e21118ef293
代码提交
已添加2个文件
已修改24个文件
750 ■■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchiveVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskQueryReq.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskAnswer.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskOptionAnswer.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskAnswerMapper.xml 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
@@ -161,7 +161,7 @@
                List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOList = redisCache.getCacheObject(userId + "ivrTaskTemplateScriptVOList");
                //根据前端传回的条件,获取当前题目
                IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = questionMessage.getNowQuestion();
                if (ivrTaskTemplateScriptVO.getID() == null) {
                if (ivrTaskTemplateScriptVO.getId() == null) {
                    QuestionMessage returnQues = redisCache.getCacheObject(userId + "returnQues");
                    ivrTaskTemplateScriptVO = returnQues.getNowQuestion();
                }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java
@@ -8,6 +8,7 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.ServiceSubTaskAnswerReq;
import com.smartor.domain.ServiceSubTaskCacheReq;
import com.smartor.domain.ServiceSubTaskQueryReq;
import com.smartor.domain.ServiceSubtaskAnswer;
import com.smartor.service.IServiceSubtaskAnswerService;
import io.swagger.annotations.Api;
@@ -113,4 +114,11 @@
    public AjaxResult saveQuestionCache(@RequestBody ServiceSubTaskCacheReq serviceSubTaskCacheReq) {
        return toAjax(serviceSubtaskAnswerService.saveQuestionCache(serviceSubTaskCacheReq));
    }
    @ApiOperation("医生查询患者问题结果(外链)")
    @PostMapping("/selectPatQuestionResult")
    public AjaxResult selectPatQuestionResult(@RequestBody ServiceSubTaskQueryReq serviceSubTaskQueryReq) {
        return AjaxResult.success(serviceSubtaskAnswerService.selectPatQuestionResult(serviceSubTaskQueryReq));
    }
}
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -36,6 +36,13 @@
    /**
     * é€‚用题型(1.单选 2多选 3填空 4其它)
     */
    @Excel(name = "适用题型(1.单选 2多选 3填空 4其它)")
    @ApiModelProperty(value = "适用题型(1.单选 2多选 3填空 4其它)")
    private String scriptType;
    /**
     * æ¨¡æ¿ID
     */
    @Excel(name = "模板ID")
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -27,7 +27,7 @@
     * ä¸»é”®ID
     */
    @ApiModelProperty(value = "主键")
    private Long ID;
    private Long id;
    /**
     * ä»»åŠ¡id
@@ -43,6 +43,14 @@
    @ApiModelProperty(value = "模板话术编号")
    private Long scriptno;
    /**
     * é€‚用题型(1.单选 2多选 3填空 4其它)
     */
    @Excel(name = "适用题型(1.单选 2多选 3填空 4其它)")
    @ApiModelProperty(value = "适用题型(1.单选 2多选 3问答 4填空  5其它)")
    private String scriptType;
    /**
     * æ¨¡æ¿ID
     */
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
@@ -81,6 +81,13 @@
    private String targetvalue;
    /**
     * æ¨¡æ¿æŒ‡æ ‡å€¼
     */
    @Excel(name = "模板指标值")
    @ApiModelProperty(value = "模板指标值")
    private String appenddesc;
    /**
     * æ¨¡æ¿æŒ‡æ ‡æ­£åˆ™2
     */
    @Excel(name = "模板指标正则2")
@@ -235,5 +242,10 @@
    @ApiModelProperty(value = "是否是用户选择的选项")
    private Boolean isUserOperation = false;
    /**
     * é€‰é¡¹ç»­å·
     */
    @Excel(name = "选项续号")
    @ApiModelProperty(value = "选项续号")
    private String optionCode;
}
smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
@@ -28,7 +28,7 @@
     * è‡ªå¢žID
     */
    @ApiModelProperty(value = "自增ID")
    private Long patid;
    private Long id;
    /**
     * å§“名
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java
@@ -23,9 +23,9 @@
    private String param2;
    @ApiModelProperty(value = "问题回答明细(随访)")
    private List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList;
    private List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOList;
    @ApiModelProperty(value = "问题回答明细(问卷)")
    List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOList;
    List<SvyTaskTemplateScriptVO> svyTaskTemplateScriptVOList;
}
smartor/src/main/java/com/smartor/domain/ServiceSubTaskQueryReq.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.annotation.Nonnull;
/**
 * åŒ»ç”ŸæŸ¥è¯¢æ‚£è€…回答信息
 *
 * @author ls
 * @date 2023-06-05
 */
@ApiModel(value = "ServiceSubTaskQueryReq", description = "医生查询患者回答信息")
@Data
public class ServiceSubTaskQueryReq {
    @ApiModelProperty(value = "任务类型:1,出院随访;2,体检通知;3,满意度调查;4,宣教; ")
    private Long type;
    /**
     * ä»»åŠ¡ID
     */
    @Nonnull
    @ApiModelProperty(value = "任务ID")
    private Long taskid;
    /**
     * æ‚£è€…ID
     */
    @ApiModelProperty(value = "患者ID")
    private Long patId;
    /**
     * é¢˜ç›®ID
     */
    @ApiModelProperty(value = "题目ID")
    private Long scriptid;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtaskAnswer.java
@@ -35,9 +35,9 @@
    private Long taskid;
    /**
     * å­ä»»åŠ¡ID
     * æ‚£è€…ID
     */
    @ApiModelProperty(value = "子任务ID")
    @ApiModelProperty(value = "患者ID")
    private Long patId;
    /**
@@ -74,13 +74,19 @@
     * éœ€è¦è·Ÿè¿›ï¼ˆæ˜¯ï¼š1、否:0)
     */
    @ApiModelProperty(value = "需要跟进")
    private String istrack;
    private String trackFlag;
    /**
     * å¼‚常预警(是:1、否:0)
     */
    @ApiModelProperty(value = "异常预警")
    private String isabnormal;
    private String warningFlag;
    /**
     * é€‰é¡¹ç­”案的附加信息
     */
    @ApiModelProperty(value = "选项答案的附加信息")
    private String answerps;
    /**
     * åˆ é™¤æ ‡å¿—(0:未删除 1:已删除)
smartor/src/main/java/com/smartor/domain/ServiceSubtaskOptionAnswer.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹å¯¹è±¡ service_subtask_answer
 *
 * @author ruoyi
 * @date 2024-07-18
 */
@ApiModel(value = "ServiceSubtaskOptionAnswer", description = "外链选项结果")
@Data
public class ServiceSubtaskOptionAnswer extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * ä»»åŠ¡æ¨¡æ¿é€‰é¡¹ID
     */
    @ApiModelProperty(value = "任务模板选项ID")
    private Long id;
    /**
     * ä»»åŠ¡ID
     */
    @ApiModelProperty(value = "选项code")
    private String code;
    /**
     * æ‚£è€…ID
     */
    @ApiModelProperty(value = "选项值")
    private String value;
    /**
     * é¢˜ç›®ID
     */
    @ApiModelProperty(value = "描述")
    private String appenddesc;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java
@@ -61,7 +61,7 @@
     */
    @Excel(name = "选项编号")
    @ApiModelProperty(value = "选项编号")
    private Long optionNo;
    private String optionCode;
    /**
     * è¯æœ¯ID
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
@@ -143,7 +143,7 @@
     * åŸºç¡€æŒ‡æ ‡ç±»åž‹ï¼ˆ1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰
     */
    @ApiModelProperty(value = "基础指标类型1=选项,2=文本,3=数值")
    private String targettype;
    private String scriptType;
    /**
     * åŸºç¡€æŒ‡æ ‡ID(暂时当序号id)
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -25,7 +25,7 @@
    /**
     * ä¸»é”®ID
     */
    private Long ID;
    private Long id;
    /**
     * é¢˜ç›®ä¸»é¢˜
@@ -143,7 +143,7 @@
     * åŸºç¡€æŒ‡æ ‡ç±»åž‹ï¼ˆ1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰
     */
    @ApiModelProperty(value = "基础指标类型 1=选项,2=文本,3=数值")
    private String targettype;
    private String scriptType;
    /**
     * åŸºç¡€æŒ‡æ ‡ID(暂时当序号id)
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java
@@ -200,10 +200,35 @@
    @ApiModelProperty(value = "选项图片路径")
    private String picturePath;
    /**
     * é€‰é¡¹é™„加标识:0-无附加,1-有附件;
     */
    @ApiModelProperty(value = "选项图片路径")
    private String appendflag;
    /**
     * é™„件信息
     */
    @ApiModelProperty(value = "附件信息(问答题的结果也是放在这个里面)")
    private String appenddesc;
    /**
     * æ˜¯å¦å­˜åœ¨æ“ä½œï¼š1 æ–°å¢ž 2修改 3删除
     */
    @ApiModelProperty(value = "是否存在操作:1 æ–°å¢ž 2修改 3删除")
    private Integer isoperation;
    /**
     * é€‰é¡¹ç»­å·
     */
    @ApiModelProperty(value = "选项续号")
    private String optionCode;
    /**
     * æ˜¯å¦æ˜¯ç”¨æˆ·é€‰æ‹©çš„选项
     */
    @ApiModelProperty(value = "是否是用户选择的选项")
    private Boolean isUserOperation = false;
}
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java
@@ -1,9 +1,8 @@
package com.smartor.service;
import com.smartor.domain.ServiceSubTaskAnswerReq;
import com.smartor.domain.ServiceSubTaskCacheReq;
import com.smartor.domain.ServiceSubTaskDetailReq;
import com.smartor.domain.ServiceSubtaskAnswer;
import com.ruoyi.common.core.domain.AjaxResult;
import com.smartor.domain.*;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@@ -78,4 +77,6 @@
     */
    public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq);
    public List<ServiceSubtaskAnswer> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq);
}
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -174,9 +174,9 @@
        //通过话术ID获取选项
        for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateScriptVOS) {
            log.info("ivrLibaTemplateScriptVO的主键id为:{}", ivrTaskTemplateScriptVO.getID());
            log.info("ivrLibaTemplateScriptVO的主键id为:{}", ivrTaskTemplateScriptVO.getId());
            IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption = new IvrTaskTemplateTargetoption();
            ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScriptVO.getID());
            ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScriptVO.getId());
            List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = ivrTaskTemplateTargetoptionMapper.selectIvrTaskTemplateTargetoptionList(ivrTaskTemplateTargetoption);
            for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption1 : ivrTaskTemplateTargetoptions) {
                ObjectMapper mapper = new ObjectMapper();
@@ -224,11 +224,11 @@
        } else if (isoperation == 3) {
            //删除
            if (ivrTaskTemplateScriptVO.getID() == null) {
            if (ivrTaskTemplateScriptVO.getId() == null) {
                log.info("删除失败,模板话术id为空");
            } else {
                ivrTaskTemplateScriptVO.setUpdateTime(new Date());
                ivrTaskTemplateScriptMapper.deleteIvrTaskTemplateScriptByID(ivrTaskTemplateScriptVO.getID());
                ivrTaskTemplateScriptMapper.deleteIvrTaskTemplateScriptByID(ivrTaskTemplateScriptVO.getId());
            }
        }
        return ivrTaskTemplateScript;
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -118,13 +118,13 @@
    public Boolean saveOrUpdatePatInfo(PatArchiveVO patArchiveVO) {
        //通过isoperation来判断是否新增
        PatArchive patArchive = DtoConversionUtils.sourceToTarget(patArchiveVO, PatArchive.class);
        if (patArchiveVO.getIsoperation() != null && patArchiveVO.getIsoperation() == 1 || patArchiveVO.getPatid() == null) {
        if (patArchiveVO.getIsoperation() != null && patArchiveVO.getIsoperation() == 1 || patArchiveVO.getId() == null) {
            //新增
            List<PatArchive> patArchives = new ArrayList<>();
            patArchive.setUpdateTime(DateUtils.getNowDate());
            patArchives.add(patArchive);
            patArchiveMapper.insertPatArchive(patArchives);
        } else if (patArchiveVO.getIsoperation() != null && patArchiveVO.getIsoperation() == 2 || patArchiveVO.getPatid() != null) {
        } else if (patArchiveVO.getIsoperation() != null && patArchiveVO.getIsoperation() == 2 || patArchiveVO.getId() != null) {
            //修改
            patArchiveVO.setIsoperation(2);
            patArchiveMapper.updatePatArchive(patArchive);
@@ -475,7 +475,6 @@
                patArchiveList.addAll(patArchives3);
            }
        }
        //根据患者ID进行分组
        Map<Long, List<PatArchive>> listMap = patArchiveList.stream().collect(Collectors.groupingBy(PatArchive::getId));
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -1,13 +1,20 @@
package com.smartor.service.impl;
import com.alibaba.fastjson2.JSON;
import com.google.gson.JsonArray;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.IvrTaskTemplateScriptMapper;
import com.smartor.mapper.ServiceSubtaskAnswerMapper;
import com.smartor.mapper.ServiceSubtaskMapper;
import com.smartor.mapper.ServiceTaskMapper;
import com.smartor.service.IIvrTaskTemplateService;
import com.smartor.service.IServiceSubtaskAnswerService;
import com.smartor.service.ISvyTaskTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -15,10 +22,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
/**
 * ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹Service业务层处理
@@ -31,9 +35,6 @@
public class ServiceSubtaskAnswerServiceImpl implements IServiceSubtaskAnswerService {
    @Autowired
    private ServiceSubtaskAnswerMapper serviceSubtaskAnswerMapper;
    @Autowired
    private ServiceSubtaskMapper serviceSubtaskMapper;
    @Autowired
    private RedisCache redisCache;
@@ -120,10 +121,8 @@
            allKeys = new HashSet<>();
            if (serviceSubTaskAnswerReq.getType() == 1) {
//                allKeys.add(redisCache.getCacheObject(pid + "-" + tid + "-SFscriptCache"));
                allKeys.add(pid + "-" + tid + "-SFscriptCache");
            } else if (serviceSubTaskAnswerReq.getType() == 2) {
//                allKeys.add(redisCache.getCacheObject(pid + "-" + tid + "-WJscriptCache"));
                allKeys.add(pid + "-" + tid + "-WJscriptCache");
            }
        }
@@ -133,17 +132,17 @@
            String[] split = key.split("-");
            if (key.contains("-SFscriptCache")) {
                //包含了,说明了是随访问题
                List<IvrLibaTemplateScriptVO> cacheList = redisCache.getCacheObject(key);
                List<IvrTaskTemplateScriptVO> cacheList = redisCache.getCacheObject(key);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        // è¯´æ˜Žæ˜¯ç¬¬ä¸€é¢˜
                        IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO = cacheList.get(0);
                        IvrTaskTemplateScriptVO ivrLibaTemplateScriptVO = cacheList.get(0);
                        //将第一题的信息放到表中
                        setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                        nextScriptno = cacheList.get(0).getNextScriptno();
                    } else {
                        //不是第 ä¸€ é¢˜
                        for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : cacheList) {
                        for (IvrTaskTemplateScriptVO ivrLibaTemplateScriptVO : cacheList) {
                            if (ivrLibaTemplateScriptVO.getId() == nextScriptno) {
                                setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                                nextScriptno = ivrLibaTemplateScriptVO.getNextScriptno();
@@ -152,7 +151,7 @@
                    }
                }
            } else if (key.contains("-WJscriptCache")) {
                List<SvyLibTemplateScriptVO> cacheList = redisCache.getCacheList(key);
                List<SvyTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        // è¯´æ˜Žæ˜¯ç¬¬ä¸€é¢˜
@@ -160,10 +159,10 @@
                        setWJInfo(cacheList.get(0), Long.valueOf(split[1]), Long.valueOf(split[0]));
                        nextScriptno = Long.valueOf(cacheList.get(0).getNextScriptno());
                    } else {
                        for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : cacheList) {
                            if (svyLibTemplateScriptVO.getId() == nextScriptno) {
                        for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) {
                            if (svyTaskTemplateScriptVO.getId() == nextScriptno) {
                                //将第一题的信息放到表中
                                setWJInfo(svyLibTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                                setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                                nextScriptno = Long.valueOf(cacheList.get(0).getNextScriptno());
                            }
@@ -188,63 +187,113 @@
        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam1(), pri_key));
        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam2(), pri_key));
        if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList())) {
        if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList())) {
            //随访
            redisCache.setCacheObject(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList());
        } else if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getSvyLibTemplateScriptVOList())) {
            redisCache.setCacheObject(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList());
        } else if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOList())) {
            //问卷
            redisCache.setCacheObject(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyLibTemplateScriptVOList());
            redisCache.setCacheObject(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOList());
        }
        return 1;
    }
    @Override
    public List<ServiceSubtaskAnswer> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) {
        log.error("selectPatQuesTionResult的入参为:{}", serviceSubTaskQueryReq);
        ServiceSubtaskAnswer serviceSubtaskAnswer = new ServiceSubtaskAnswer();
        serviceSubtaskAnswer.setTaskid(serviceSubTaskQueryReq.getTaskid());
        serviceSubtaskAnswer.setPatId(serviceSubTaskQueryReq.getPatId());
        serviceSubtaskAnswer.setScriptid(serviceSubTaskQueryReq.getScriptid());
        List<ServiceSubtaskAnswer> serviceSubtaskAnswerList = serviceSubtaskAnswerMapper.selectServiceSubtaskAnswerList(serviceSubtaskAnswer);
        return serviceSubtaskAnswerList;
    }
    private void setSFInfo(IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO, Long taskid, Long patid) {
    private void setSFInfo(IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, Long taskid, Long patid) {
        ServiceSubtaskAnswer serviceSubtaskAnswer = null;
        String dx = "";
        if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getScriptType()) && ivrLibaTemplateScriptVO.getScriptType().equals("1") || StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getScriptType()) && ivrLibaTemplateScriptVO.getScriptType().equals("2")) {
        List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>();
        if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptType()) && ivrTaskTemplateScriptVO.getScriptType().equals("1") || StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptType()) && ivrTaskTemplateScriptVO.getScriptType().equals("2")) {
            //1、2为单选或多选
            for (IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption : ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList()) {
            for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
                //获取用户选中的选项号
                dx = dx + "," + ivrLibaTemplateTargetoption.getOptionNo().toString();
                if (ivrTaskTemplateTargetoption.getIsUserOperation() == true) {
                    ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                    serviceSubtaskOptionAnswer.setId(ivrTaskTemplateTargetoption.getId());
                    serviceSubtaskOptionAnswer.setCode(ivrTaskTemplateTargetoption.getOptionCode());
                    serviceSubtaskOptionAnswer.setValue(ivrTaskTemplateTargetoption.getTargetvalue());
                    serviceSubtaskOptionAnswer.setAppenddesc(ivrTaskTemplateTargetoption.getAppenddesc());
                    answerList.add(serviceSubtaskOptionAnswer);
                }
            }
        } else if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptType()) && ivrTaskTemplateScriptVO.getScriptType().equals("4")) {
            //填空
            for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
                log.error("ivrTaskTemplateTargetoption的值为:{}", ivrTaskTemplateTargetoption);
                String[] split = ivrTaskTemplateTargetoption.getTargetvalue().split("|");
                for (String s : split) {
                    ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                    serviceSubtaskOptionAnswer.setId(ivrTaskTemplateTargetoption.getId());
                    serviceSubtaskOptionAnswer.setCode(ivrTaskTemplateTargetoption.getOptionCode());
                    serviceSubtaskOptionAnswer.setValue(s);
                    serviceSubtaskOptionAnswer.setAppenddesc(ivrTaskTemplateTargetoption.getAppenddesc());
                    answerList.add(serviceSubtaskOptionAnswer);
                }
            }
        } else {
            //非单多选
            if (CollectionUtils.isNotEmpty(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList())) {
                dx = ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList().get(0).getAppenddesc();
            //非单多选(问答)
            if (CollectionUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList())) {
                log.error("IvrTaskScriptTargetoptionList的值为:{}", ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList());
                ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                serviceSubtaskOptionAnswer.setId(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getId());
                serviceSubtaskOptionAnswer.setCode(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getOptionCode());
                serviceSubtaskOptionAnswer.setValue(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getTargetvalue());
                serviceSubtaskOptionAnswer.setAppenddesc(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getAppenddesc());
                answerList.add(serviceSubtaskOptionAnswer);
            }
        }
        //数据保存
        serviceSubtaskAnswer.setTaskid(taskid);
        serviceSubtaskAnswer.setPatId(patid);
        serviceSubtaskAnswer.setScriptid(ivrLibaTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(ivrLibaTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(dx.substring(1));
        serviceSubtaskAnswer.setScriptid(ivrTaskTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(ivrTaskTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(JSON.toJSONString(answerList));
        serviceSubtaskAnswer.setComment(null);
        serviceSubtaskAnswer.setCreateTime(new Date());
        serviceSubtaskAnswer.setUpdateTime(new Date());
        serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer);
    }
    private void setWJInfo(SvyLibTemplateScriptVO svyLibTemplateScriptVO, Long taskid, Long patid) {
    private void setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) {
        ServiceSubtaskAnswer serviceSubtaskAnswer = null;
        String dx = "";
        if (svyLibTemplateScriptVO.getScriptType().equals("1") || svyLibTemplateScriptVO.getScriptType().equals("2")) {
        List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>();
        if (svyTaskTemplateScriptVO.getScriptType().equals("1") || svyTaskTemplateScriptVO.getScriptType().equals("2")) {
            //1、2为单选或多选
            for (SvyLibTemplateTargetoption svyLibTemplateTargetoption : svyLibTemplateScriptVO.getSvyLibTemplateTargetoptions()) {
                //获取用户选中的选项号
                dx = dx + "," + svyLibTemplateTargetoption.getOptionNo().toString();
            for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()) {
                if (svyTaskTemplateTargetoption.getIsUserOperation() == true) {
                    ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                    serviceSubtaskOptionAnswer.setId(svyTaskTemplateTargetoption.getId());
                    serviceSubtaskOptionAnswer.setCode(svyTaskTemplateTargetoption.getOptionCode());
                    serviceSubtaskOptionAnswer.setValue(svyTaskTemplateTargetoption.getTargetvalue());
                    serviceSubtaskOptionAnswer.setAppenddesc(svyTaskTemplateTargetoption.getAppenddesc());
                    answerList.add(serviceSubtaskOptionAnswer);
                }
            }
        } else {
            //非单多选
            if (CollectionUtils.isNotEmpty(svyLibTemplateScriptVO.getSvyLibTemplateTargetoptions())) {
                dx = svyLibTemplateScriptVO.getSvyLibTemplateTargetoptions().get(0).getAppenddesc();
            if (CollectionUtils.isNotEmpty(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions())) {
                ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                serviceSubtaskOptionAnswer.setId(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getId());
                serviceSubtaskOptionAnswer.setCode(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getOptionCode());
                serviceSubtaskOptionAnswer.setValue(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getTargetvalue());
                serviceSubtaskOptionAnswer.setAppenddesc(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getAppenddesc());
                answerList.add(serviceSubtaskOptionAnswer);
            }
        }
        serviceSubtaskAnswer.setTaskid(Long.valueOf(taskid));
        serviceSubtaskAnswer.setPatId(Long.valueOf(patid));
        serviceSubtaskAnswer.setScriptid(svyLibTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(svyLibTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(dx.substring(1));
        serviceSubtaskAnswer.setScriptid(svyTaskTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(svyTaskTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(JSON.toJSONString(answerList));
        serviceSubtaskAnswer.setComment(null);
        serviceSubtaskAnswer.setCreateTime(new Date());
        serviceSubtaskAnswer.setUpdateTime(new Date());
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -1,7 +1,6 @@
package com.smartor.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.*;
@@ -30,8 +29,6 @@
public class SvyLibTemplateServiceImpl implements ISvyLibTemplateService {
    @Autowired
    private SvyLibTemplateMapper svyLibTemplateMapper;
    @Autowired
    private Icd10AssociationMapper icd10AssociationMapper;
    @Autowired
    private SvyLibTemplateScriptMapper svyLibTemplateScriptMapper;
    @Autowired
smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java
@@ -174,9 +174,9 @@
        //通过话术ID获取选项
        for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : svyTaskTemplateScriptVOS) {
            log.info("svyLibaTemplateScriptVO的主键id为:{}", svyTaskTemplateScriptVO.getID());
            log.info("svyLibaTemplateScriptVO的主键id为:{}", svyTaskTemplateScriptVO.getId());
            SvyTaskTemplateTargetoption svyTaskTemplateTargetoption = new SvyTaskTemplateTargetoption();
            svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScriptVO.getID());
            svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScriptVO.getId());
            List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateTargetoptionMapper.selectSvyTaskTemplateTargetoptionList(svyTaskTemplateTargetoption);
            for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption1 : svyTaskTemplateTargetoptions) {
                ObjectMapper mapper = new ObjectMapper();
@@ -221,11 +221,11 @@
            svyTaskTemplateScriptMapper.updateSvyTaskTemplateScript(svyTaskTemplateScript);
            svyTaskTemplateScript.setIsoperation(2);
        } else if (isoperation == 3) {
            if (svyTaskTemplateScriptVO.getID() == null) {
            if (svyTaskTemplateScriptVO.getId() == null) {
                log.info("删除失败,模板话术id为空");
            } else {
                svyTaskTemplateScriptVO.setUpdateTime(new Date());
                svyTaskTemplateScriptMapper.deleteSvyTaskTemplateScriptByID(svyTaskTemplateScriptVO.getID());
                svyTaskTemplateScriptMapper.deleteSvyTaskTemplateScriptByID(svyTaskTemplateScriptVO.getId());
            }
        }
        return svyTaskTemplateScript;
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -1,83 +1,106 @@
<?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">
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.IvrTaskTemplateScriptMapper">
    <resultMap type="com.smartor.domain.IvrTaskTemplateScript" id="IvrTaskTemplateScriptResult">
        <result property="id"    column="id"    />
        <result property="taskid"    column="taskid"    />
        <result property="templateID"    column="templateID"    />
        <result property="questionPoint"    column="questionPoint"    />
        <result property="noMatchText"    column="noMatchText"    />
        <result property="noMatchVoice"    column="noMatchVoice"    />
        <result property="slienceText"    column="slienceText"    />
        <result property="slienceVoice"    column="slienceVoice"    />
        <result property="submoduleText"    column="submoduleText"    />
        <result property="submoduleVoice"    column="submoduleVoice"    />
        <result property="noClearlyText"    column="noClearlyText"    />
        <result property="noClearlyVoice"    column="noClearlyVoice"    />
        <result property="categoryName"    column="categoryName"    />
        <result property="targetOptions"    column="targetOptions"    />
        <result property="language"    column="language"    />
        <result property="playWavOnly"    column="playWavOnly"    />
        <result property="valueType"    column="value_type"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="isupload"    column="isupload"    />
        <result property="uploadTime"    column="upload_time"    />
        <result property="orgid"    column="orgid"    />
        <result property="pid"    column="pid"    />
        <result property="guid"    column="guid"    />
        <result property="targettype"    column="targettype"    />
        <result property="targetid"    column="targetid"    />
        <result property="targetvalue"    column="targetvalue"    />
        <result property="otherdata"    column="otherdata"    />
        <result property="isMust"    column="is_must"    />
        <result property="questionResult"    column="question_result"    />
        <result property="id" column="id"/>
        <result property="taskid" column="taskid"/>
        <result property="templateID" column="templateID"/>
        <result property="questionPoint" column="questionPoint"/>
        <result property="noMatchText" column="noMatchText"/>
        <result property="noMatchVoice" column="noMatchVoice"/>
        <result property="slienceText" column="slienceText"/>
        <result property="slienceVoice" column="slienceVoice"/>
        <result property="submoduleText" column="submoduleText"/>
        <result property="submoduleVoice" column="submoduleVoice"/>
        <result property="noClearlyText" column="noClearlyText"/>
        <result property="noClearlyVoice" column="noClearlyVoice"/>
        <result property="categoryName" column="categoryName"/>
        <result property="targetOptions" column="targetOptions"/>
        <result property="language" column="language"/>
        <result property="playWavOnly" column="playWavOnly"/>
        <result property="valueType" column="value_type"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="orgid" column="orgid"/>
        <result property="pid" column="pid"/>
        <result property="guid" column="guid"/>
        <result property="targettype" column="targettype"/>
        <result property="targetid" column="targetid"/>
        <result property="targetvalue" column="targetvalue"/>
        <result property="otherdata" column="otherdata"/>
        <result property="isMust" column="is_must"/>
        <result property="questionResult" column="question_result"/>
        <result property="branchFlag" column="branch_flag"/>
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
        <result property="scriptType" column="script_type"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateScriptVo">
        select id, taskid,branch_flag,branch_nextscriptno,  templateID, questionPoint,  noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, categoryName, targetOptions, language, playWavOnly, value_type, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, targettype, targetid, targetvalue,  otherdata, is_must, question_result from ivr_task_template_script
        select id,
               taskid,
               script_type,
               branch_flag,
               branch_nextscriptno,
               templateID,
               questionPoint,
               noMatchText,
               noMatchVoice,
               slienceText,
               slienceVoice,
               submoduleText,
               submoduleVoice,
               noClearlyText,
               noClearlyVoice,
               categoryName,
               targetOptions, language, playWavOnly, value_type, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, targettype, targetid, targetvalue, otherdata, is_must, question_result
        from ivr_task_template_script
    </sql>
    <select id="selectIvrTaskTemplateScriptList" parameterType="com.smartor.domain.IvrTaskTemplateScript" resultMap="IvrTaskTemplateScriptResult">
    <select id="selectIvrTaskTemplateScriptList" parameterType="com.smartor.domain.IvrTaskTemplateScript"
            resultMap="IvrTaskTemplateScriptResult">
        <include refid="selectIvrTaskTemplateScriptVo"/>
        <where>
            <if test="taskid != null "> and taskid = #{taskid}</if>
            <if test="templateID != null "> and templateID = #{templateID}</if>
            <if test="questionPoint != null  and questionPoint != ''"> and questionPoint = #{questionPoint}</if>
            <if test="noMatchText != null  and noMatchText != ''"> and noMatchText = #{noMatchText}</if>
            <if test="noMatchVoice != null  and noMatchVoice != ''"> and noMatchVoice = #{noMatchVoice}</if>
            <if test="slienceText != null  and slienceText != ''"> and slienceText = #{slienceText}</if>
            <if test="slienceVoice != null  and slienceVoice != ''"> and slienceVoice = #{slienceVoice}</if>
            <if test="submoduleText != null  and submoduleText != ''"> and submoduleText = #{submoduleText}</if>
            <if test="submoduleVoice != null  and submoduleVoice != ''"> and submoduleVoice = #{submoduleVoice}</if>
            <if test="noClearlyText != null  and noClearlyText != ''"> and noClearlyText = #{noClearlyText}</if>
            <if test="noClearlyVoice != null  and noClearlyVoice != ''"> and noClearlyVoice = #{noClearlyVoice}</if>
            <if test="categoryName != null  and categoryName != ''"> and categoryName like concat('%', #{categoryName}, '%')</if>
            <if test="targetOptions != null  and targetOptions != ''"> and targetOptions = #{targetOptions}</if>
            <if test="language != null  and language != ''"> and language = #{language}</if>
            <if test="playWavOnly != null "> and playWavOnly = #{playWavOnly}</if>
            <if test="valueType != null "> and value_type = #{valueType}</if>
            <if test="isupload != null "> and isupload = #{isupload}</if>
            <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
            <if test="pid != null "> and pid = #{pid}</if>
            <if test="guid != null  and guid != ''"> and guid = #{guid}</if>
            <if test="targettype != null  and targettype != ''"> and targettype = #{targettype}</if>
            <if test="targetid != null "> and targetid = #{targetid}</if>
            <if test="targetvalue != null  and targetvalue != ''"> and targetvalue = #{targetvalue}</if>
            <if test="otherdata != null  and otherdata != ''"> and otherdata = #{otherdata}</if>
            <if test="isMust != null  and isMust != ''"> and is_must = #{isMust}</if>
            <if test="questionResult != null  and questionResult != ''"> and question_result = #{questionResult}</if>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="questionPoint != null  and questionPoint != ''">and questionPoint = #{questionPoint}</if>
            <if test="noMatchText != null  and noMatchText != ''">and noMatchText = #{noMatchText}</if>
            <if test="noMatchVoice != null  and noMatchVoice != ''">and noMatchVoice = #{noMatchVoice}</if>
            <if test="slienceText != null  and slienceText != ''">and slienceText = #{slienceText}</if>
            <if test="slienceVoice != null  and slienceVoice != ''">and slienceVoice = #{slienceVoice}</if>
            <if test="submoduleText != null  and submoduleText != ''">and submoduleText = #{submoduleText}</if>
            <if test="submoduleVoice != null  and submoduleVoice != ''">and submoduleVoice = #{submoduleVoice}</if>
            <if test="noClearlyText != null  and noClearlyText != ''">and noClearlyText = #{noClearlyText}</if>
            <if test="noClearlyVoice != null  and noClearlyVoice != ''">and noClearlyVoice = #{noClearlyVoice}</if>
            <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                '%')
            </if>
            <if test="targetOptions != null  and targetOptions != ''">and targetOptions = #{targetOptions}</if>
            <if test="language != null  and language != ''">and language = #{language}</if>
            <if test="playWavOnly != null ">and playWavOnly = #{playWavOnly}</if>
            <if test="valueType != null ">and value_type = #{valueType}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
            <if test="otherdata != null  and otherdata != ''">and otherdata = #{otherdata}</if>
            <if test="isMust != null  and isMust != ''">and is_must = #{isMust}</if>
            <if test="questionResult != null  and questionResult != ''">and question_result = #{questionResult}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno = #{branchNextscriptno}
            <if test="scriptType != null  and scriptType != ''">and script_type = #{scriptType}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
        </where>
    </select>
@@ -87,7 +110,8 @@
        where id = #{id}
    </select>
    <insert id="insertIvrTaskTemplateScript" parameterType="com.smartor.domain.IvrTaskTemplateScript" useGeneratedKeys="true" keyProperty="id">
    <insert id="insertIvrTaskTemplateScript" parameterType="com.smartor.domain.IvrTaskTemplateScript"
            useGeneratedKeys="true" keyProperty="id">
        insert into ivr_task_template_script
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskid != null">taskid,</if>
@@ -124,7 +148,8 @@
            <if test="questionResult != null">question_result,</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
         </trim>
            <if test="scriptType != null  and scriptType != ''">script_type,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
            <if test="templateID != null">#{templateID},</if>
@@ -160,7 +185,8 @@
            <if test="questionResult != null">#{questionResult},</if>
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
         </trim>
            <if test="scriptType != null  and scriptType != ''">#{scriptType},</if>
        </trim>
    </insert>
    <update id="updateIvrTaskTemplateScript" parameterType="com.smartor.domain.IvrTaskTemplateScript">
@@ -202,12 +228,15 @@
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </if>
            <if test="scriptType != null  and scriptType != ''">script_type = #{scriptType},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteIvrTaskTemplateScriptByID" parameterType="Long">
        delete from ivr_task_template_script where ID = #{ID}
        delete
        from ivr_task_template_script
        where ID = #{ID}
    </delete>
    <delete id="deleteIvrTaskTemplateScriptByIDs" parameterType="String">
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
@@ -36,13 +36,17 @@
        <result property="nodynamiccruxsJson" column="nodynamiccruxs"/>
        <result property="dynamiccruxsJson" column="dynamiccruxs"/>
        <result property="nextQuestion" column="next_question"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="optionCode" column="option_code"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateTargetoptionVo">
        select id,
               taskid,
               templateID,
               appenddesc,
               targetid,
               option_code,
               targetname,
               targettype,
               categoryName,
@@ -86,6 +90,8 @@
            </if>
            <if test="dynamiccruxsJson != null  and dynamiccruxsJson != ''">and dynamiccruxs = #{dynamiccruxsJson}</if>
            <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if>
            <if test="appenddesc != null ">and appenddesc = #{appenddesc}</if>
            <if test="optionCode != null ">and option_code = #{optionCode}</if>
        </where>
    </select>
@@ -129,6 +135,8 @@
            <if test="nodynamiccruxsJson != null">nodynamiccruxs,</if>
            <if test="dynamiccruxsJson != null">dynamiccruxs,</if>
            <if test="nextQuestion != null">next_question,</if>
            <if test="appenddesc != null">appenddesc,</if>
            <if test="optionCode != null ">option_code,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -161,6 +169,8 @@
            <if test="nodynamiccruxsJson != null">#{nodynamiccruxsJson},</if>
            <if test="dynamiccruxsJson != null">#{dynamiccruxsJson},</if>
            <if test="nextQuestion != null">#{nextQuestion},</if>
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="optionCode != null ">#{optionCode},</if>
        </trim>
    </insert>
@@ -197,6 +207,8 @@
            <if test="nodynamiccruxsJson != null">nodynamiccruxs = #{nodynamiccruxsJson},</if>
            <if test="dynamiccruxsJson != null">dynamiccruxs = #{dynamiccruxsJson},</if>
            <if test="nextQuestion != null">next_question = #{nextQuestion},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="optionCode != null ">option_code = #{optionCode},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -169,12 +169,12 @@
        <!--        </trim>-->
        insert into
        pat_archive(name,viptype,sex,idcardno,birthdate,birthplace,place_of_residence,age,sourcefrom,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time
        ,create_by,create_time,isupload,upload_time,pattype,place_of_residence,nation,birthplace,native_place) values
        pat_archive(name,viptype,sex,idcardno,birthdate,place_of_residence,age,sourcefrom,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time
        ,create_by,create_time,isupload,upload_time,pattype,nation,birthplace,native_place) values
        <foreach item="item" index="index" collection="list" separator=",">
            (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.birthplace},#{item.placeOfResidence},#{item.age},#{item.sourcefrom},#{item.archivetime},#{item.archiveby}
            (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.sourcefrom},#{item.archivetime},#{item.archiveby}
            ,#{item.telcode},#{item.archiveby},#{item.idcardtype},#{item.orgid},#{item.openid},#{item.dduserid},#{item.updateBy},
            #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.placeOfResidence},#{item.nation},#{item.birthplace},#{item.nativePlace}
            #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace}
            )
        </foreach>
    </insert>
smartor/src/main/resources/mapper/smartor/ServiceSubtaskAnswerMapper.xml
@@ -13,8 +13,8 @@
        <result property="score" column="score"/>
        <result property="answer" column="answer"/>
        <result property="comment" column="comment"/>
        <result property="istrack" column="istrack"/>
        <result property="isabnormal" column="isabnormal"/>
        <result property="trackFlag" column="trackFlag"/>
        <result property="warningFlag" column="warning_flag"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
@@ -24,19 +24,21 @@
        <result property="uploadTime" column="upload_time"/>
        <result property="pid" column="pid"/>
        <result property="guid" column="guid"/>
        <result property="answerps" column="answerps"/>
    </resultMap>
    <sql id="selectServiceSubtaskAnswerVo">
        select id,
               taskid,
               answerps,
               pat_id,
               scriptid,
               script_type,
               score,
               answer,
               comment,
               istrack,
               isabnormal,
               track_flag,
               warning_flag,
               del_flag,
               create_by,
               create_time,
@@ -60,12 +62,13 @@
            <if test="score != null  and score != ''">and score = #{score}</if>
            <if test="answer != null  and answer != ''">and answer = #{answer}</if>
            <if test="comment != null  and comment != ''">and comment = #{comment}</if>
            <if test="istrack != null  and istrack != ''">and istrack = #{istrack}</if>
            <if test="isabnormal != null  and isabnormal != ''">and isabnormal = #{isabnormal}</if>
            <if test="trackFlag != null  and trackFlag != ''">and track_flag = #{trackFlag}</if>
            <if test="warningFlag != null  and warningFlag != ''">and warning_flag = #{warningFlag}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="pid != null  and pid != ''">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="answerps != null  and answerps != ''">and answerps = #{answerps}</if>
        </where>
    </select>
@@ -85,8 +88,8 @@
            <if test="score != null">score,</if>
            <if test="answer != null">answer,</if>
            <if test="comment != null">comment,</if>
            <if test="istrack != null">istrack,</if>
            <if test="isabnormal != null">isabnormal,</if>
            <if test="trackFlag != null">track_flag,</if>
            <if test="warningFlag != null">warning_flag,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
@@ -96,6 +99,7 @@
            <if test="uploadTime != null">upload_time,</if>
            <if test="pid != null">pid,</if>
            <if test="guid != null">guid,</if>
            <if test="answerps != null">answerps,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -105,8 +109,8 @@
            <if test="score != null">#{score},</if>
            <if test="answer != null">#{answer},</if>
            <if test="comment != null">#{comment},</if>
            <if test="istrack != null">#{istrack},</if>
            <if test="isabnormal != null">#{isabnormal},</if>
            <if test="trackFlag != null">#{trackFlag},</if>
            <if test="warningFlag != null">#{warningFlag},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
@@ -116,6 +120,7 @@
            <if test="uploadTime != null">#{uploadTime},</if>
            <if test="pid != null">#{pid},</if>
            <if test="guid != null">#{guid},</if>
            <if test="answerps != null">#{answerps},</if>
        </trim>
    </insert>
@@ -129,8 +134,8 @@
            <if test="score != null">score = #{score},</if>
            <if test="answer != null">answer = #{answer},</if>
            <if test="comment != null">comment = #{comment},</if>
            <if test="istrack != null">istrack = #{istrack},</if>
            <if test="isabnormal != null">isabnormal = #{isabnormal},</if>
            <if test="trackFlag != null">track_flag = #{trackFlag},</if>
            <if test="warningFlag != null">warning_flag = #{warningFlag},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
@@ -140,6 +145,7 @@
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="pid != null">pid = #{pid},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="answerps != null">answerps = #{answerps},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -27,7 +27,7 @@
        <result property="guid" column="guid"/>
        <result property="valueType" column="value_type"/>
        <result property="targetOptions" column="targetOptions"/>
        <result property="targettype" column="targettype"/>
        <result property="scriptType" column="script_type"/>
        <result property="targetid" column="targetid"/>
        <result property="targetvalue" column="targetvalue"/>
        <result property="nextScriptno" column="next_scriptno"/>
@@ -51,7 +51,7 @@
               scriptno,
               templateID,
               scriptid,
               script_topic, language, categoryName, script_content, is_must, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, value_type, targetOptions, targettype, targetid, targetvalue, next_scriptno, script_result, otherdata, picture_path
               script_topic, language, categoryName, script_content, is_must, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, value_type, targetOptions, script_type, targetid, targetvalue, next_scriptno, script_result, otherdata, picture_path
        from svy_task_template_script
    </sql>
@@ -77,7 +77,7 @@
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="valueType != null ">and value_type = #{valueType}</if>
            <if test="targetOptions != null  and targetOptions != ''">and targetOptions = #{targetOptions}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="scriptType != null  and scriptType != ''">and script_type = #{scriptType}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
            <if test="nextScriptno != null ">and next_scriptno = #{nextScriptno}</if>
@@ -122,7 +122,7 @@
            <if test="guid != null">guid,</if>
            <if test="valueType != null">value_type,</if>
            <if test="targetOptions != null">targetOptions,</if>
            <if test="targettype != null">targettype,</if>
            <if test="scriptType != null">script_type,</if>
            <if test="targetid != null">targetid,</if>
            <if test="targetvalue != null">targetvalue,</if>
            <if test="nextScriptno != null">next_scriptno,</if>
@@ -156,7 +156,7 @@
            <if test="guid != null">#{guid},</if>
            <if test="valueType != null">#{valueType},</if>
            <if test="targetOptions != null">#{targetOptions},</if>
            <if test="targettype != null">#{targettype},</if>
            <if test="scriptType != null">#{scriptType},</if>
            <if test="targetid != null">#{targetid},</if>
            <if test="targetvalue != null">#{targetvalue},</if>
            <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -194,7 +194,7 @@
            <if test="guid != null">guid = #{guid},</if>
            <if test="valueType != null">value_type = #{valueType},</if>
            <if test="targetOptions != null">targetOptions = #{targetOptions},</if>
            <if test="targettype != null">targettype = #{targettype},</if>
            <if test="scriptType != null">script_type = #{scriptType},</if>
            <if test="targetid != null">targetid = #{targetid},</if>
            <if test="targetvalue != null">targetvalue = #{targetvalue},</if>
            <if test="nextScriptno != null">next_scriptno = #{nextScriptno},</if>
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
@@ -1,86 +1,111 @@
<?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">
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.SvyTaskTemplateTargetoptionMapper">
    <resultMap type="com.smartor.domain.SvyTaskTemplateTargetoption" id="SvyTaskTemplateTargetoptionResult">
        <result property="id"    column="id"    />
        <result property="taskid"    column="taskid"    />
        <result property="templateID"    column="templateID"    />
        <result property="targetid"    column="targetid"    />
        <result property="targetname"    column="targetname"    />
        <result property="targettype"    column="targettype"    />
        <result property="categoryName"    column="categoryName"    />
        <result property="targetvalue"    column="targetvalue"    />
        <result property="targetregex2"    column="targetregex2"    />
        <result property="targetregex"    column="targetregex"    />
        <result property="optioncontent"    column="optioncontent"    />
        <result property="language"    column="language"    />
        <result property="version"    column="version"    />
        <result property="groupid"    column="groupid"    />
        <result property="isabnormal"    column="isabnormal"    />
        <result property="warnup"    column="warnup"    />
        <result property="warndown"    column="warndown"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="isupload"    column="isupload"    />
        <result property="uploadTime"    column="upload_time"    />
        <result property="orgid"    column="orgid"    />
        <result property="pid"    column="pid"    />
        <result property="guid"    column="guid"    />
        <result property="scriptid"    column="scriptid"    />
        <result property="nodynamiccruxsJson"    column="nodynamiccruxs"    />
        <result property="dynamiccruxsJson"    column="dynamiccruxs"    />
        <result property="nextQuestion"    column="next_question"    />
        <result property="picturePath"    column="picture_path"    />
        <result property="id" column="id"/>
        <result property="taskid" column="taskid"/>
        <result property="templateID" column="templateID"/>
        <result property="targetid" column="targetid"/>
        <result property="targetname" column="targetname"/>
        <result property="targettype" column="targettype"/>
        <result property="categoryName" column="categoryName"/>
        <result property="targetvalue" column="targetvalue"/>
        <result property="targetregex2" column="targetregex2"/>
        <result property="targetregex" column="targetregex"/>
        <result property="optioncontent" column="optioncontent"/>
        <result property="language" column="language"/>
        <result property="version" column="version"/>
        <result property="groupid" column="groupid"/>
        <result property="isabnormal" column="isabnormal"/>
        <result property="warnup" column="warnup"/>
        <result property="warndown" column="warndown"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="orgid" column="orgid"/>
        <result property="pid" column="pid"/>
        <result property="guid" column="guid"/>
        <result property="scriptid" column="scriptid"/>
        <result property="nodynamiccruxsJson" column="nodynamiccruxs"/>
        <result property="dynamiccruxsJson" column="dynamiccruxs"/>
        <result property="nextQuestion" column="next_question"/>
        <result property="picturePath" column="picture_path"/>
        <result property="optionCode" column="option_code"/>
        <result property="appendflag" column="appendflag"/>
        <result property="appenddesc" column="appenddesc"/>
    </resultMap>
    <sql id="selectSvyTaskTemplateTargetoptionVo">
        select id, taskid, templateID, targetid, targetname, targettype, categoryName, targetvalue, targetregex2, targetregex, optioncontent, language, version, groupid, isabnormal, warnup, warndown, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, scriptid, nodynamiccruxs, dynamiccruxs, next_question, picture_path from svy_task_template_targetoption
        select id,
               option_code,
               appendflag,
               appenddesc,
               taskid,
               templateID,
               targetid,
               targetname,
               targettype,
               categoryName,
               targetvalue,
               targetregex2,
               targetregex,
               optioncontent, language, version, groupid, isabnormal, warnup, warndown, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, scriptid, nodynamiccruxs, dynamiccruxs, next_question, picture_path
        from svy_task_template_targetoption
    </sql>
    <select id="selectSvyTaskTemplateTargetoptionList" parameterType="com.smartor.domain.SvyTaskTemplateTargetoption" resultMap="SvyTaskTemplateTargetoptionResult">
    <select id="selectSvyTaskTemplateTargetoptionList" parameterType="com.smartor.domain.SvyTaskTemplateTargetoption"
            resultMap="SvyTaskTemplateTargetoptionResult">
        <include refid="selectSvyTaskTemplateTargetoptionVo"/>
        <where>
            <if test="taskid != null "> and taskid = #{taskid}</if>
            <if test="templateID != null "> and templateID = #{templateID}</if>
            <if test="targetid != null "> and targetid = #{targetid}</if>
            <if test="targetname != null  and targetname != ''"> and targetname like concat('%', #{targetname}, '%')</if>
            <if test="targettype != null  and targettype != ''"> and targettype = #{targettype}</if>
            <if test="categoryName != null  and categoryName != ''"> and categoryName like concat('%', #{categoryName}, '%')</if>
            <if test="targetvalue != null  and targetvalue != ''"> and targetvalue = #{targetvalue}</if>
            <if test="targetregex2 != null  and targetregex2 != ''"> and targetregex2 = #{targetregex2}</if>
            <if test="targetregex != null  and targetregex != ''"> and targetregex = #{targetregex}</if>
            <if test="optioncontent != null  and optioncontent != ''"> and optioncontent = #{optioncontent}</if>
            <if test="language != null  and language != ''"> and language = #{language}</if>
            <if test="version != null  and version != ''"> and version = #{version}</if>
            <if test="groupid != null  and groupid != ''"> and groupid = #{groupid}</if>
            <if test="isabnormal != null "> and isabnormal = #{isabnormal}</if>
            <if test="warnup != null "> and warnup = #{warnup}</if>
            <if test="warndown != null "> and warndown = #{warndown}</if>
            <if test="isupload != null "> and isupload = #{isupload}</if>
            <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
            <if test="pid != null "> and pid = #{pid}</if>
            <if test="guid != null  and guid != ''"> and guid = #{guid}</if>
            <if test="scriptid != null "> and scriptid = #{scriptid}</if>
            <if test="nodynamiccruxs != null  and nodynamiccruxs != ''"> and nodynamiccruxs = #{nodynamiccruxsJson}</if>
            <if test="dynamiccruxs != null  and dynamiccruxs != ''"> and dynamiccruxs = #{dynamiccruxsJson}</if>
            <if test="nextQuestion != null "> and next_question = #{nextQuestion}</if>
            <if test="picturePath != null  and picturePath != ''"> and picture_path = #{picturePath}</if>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                '%')
            </if>
            <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
            <if test="targetregex2 != null  and targetregex2 != ''">and targetregex2 = #{targetregex2}</if>
            <if test="targetregex != null  and targetregex != ''">and targetregex = #{targetregex}</if>
            <if test="optioncontent != null  and optioncontent != ''">and optioncontent = #{optioncontent}</if>
            <if test="language != null  and language != ''">and language = #{language}</if>
            <if test="version != null  and version != ''">and version = #{version}</if>
            <if test="groupid != null  and groupid != ''">and groupid = #{groupid}</if>
            <if test="isabnormal != null ">and isabnormal = #{isabnormal}</if>
            <if test="warnup != null ">and warnup = #{warnup}</if>
            <if test="warndown != null ">and warndown = #{warndown}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="scriptid != null ">and scriptid = #{scriptid}</if>
            <if test="nodynamiccruxs != null  and nodynamiccruxs != ''">and nodynamiccruxs = #{nodynamiccruxsJson}</if>
            <if test="dynamiccruxs != null  and dynamiccruxs != ''">and dynamiccruxs = #{dynamiccruxsJson}</if>
            <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if>
            <if test="picturePath != null  and picturePath != ''">and picture_path = #{picturePath}</if>
            <if test="optionCode != null">and option_code = #{optionCode}</if>
            <if test="appendflag != null">and appendflag = #{appendflag}</if>
            <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
        </where>
    </select>
    <select id="selectSvyTaskTemplateTargetoptionById" parameterType="Long" resultMap="SvyTaskTemplateTargetoptionResult">
    <select id="selectSvyTaskTemplateTargetoptionById" parameterType="Long"
            resultMap="SvyTaskTemplateTargetoptionResult">
        <include refid="selectSvyTaskTemplateTargetoptionVo"/>
        where id = #{id}
    </select>
    <insert id="insertSvyTaskTemplateTargetoption" parameterType="com.smartor.domain.SvyTaskTemplateTargetoption" useGeneratedKeys="true" keyProperty="id">
    <insert id="insertSvyTaskTemplateTargetoption" parameterType="com.smartor.domain.SvyTaskTemplateTargetoption"
            useGeneratedKeys="true" keyProperty="id">
        insert into svy_task_template_targetoption
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskid != null">taskid,</if>
@@ -114,7 +139,11 @@
            <if test="dynamiccruxs != null">dynamiccruxs,</if>
            <if test="nextQuestion != null">next_question,</if>
            <if test="picturePath != null">picture_path,</if>
         </trim>
            <if test="optionCode != null">option_code,</if>
            <if test="appendflag != null">appendflag,</if>
            <if test="appenddesc != null">appenddesc,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
            <if test="templateID != null">#{templateID},</if>
@@ -147,7 +176,11 @@
            <if test="dynamiccruxs != null">#{dynamiccruxsJson},</if>
            <if test="nextQuestion != null">#{nextQuestion},</if>
            <if test="picturePath != null">#{picturePath},</if>
         </trim>
            <if test="optionCode != null">#{optionCode}</if>
            <if test="appendflag != null">#{appendflag}</if>
            <if test="appenddesc != null">#{appenddesc}</if>
        </trim>
    </insert>
    <update id="updateSvyTaskTemplateTargetoption" parameterType="com.smartor.domain.SvyTaskTemplateTargetoption">
@@ -184,12 +217,17 @@
            <if test="dynamiccruxs != null">dynamiccruxs = #{dynamiccruxsJson},</if>
            <if test="nextQuestion != null">next_question = #{nextQuestion},</if>
            <if test="picturePath != null">picture_path = #{picturePath},</if>
            <if test="optionCode != null">option_code = #{optionCode},</if>
            <if test="appendflag != null">appendflag = #{appendflag},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteSvyTaskTemplateTargetoptionById" parameterType="Long">
        delete from svy_task_template_targetoption where id = #{id}
        delete
        from svy_task_template_targetoption
        where id = #{id}
    </delete>
    <delete id="deleteSvyTaskTemplateTargetoptionByIds" parameterType="String">