|
|
@@ -18,6 +18,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="prescribeId" column="prescribe_id" />
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.fs.his.vo.FsPrescribeRecordRejectVo" id="FsPrescribeRecordRejectResult">
|
|
|
+ <result property="prescribeId" column="prescribe_id" />
|
|
|
+ <result property="prescribeCode" column="prescribe_code" />
|
|
|
+ <result property="doctorName" column="doctor_name" />
|
|
|
+ <result property="patientName" column="patient_name" />
|
|
|
+ <result property="auditTime" column="audit_time" />
|
|
|
+ <result property="auditReason" column="audit_reason" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
<sql id="selectFsPrescribeRecordVo">
|
|
|
select id, prescribe_img_url, doctor_id, drug_doctor_id, doctor_name, drug_doctor_name, status, audit_reason, create_time, update_time, prescribe_id from fs_prescibe_record
|
|
|
</sql>
|
|
|
@@ -98,4 +107,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
+
|
|
|
+ <select id="calculateRejectCount" resultMap="FsPrescribeRecordRejectResult">
|
|
|
+ SELECT
|
|
|
+ p.prescribe_id,
|
|
|
+ p.prescribe_code,
|
|
|
+ MAX(r.doctor_name) AS doctor_name,
|
|
|
+ p.patient_name,
|
|
|
+ MIN(r.create_time) AS audit_time,
|
|
|
+ MAX(r.audit_reason) AS audit_reason
|
|
|
+ FROM fs_prescibe_record r
|
|
|
+ JOIN fs_prescribe p ON r.prescribe_id = p.prescribe_id
|
|
|
+ WHERE r.status = 2
|
|
|
+ <!-- 处方ID -->
|
|
|
+ <if test="prescribeId != null">
|
|
|
+ AND p.prescribe_id = #{prescribeId}
|
|
|
+ </if>
|
|
|
+ <!-- 处方编号 -->
|
|
|
+ <if test="prescribeCode != null and prescribeCode != ''">
|
|
|
+ AND p.prescribe_code = #{prescribeCode}
|
|
|
+ </if>
|
|
|
+ <!-- 医生姓名(建议模糊?若需精确则保留 =)-->
|
|
|
+ <if test="doctorName != null and doctorName != ''">
|
|
|
+ AND r.doctor_name = #{doctorName}
|
|
|
+ </if>
|
|
|
+ <!-- 患者姓名 -->
|
|
|
+ <if test="patientName != null and patientName != ''">
|
|
|
+ AND p.patient_name = #{patientName}
|
|
|
+ </if>
|
|
|
+ <!-- 审核时间范围 -->
|
|
|
+ <if test="beginAuditTime != null and beginAuditTime != ''">
|
|
|
+ AND r.create_time >= #{beginAuditTime}
|
|
|
+ </if>
|
|
|
+ <if test="endAuditTime != null and endAuditTime != ''">
|
|
|
+ AND r.create_time <= #{endAuditTime}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ p.prescribe_id,
|
|
|
+ p.prescribe_code,
|
|
|
+ p.patient_name
|
|
|
+ </select>
|
|
|
</mapper>
|