|
@@ -20,35 +20,76 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getQcCasesEntryAlls" resultType="com.diagbot.dto.QcCasesEntryHospitalDTO">
|
|
|
- select
|
|
|
- b.id as id,
|
|
|
- a.cases_id as casesId,
|
|
|
- a.cases_name As casesName,
|
|
|
- a.name as name,
|
|
|
- b.msg As msg,
|
|
|
- b.score as score,
|
|
|
- b.is_reject As isReject,
|
|
|
- b.is_used AS isUsed
|
|
|
- from
|
|
|
- qc_cases_entry a
|
|
|
- join qc_cases_entry_hospital b
|
|
|
+ select
|
|
|
+ b.id as id,
|
|
|
+ a.cases_id as casesId,
|
|
|
+ a.cases_name As casesName,
|
|
|
+ a.name as name,
|
|
|
+ b.msg As msg,
|
|
|
+ b.score as score,
|
|
|
+ b.is_reject As isReject,
|
|
|
+ b.is_used AS isUsed
|
|
|
+ from
|
|
|
+ qc_cases_entry a
|
|
|
+ join qc_cases_entry_hospital b
|
|
|
on a.id = b.cases_entry_id
|
|
|
- where a.is_deleted = "N"
|
|
|
+ where a.is_deleted = "N"
|
|
|
AND b.is_deleted = "N"
|
|
|
- <if test="hospitalId != null and hospitalId != ''">
|
|
|
- AND b.hospital_id = #{hospitalId}
|
|
|
- </if>
|
|
|
- <if test="casesId != null and casesId != ''">
|
|
|
- AND a.cases_id = #{casesId}
|
|
|
- </if>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- AND UPPER(a.name) LIKE CONCAT('%', UPPER(trim(#{name})), '%')
|
|
|
- </if>
|
|
|
- <if test="isReject != null ">
|
|
|
- AND b.is_reject = #{isReject}
|
|
|
- </if>
|
|
|
- <if test="isUsed != null ">
|
|
|
- AND b.is_used =#{isUsed}
|
|
|
- </if>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND b.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="casesId != null and casesId != ''">
|
|
|
+ AND a.cases_id = #{casesId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND UPPER(a.name) LIKE CONCAT('%', UPPER(trim(#{name})), '%')
|
|
|
+ </if>
|
|
|
+ <if test="isReject != null ">
|
|
|
+ AND b.is_reject = #{isReject}
|
|
|
+ </if>
|
|
|
+ <if test="isUsed != null ">
|
|
|
+ AND b.is_used =#{isUsed}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="findQcCasesEntryAll" resultType="com.diagbot.dto.QcCasesEntryFindDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ b.cases_id AS casesId,
|
|
|
+ b.cases_name AS casesName,
|
|
|
+ b.mode_id AS modeId,
|
|
|
+ b.id AS casesEntryId,
|
|
|
+ a.hospital_id AS hospitalId,
|
|
|
+ b.name AS entryName,
|
|
|
+ a.msg AS msg ,
|
|
|
+ a.score as score,
|
|
|
+ a.is_reject as isReject
|
|
|
+ FROM
|
|
|
+ qc_cases_entry_hospital a
|
|
|
+ JOIN qc_cases_entry b
|
|
|
+ ON a.cases_entry_id = b.id
|
|
|
+ WHERE a.is_deleted = "N"
|
|
|
+ AND b.is_deleted = "N"
|
|
|
+ AND a.is_used =1
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="modeId != null and modeId != ''">
|
|
|
+ and b.mode_id =#{modeId}
|
|
|
+ </if>
|
|
|
+ <if test="entryName != null and entryName != ''">
|
|
|
+ AND UPPER(b.name) LIKE CONCAT('%', UPPER(trim(#{entryName})), '%')
|
|
|
+ </if>
|
|
|
+ and a.cases_entry_id NOT IN
|
|
|
+ (SELECT
|
|
|
+ cases_entry_id
|
|
|
+ FROM
|
|
|
+ med_qcresult_detail
|
|
|
+ WHERE is_deleted = "N"
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
+ AND behospital_code = #{behospitalCode}
|
|
|
+ </if>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</select>
|
|
|
</mapper>
|