diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java b/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java index a025a963..ac5c94ed 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java @@ -101,9 +101,9 @@ public class QuestionVo { // @ApiModelProperty("题目信息") // private List questionNums; @ApiModelProperty("题目信息") - private List questionList; + private List questionVos; @ApiModelProperty("子类型") - private List subCodes; + private List optionVos; } @Data @@ -135,6 +135,8 @@ public class QuestionVo { private Long recordId; @ApiModelProperty("答案") private String answer; + @ApiModelProperty("说明") + private String explains; @ApiModelProperty("选项信息") private List optionVos; @@ -153,6 +155,8 @@ public class QuestionVo { private String submitValue; @ApiModelProperty("是否被选中 0否 1是") private byte choose; + @ApiModelProperty("其他信息") + private String otherInformation; @ApiModelProperty("选择之后的操作 0无 1单行文本 2多行文本 3关联其他题目") private byte afterOperation; @ApiModelProperty("选择之后关联的题目") diff --git a/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java b/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java index 32f92fc5..e9bdd954 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java @@ -48,7 +48,7 @@ public class QuestionService implements IQuestionService{ // } // }); // patientCode.setQuestionNums(patientQuestionNumList); - patientCode.setQuestionList(patientQuestionNumList); + patientCode.setQuestionVos(patientQuestionNumList); } }); } diff --git a/tcm/src/main/resources/mapper_dao/QuestionDao.xml b/tcm/src/main/resources/mapper_dao/QuestionDao.xml index ef27b9f4..e9d29431 100644 --- a/tcm/src/main/resources/mapper_dao/QuestionDao.xml +++ b/tcm/src/main/resources/mapper_dao/QuestionDao.xml @@ -108,6 +108,7 @@ + @@ -115,6 +116,7 @@ + @@ -136,7 +138,12 @@ r.patient_id, r.id as recordId, if(r.collect_time is null, 0,r.collect_time) as collect_time, - if(LEFT(r.contents,3) = '其他:',SUBSTRING(r.contents,4),r.contents) as answer + r.contents as answer, + if(r.contents_type = 2,r.contents,null) as explains, + + if(r.contents_type = 1 and SUBSTRING_INDEX(r.contents,':',1) = o.submit_value, + SUBSTRING(r.contents,char_length(o.submit_value)+1),null + ) as otherInformation FROM t_question q LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0 @@ -159,6 +166,7 @@ + @@ -166,6 +174,7 @@ + @@ -185,7 +194,12 @@ if(q.type > 2 and q.type < 13 and q.type != 6,if(o.submit_value = r.contents,true,false),null) as choose, r.patient_id, r.id as recordId, - if(LEFT(r.contents,3) = '其他:',SUBSTRING(r.contents,4),r.contents) as answer + r.contents as answer, + if(r.contents_type = 2,r.contents,null) as explains, + + if(r.contents_type = 1 and SUBSTRING_INDEX(r.contents,':',1) = o.submit_value, + SUBSTRING(r.contents,char_length(o.submit_value)+1),null + ) as otherInformation FROM t_question q LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0