|
@@ -37,32 +37,86 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getPage" parameterType="com.diagbot.vo.DoctorAdviceVO" resultType="com.diagbot.dto.DoctorAdviceDTO">
|
|
|
- SELECT
|
|
|
- t.*
|
|
|
- FROM
|
|
|
+ select b.*
|
|
|
+ from(
|
|
|
+ SELECT
|
|
|
+ t.doctor_advice_id,
|
|
|
+ t.hospital_id,
|
|
|
+ t.behospital_code,
|
|
|
+ t.doctor_advice_type,
|
|
|
+ t.da_start_date,
|
|
|
+ t.da_stop_date,
|
|
|
+ t.da_item_name,
|
|
|
+ CONCAT( t.da_item_name, '(',DATE_FORMAT( t.da_start_date,'%Y-%m-%d'),')')as info,
|
|
|
+ t.da_prescription_type,
|
|
|
+ t.medicine_type,
|
|
|
+ t.dose,
|
|
|
+ t.dose_unit,
|
|
|
+ t.med_mode_type,
|
|
|
+ t.da_frequency,
|
|
|
+ t.doctor_name
|
|
|
+ FROM
|
|
|
`med_doctor_advice` t
|
|
|
- WHERE
|
|
|
+ where
|
|
|
t.is_deleted = 'N'
|
|
|
- <if test="hospitalId != null">
|
|
|
- and t.hospital_id = #{hospitalId}
|
|
|
+ <if test="doctorAdviceVO.hospitalId != null">
|
|
|
+ and t.hospital_id = #{doctorAdviceVO.hospitalId}
|
|
|
</if>
|
|
|
- <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
- and t.behospital_code = #{behospitalCode}
|
|
|
+ <if test="doctorAdviceVO.behospitalCode != null and doctorAdviceVO.behospitalCode != ''">
|
|
|
+ and t.behospital_code = #{doctorAdviceVO.behospitalCode}
|
|
|
+ </if>
|
|
|
+ <if test="doctorAdviceVO.doctorAdviceType != null and doctorAdviceVO.doctorAdviceType != ''">
|
|
|
+ and t.doctor_advice_type like CONCAT('%',#{doctorAdviceVO.doctorAdviceType},'%')
|
|
|
</if>
|
|
|
- <if test="doctorAdviceType != null and doctorAdviceType != ''">
|
|
|
- and t.doctor_advice_type like CONCAT('%',#{doctorAdviceType},'%')
|
|
|
+ <if test="doctorAdviceVO.daItemName != null and doctorAdviceVO.daItemName != ''">
|
|
|
+ and t.da_item_name like CONCAT('%',#{doctorAdviceVO.daItemName},'%')
|
|
|
</if>
|
|
|
- <if test="daItemName != null and daItemName != ''">
|
|
|
- and t.da_item_name like CONCAT('%',#{daItemName},'%')
|
|
|
+ <if test="doctorAdviceVO.daStartDateStart != null">
|
|
|
+ <![CDATA[ and t.da_start_date >= #{doctorAdviceVO.daStartDateStart}]]>
|
|
|
</if>
|
|
|
- <if test="daStartDateStart != null">
|
|
|
- <![CDATA[ and t.da_start_date >= #{daStartDateStart}]]>
|
|
|
+ <if test="doctorAdviceVO.daStartDateEnd != null">
|
|
|
+ <![CDATA[ and t.da_start_date < #{doctorAdviceVO.daStartDateEnd}]]>
|
|
|
+ </if>) b
|
|
|
+ where 1=1
|
|
|
+ <if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 1">
|
|
|
+ <if test="infos != null and infos.size() != 0">
|
|
|
+ and b.info in
|
|
|
+ <foreach collection="infos" open="(" separator="," close=")" item="item">
|
|
|
+ '${item}'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and b.info in('000000ASDQWEZXC')
|
|
|
</if>
|
|
|
- <if test="daStartDateEnd != null">
|
|
|
- <![CDATA[ and t.da_start_date < #{daStartDateEnd}]]>
|
|
|
+ <if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 2 ">
|
|
|
+ <if test="infos != null and infos.size() != 0">
|
|
|
+ and b.info in
|
|
|
+ <foreach collection="infos" open="(" separator="," close=")" item="item">
|
|
|
+ '${item}'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and 1=1
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getInfo" resultType="java.lang.String">
|
|
|
+ select b.info
|
|
|
+ from
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_detail b
|
|
|
+ where
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ and b.is_deleted = 'N'
|
|
|
+ and a.hospital_id = b.hospital_id
|
|
|
+ and a.behospital_code = b.behospital_code
|
|
|
+ <if test="hospitalId != null">
|
|
|
+ and a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
+ and a.behospital_code = #{behospitalCode}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
<update id="updateBatchByKey">
|
|
|
<foreach collection="list" item="item" separator=";">
|
|
|
update med_doctor_advice
|