|
@@ -4,61 +4,61 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.DoctorAdvice">
|
|
|
- <id column="doctor_advice_id" property="doctorAdviceId" />
|
|
|
- <result column="hospital_id" property="hospitalId" />
|
|
|
- <result column="behospital_code" property="behospitalCode" />
|
|
|
- <result column="order_doctor_name" property="orderDoctorName" />
|
|
|
- <result column="frequency" property="frequency" />
|
|
|
- <result column="parent_type_id" property="parentTypeId" />
|
|
|
- <result column="doctor_advice_type" property="doctorAdviceType" />
|
|
|
- <result column="usage_num" property="usageNum" />
|
|
|
- <result column="usage_unit" property="usageUnit" />
|
|
|
- <result column="dose" property="dose" />
|
|
|
- <result column="dose_unit" property="doseUnit" />
|
|
|
- <result column="med_mode_type" property="medModeType" />
|
|
|
- <result column="da_frequency" property="daFrequency" />
|
|
|
- <result column="da_deal_type" property="daDealType" />
|
|
|
- <result column="da_start_date" property="daStartDate" />
|
|
|
- <result column="da_item_name" property="daItemName" />
|
|
|
- <result column="da_status" property="daStatus" />
|
|
|
- <result column="da_stop_date" property="daStopDate" />
|
|
|
- <result column="da_group_no" property="daGroupNo" />
|
|
|
- <result column="da_prescription_type" property="daPrescriptionType" />
|
|
|
- <result column="medicine_type" property="medicineType" />
|
|
|
- <result column="da_med_type" property="daMedType" />
|
|
|
- <result column="doctor_notice" property="doctorNotice" />
|
|
|
- <result column="doctor_id" property="doctorId" />
|
|
|
- <result column="doctor_name" property="doctorName" />
|
|
|
- <result column="is_deleted" property="isDeleted" />
|
|
|
- <result column="gmt_create" property="gmtCreate" />
|
|
|
- <result column="gmt_modified" property="gmtModified" />
|
|
|
- <result column="creator" property="creator" />
|
|
|
- <result column="modifier" property="modifier" />
|
|
|
+ <id column="doctor_advice_id" property="doctorAdviceId"/>
|
|
|
+ <result column="hospital_id" property="hospitalId"/>
|
|
|
+ <result column="behospital_code" property="behospitalCode"/>
|
|
|
+ <result column="order_doctor_name" property="orderDoctorName"/>
|
|
|
+ <result column="frequency" property="frequency"/>
|
|
|
+ <result column="parent_type_id" property="parentTypeId"/>
|
|
|
+ <result column="doctor_advice_type" property="doctorAdviceType"/>
|
|
|
+ <result column="usage_num" property="usageNum"/>
|
|
|
+ <result column="usage_unit" property="usageUnit"/>
|
|
|
+ <result column="dose" property="dose"/>
|
|
|
+ <result column="dose_unit" property="doseUnit"/>
|
|
|
+ <result column="med_mode_type" property="medModeType"/>
|
|
|
+ <result column="da_frequency" property="daFrequency"/>
|
|
|
+ <result column="da_deal_type" property="daDealType"/>
|
|
|
+ <result column="da_start_date" property="daStartDate"/>
|
|
|
+ <result column="da_item_name" property="daItemName"/>
|
|
|
+ <result column="da_status" property="daStatus"/>
|
|
|
+ <result column="da_stop_date" property="daStopDate"/>
|
|
|
+ <result column="da_group_no" property="daGroupNo"/>
|
|
|
+ <result column="da_prescription_type" property="daPrescriptionType"/>
|
|
|
+ <result column="medicine_type" property="medicineType"/>
|
|
|
+ <result column="da_med_type" property="daMedType"/>
|
|
|
+ <result column="doctor_notice" property="doctorNotice"/>
|
|
|
+ <result column="doctor_id" property="doctorId"/>
|
|
|
+ <result column="doctor_name" property="doctorName"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="gmt_create" property="gmtCreate"/>
|
|
|
+ <result column="gmt_modified" property="gmtModified"/>
|
|
|
+ <result column="creator" property="creator"/>
|
|
|
+ <result column="modifier" property="modifier"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getPage" parameterType="com.diagbot.vo.DoctorAdviceVO" resultType="com.diagbot.dto.DoctorAdviceDTO">
|
|
|
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
|
|
|
- t.is_deleted = 'N'
|
|
|
+ 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
|
|
|
+ t.is_deleted = 'N'
|
|
|
<if test="doctorAdviceVO.hospitalId != null">
|
|
|
and t.hospital_id = #{doctorAdviceVO.hospitalId}
|
|
|
</if>
|
|
@@ -77,29 +77,33 @@
|
|
|
<if test="doctorAdviceVO.daStartDateEnd != null">
|
|
|
<![CDATA[ and t.da_start_date < #{doctorAdviceVO.daStartDateEnd}]]>
|
|
|
</if>) b
|
|
|
- where 1=1
|
|
|
+ where 1=1
|
|
|
<if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 1">
|
|
|
- <if test="infos != null and infos.size() != 0">
|
|
|
+ <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 test="infos = null and infos.size() == 0">
|
|
|
+ and b.info in('000000ASDQWEZXC@#$%')
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 2 ">
|
|
|
- <if test="infos != null and infos.size() != 0">
|
|
|
- and b.info in
|
|
|
+ <if test="infos != null and infos.size() > 0">
|
|
|
+ and b.info not in
|
|
|
<foreach collection="infos" open="(" separator="," close=")" item="item">
|
|
|
'${item}'
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- and 1=1
|
|
|
+ <if test="infos = null and infos.size() == 0">
|
|
|
+ and 1=1
|
|
|
+ </if>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
-
|
|
|
+ <!-- 获取质控提示信息-->
|
|
|
<select id="getInfo" resultType="java.lang.String">
|
|
|
select b.info
|
|
|
from
|
|
@@ -117,8 +121,9 @@
|
|
|
and a.behospital_code = #{behospitalCode}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
<update id="updateBatchByKey">
|
|
|
- <foreach collection="list" item="item" separator=";">
|
|
|
+ <foreach collection="list" item="item" separator=";">
|
|
|
update med_doctor_advice
|
|
|
<set>
|
|
|
<if test="item.orderDoctorName != null">
|
|
@@ -194,7 +199,8 @@
|
|
|
modifier = #{item.modifier},
|
|
|
</if>
|
|
|
</set>
|
|
|
- where doctor_advice_id = #{item.doctorAdviceId} and hospital_id = #{item.hospitalId} and behospital_code = #{item.behospitalCode}
|
|
|
+ where doctor_advice_id = #{item.doctorAdviceId} and hospital_id = #{item.hospitalId} and behospital_code =
|
|
|
+ #{item.behospitalCode}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|