|
@@ -707,7 +707,9 @@
|
|
c.is_deleted,
|
|
c.is_deleted,
|
|
c.explain_info AS explainInfo,
|
|
c.explain_info AS explainInfo,
|
|
a.type,
|
|
a.type,
|
|
- a.drgs
|
|
|
|
|
|
+ a.drgs,
|
|
|
|
+ c.hospital_id,
|
|
|
|
+ c.behospital_code
|
|
FROM
|
|
FROM
|
|
`qc_cases_entry` a,
|
|
`qc_cases_entry` a,
|
|
qc_mode b,
|
|
qc_mode b,
|
|
@@ -736,7 +738,9 @@
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
appeal.id,
|
|
appeal.id,
|
|
- appeal.qcresult_detail_id,
|
|
|
|
|
|
+ appeal.cases_entry_id,
|
|
|
|
+ appeal.behospital_code,
|
|
|
|
+ appeal.hospital_id,
|
|
appeal.appeal_operation_type,
|
|
appeal.appeal_operation_type,
|
|
examine.example_status
|
|
examine.example_status
|
|
FROM
|
|
FROM
|
|
@@ -744,26 +748,84 @@
|
|
JOIN med_appeal_examine_info examine ON examine.appeal_info_id = appeal.id
|
|
JOIN med_appeal_examine_info examine ON examine.appeal_info_id = appeal.id
|
|
WHERE
|
|
WHERE
|
|
appeal.is_deleted = 'N'
|
|
appeal.is_deleted = 'N'
|
|
- ) appeal ON a.id = appeal.qcresult_detail_id
|
|
|
|
|
|
+ ) appeal ON a.cases_entry_id = appeal.cases_entry_id
|
|
|
|
+ AND a.hospital_id = appeal.hospital_id
|
|
|
|
+ AND a.behospital_code = appeal.behospital_code
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getForeignMsg" resultType="com.diagbot.dto.MsgDTO">
|
|
<select id="getForeignMsg" resultType="com.diagbot.dto.MsgDTO">
|
|
- SELECT a.*, u.linkman
|
|
|
|
|
|
+ SELECT
|
|
|
|
+ a.*, u.linkman,
|
|
|
|
+ appeal.id appealInfoId,
|
|
|
|
+ appeal.appeal_operation_type appealOperationType,
|
|
|
|
+ appeal.example_status exampleStatus
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
- SELECT DISTINCT b.`name` model_name,c.score,c.msg,c.cases_entry_id,c.is_reject,c.id id,c.info, a.cases_id cases_id, d.score cases_score,
|
|
|
|
- b.id model_id, a.name standard_msg, c.opt_type, c.grade_type,
|
|
|
|
- c.gmt_create, c.gmt_modified, c.modifier,c.is_deleted,c.explain_info as explainInfo,
|
|
|
|
- a.type, a.drgs
|
|
|
|
- FROM
|
|
|
|
- `qc_cases_entry` a, qc_mode b, med_qcresult_detail c, qc_cases_hospital d
|
|
|
|
- where a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N' and d.is_deleted = 'N'
|
|
|
|
- and a.id = c.cases_entry_id and a.mode_id = b.id
|
|
|
|
- AND c.cases_id = d.cases_id and c.hospital_id = d.hospital_id
|
|
|
|
- and c.hospital_id = #{hospitalId}
|
|
|
|
- and c.behospital_code = #{behospitalCode}
|
|
|
|
- order by b.order_no, c.grade_type desc, a.order_no) a
|
|
|
|
- LEFT JOIN sys_user u on u.id = a.modifier and u.is_deleted = 'N'
|
|
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ b.`name` model_name,
|
|
|
|
+ c.score,
|
|
|
|
+ c.msg,
|
|
|
|
+ c.cases_entry_id,
|
|
|
|
+ c.is_reject,
|
|
|
|
+ c.id id,
|
|
|
|
+ c.info,
|
|
|
|
+ a.cases_id cases_id,
|
|
|
|
+ d.score cases_score,
|
|
|
|
+ b.id model_id,
|
|
|
|
+ a. NAME standard_msg,
|
|
|
|
+ c.opt_type,
|
|
|
|
+ c.grade_type,
|
|
|
|
+ c.gmt_create,
|
|
|
|
+ c.gmt_modified,
|
|
|
|
+ c.modifier,
|
|
|
|
+ c.is_deleted,
|
|
|
|
+ c.explain_info AS explainInfo,
|
|
|
|
+ a.type,
|
|
|
|
+ a.drgs,
|
|
|
|
+ c.hospital_id,
|
|
|
|
+ c.behospital_code
|
|
|
|
+ FROM
|
|
|
|
+ `qc_cases_entry` a,
|
|
|
|
+ qc_mode b,
|
|
|
|
+ med_qcresult_detail c,
|
|
|
|
+ qc_cases_hospital d
|
|
|
|
+ WHERE
|
|
|
|
+ a.is_deleted = 'N'
|
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
|
+ AND a.id = c.cases_entry_id
|
|
|
|
+ AND a.mode_id = b.id
|
|
|
|
+ AND c.cases_id = d.cases_id
|
|
|
|
+ AND c.hospital_id = d.hospital_id
|
|
|
|
+ AND c.hospital_id = #{hospitalId}
|
|
|
|
+ <if test="qcresultInfoId != null">
|
|
|
|
+ AND c.qcresult_info_id = #{qcresultInfoId}
|
|
|
|
+ </if>
|
|
|
|
+ AND c.behospital_code = #{behospitalCode}
|
|
|
|
+ ORDER BY
|
|
|
|
+ b.order_no,
|
|
|
|
+ c.grade_type DESC,
|
|
|
|
+ a.order_no
|
|
|
|
+ ) a
|
|
|
|
+ LEFT JOIN sys_user u ON u.id = a.modifier
|
|
|
|
+ AND u.is_deleted = 'N'
|
|
|
|
+ LEFT JOIN (
|
|
|
|
+ SELECT
|
|
|
|
+ appeal.id,
|
|
|
|
+ appeal.cases_entry_id,
|
|
|
|
+ appeal.behospital_code,
|
|
|
|
+ appeal.hospital_id,
|
|
|
|
+ appeal.appeal_operation_type,
|
|
|
|
+ examine.example_status
|
|
|
|
+ FROM
|
|
|
|
+ med_appeal_info appeal
|
|
|
|
+ JOIN med_appeal_examine_info examine ON examine.appeal_info_id = appeal.id
|
|
|
|
+ WHERE
|
|
|
|
+ appeal.is_deleted = 'N'
|
|
|
|
+ ) appeal ON a.cases_entry_id = appeal.cases_entry_id
|
|
|
|
+ AND a.hospital_id = appeal.hospital_id
|
|
|
|
+ AND a.behospital_code = appeal.behospital_code
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|