|
@@ -23,32 +23,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="dischargeTime != null and dischargeTime != ''"> and discharge_time = #{dischargeTime}</if>
|
|
|
<if test="msgId != null "> and msg_id = #{msgId}</if>
|
|
|
<if test="department != null and department != ''"> and department = #{department}</if>
|
|
|
+ <if test="wardCode != null and wardCode != ''"> and ward_code = #{wardCode}</if>
|
|
|
+ <if test="wardName != null and wardName != ''"> and ward_name = #{wardName}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="getPatientCardByNameOrRoomOrEntity" resultType="com.ruoyi.web.work.domain.PatientCard">
|
|
|
- select * from tb_pv1
|
|
|
-<!-- <where>-->
|
|
|
-<!-- <if test="patientName!=null or patientName!=''">-->
|
|
|
-<!-- patient_id in (select id from tb_patient where tb_patient.name=#{patientName} )-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="departmentName!=null or departmentName!=''">-->
|
|
|
-<!-- and department=#{departmentName}-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="entity!=null or entity!=''">-->
|
|
|
-<!-- and entity=#{entity}-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- </where>-->
|
|
|
-
|
|
|
-
|
|
|
+ SELECT
|
|
|
+ tb_pv1.department,
|
|
|
+ tb_pv1.physician,
|
|
|
+ tb_patient.`name`,
|
|
|
+ tb_pv1.discharge_method,
|
|
|
+ tb_pv1.discharge_time,
|
|
|
+ tb_pv1.patient_id
|
|
|
+ FROM
|
|
|
+ tb_pv1
|
|
|
+ JOIN
|
|
|
+ tb_patient ON tb_pv1.patient_id = tb_patient.id
|
|
|
+ <where>
|
|
|
+ <if test="patientName!='' and patientName!=null">
|
|
|
+ tb_patient.`name` like concat('%', #{patientName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="departmentName!='' and departmentName!= null">
|
|
|
+ AND tb_pv1.department like concat('%', #{departmentName}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<select id="getPv1ByPatientId" resultType="com.ruoyi.web.work.domain.Pv1">
|
|
|
select * from tb_pv1 where patient_id=#{id}
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
+ <select id="getAllDepartment" resultType="com.ruoyi.web.work.domain.PatientCard">
|
|
|
+ select department from tb_pv1
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|