|
@@ -150,19 +150,20 @@
|
|
|
|
|
|
<select id="entryTypePage" resultType="com.diagbot.dto.QcEntryTypeDTO">
|
|
|
SELECT
|
|
|
- *
|
|
|
+ t.*, qc.cases_id,
|
|
|
+ qc.cases_name,
|
|
|
+ qc.`code`,
|
|
|
+ qc.`name` entry_name
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
a1.entry_id,
|
|
|
- a1.entry_name,
|
|
|
a1.hospital_id,
|
|
|
GROUP_CONCAT(b1. NAME) type_str
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
t1.id entry_id,
|
|
|
- t1.`name` entry_name,
|
|
|
t2.hospital_id
|
|
|
FROM
|
|
|
qc_cases_entry t1,
|
|
@@ -188,20 +189,26 @@
|
|
|
AND a1.hospital_id = b1.hospital_id
|
|
|
GROUP BY
|
|
|
a1.entry_id,
|
|
|
- a1.entry_name,
|
|
|
a1.hospital_id
|
|
|
- ) t
|
|
|
- <where>
|
|
|
- <if test="hospitalId != null">
|
|
|
- and t.hospital_id = #{hospitalId}
|
|
|
- </if>
|
|
|
- <if test="entryName != null and entryName != ''">
|
|
|
- and t.entry_name like concat('%', #{entryName}, '%')
|
|
|
- </if>
|
|
|
- <if test="typeName != null and typeName != ''">
|
|
|
- and t.type_str like concat('%', #{typeName}, '%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ ) t,
|
|
|
+ qc_cases_entry qc
|
|
|
+ WHERE
|
|
|
+ t.entry_id = qc.id
|
|
|
+ <if test="hospitalId != null">
|
|
|
+ and t.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="entryName != null and entryName != ''">
|
|
|
+ and qc.name like concat('%', #{entryName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ and qc.code like concat('%', #{code}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="casesId != null">
|
|
|
+ and qc.cases_id = #{casesId}
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null and typeName != ''">
|
|
|
+ and t.type_str like concat('%', #{typeName}, '%')
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="entryTypeDetail" resultType="com.diagbot.dto.QcTypeByEntryDTO">
|