Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
wang0018 4 years ago
parent
commit
a4afffdc20
  1. 8
      tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java
  2. 2
      tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java
  3. 18
      tcm/src/main/resources/mapper_dao/QuestionDao.xml

8
tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java

@ -101,9 +101,9 @@ public class QuestionVo {
// @ApiModelProperty("题目信息") // @ApiModelProperty("题目信息")
// private List<PatientQuestionNum> questionNums; // private List<PatientQuestionNum> questionNums;
@ApiModelProperty("题目信息") @ApiModelProperty("题目信息")
private List<PatientQuestion> questionList; private List<PatientQuestion> questionVos;
@ApiModelProperty("子类型") @ApiModelProperty("子类型")
private List<PatientCode> subCodes; private List<PatientCode> optionVos;
} }
@Data @Data
@ -135,6 +135,8 @@ public class QuestionVo {
private Long recordId; private Long recordId;
@ApiModelProperty("答案") @ApiModelProperty("答案")
private String answer; private String answer;
@ApiModelProperty("说明")
private String explains;
@ApiModelProperty("选项信息") @ApiModelProperty("选项信息")
private List<PatientOption> optionVos; private List<PatientOption> optionVos;
@ -153,6 +155,8 @@ public class QuestionVo {
private String submitValue; private String submitValue;
@ApiModelProperty("是否被选中 0否 1是") @ApiModelProperty("是否被选中 0否 1是")
private byte choose; private byte choose;
@ApiModelProperty("其他信息")
private String otherInformation;
@ApiModelProperty("选择之后的操作 0无 1单行文本 2多行文本 3关联其他题目") @ApiModelProperty("选择之后的操作 0无 1单行文本 2多行文本 3关联其他题目")
private byte afterOperation; private byte afterOperation;
@ApiModelProperty("选择之后关联的题目") @ApiModelProperty("选择之后关联的题目")

2
tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java

@ -48,7 +48,7 @@ public class QuestionService implements IQuestionService{
// } // }
// }); // });
// patientCode.setQuestionNums(patientQuestionNumList); // patientCode.setQuestionNums(patientQuestionNumList);
patientCode.setQuestionList(patientQuestionNumList); patientCode.setQuestionVos(patientQuestionNumList);
} }
}); });
} }

18
tcm/src/main/resources/mapper_dao/QuestionDao.xml

@ -108,6 +108,7 @@
<result column="qremark" jdbcType="VARCHAR" property="remark" /> <result column="qremark" jdbcType="VARCHAR" property="remark" />
<result column="recordId" jdbcType="VARCHAR" property="recordId" /> <result column="recordId" jdbcType="VARCHAR" property="recordId" />
<result column="answer" jdbcType="VARCHAR" property="answer" /> <result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="explains" jdbcType="VARCHAR" property="explains" />
<collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$PatientOption"> <collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$PatientOption">
<id column="oid" jdbcType="BIGINT" property="id" /> <id column="oid" jdbcType="BIGINT" property="id" />
<result column="osort" jdbcType="INTEGER" property="sort" /> <result column="osort" jdbcType="INTEGER" property="sort" />
@ -115,6 +116,7 @@
<result column="osubmit_value" jdbcType="VARCHAR" property="submitValue" /> <result column="osubmit_value" jdbcType="VARCHAR" property="submitValue" />
<result column="oafter_operation" jdbcType="TINYINT" property="afterOperation" /> <result column="oafter_operation" jdbcType="TINYINT" property="afterOperation" />
<result column="choose" jdbcType="TINYINT" property="choose" /> <result column="choose" jdbcType="TINYINT" property="choose" />
<result column="otherInformation" jdbcType="VARCHAR" property="otherInformation" />
</collection> </collection>
</resultMap> </resultMap>
@ -136,7 +138,12 @@
r.patient_id, r.patient_id,
r.id as recordId, r.id as recordId,
if(r.collect_time is null, 0,r.collect_time) as collect_time, 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 FROM
t_question q t_question q
LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0 LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0
@ -159,6 +166,7 @@
<result column="qremark" jdbcType="VARCHAR" property="remark" /> <result column="qremark" jdbcType="VARCHAR" property="remark" />
<result column="recordId" jdbcType="VARCHAR" property="recordId" /> <result column="recordId" jdbcType="VARCHAR" property="recordId" />
<result column="answer" jdbcType="VARCHAR" property="answer" /> <result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="explains" jdbcType="VARCHAR" property="explains" />
<collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$PatientOption"> <collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$PatientOption">
<id column="oid" jdbcType="BIGINT" property="id" /> <id column="oid" jdbcType="BIGINT" property="id" />
<result column="osort" jdbcType="INTEGER" property="sort" /> <result column="osort" jdbcType="INTEGER" property="sort" />
@ -166,6 +174,7 @@
<result column="osubmit_value" jdbcType="VARCHAR" property="submitValue" /> <result column="osubmit_value" jdbcType="VARCHAR" property="submitValue" />
<result column="oafter_operation" jdbcType="TINYINT" property="afterOperation" /> <result column="oafter_operation" jdbcType="TINYINT" property="afterOperation" />
<result column="choose" jdbcType="TINYINT" property="choose" /> <result column="choose" jdbcType="TINYINT" property="choose" />
<result column="otherInformation" jdbcType="VARCHAR" property="otherInformation" />
</collection> </collection>
</resultMap> </resultMap>
@ -185,7 +194,12 @@
if(q.type &gt; 2 and q.type &lt; 13 and q.type != 6,if(o.submit_value = r.contents,true,false),null) as choose, if(q.type &gt; 2 and q.type &lt; 13 and q.type != 6,if(o.submit_value = r.contents,true,false),null) as choose,
r.patient_id, r.patient_id,
r.id as recordId, 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 FROM
t_question q t_question q
LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0 LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0

Loading…
Cancel
Save