Pv1Mapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.web.work.mapper.Pv1Mapper">
  6. <select id="selectList" resultType="com.ruoyi.web.work.domain.Pv1">
  7. select * from tb_pv1
  8. <where>
  9. <if test="id != null "> and id = #{id}</if>
  10. <if test="patientId != null "> and patient_id = #{patientId}</if>
  11. <if test="cardId != null "> and card_id = #{cardId}</if>
  12. <if test="patientCategory != null and patientCategory != ''"> and patient_category = #{patientCategory}</if>
  13. <if test="bed != null and bed != ''"> and bed = #{bed}</if>
  14. <if test="physician != null and physician != ''"> and physician = #{physician}</if>
  15. <if test="nurseCode != null and nurseCode != ''"> and nurse_code = #{nurseCode}</if>
  16. <if test="hospitalizedNumber != null and hospitalizedNumber != ''"> and hospitalized_number = #{hospitalizedNumber}</if>
  17. <if test="feeCategory != null and feeCategory != ''"> and fee_category = #{feeCategory}</if>
  18. <if test="dischargeMethod != null and dischargeMethod != ''"> and discharge_method = #{dischargeMethod}</if>
  19. <if test="medicalCode != null and medicalCode != ''"> and medical_code = #{medicalCode}</if>
  20. <if test="hospitalStatus != null and hospitalStatus != ''"> and hospital_status = #{hospitalStatus}</if>
  21. <if test="registrationStatus != null and registrationStatus != ''"> and registration_status = #{registrationStatus}</if>
  22. <if test="admissionTime != null and admissionTime != ''"> and admission_time = #{admissionTime}</if>
  23. <if test="dischargeTime != null and dischargeTime != ''"> and discharge_time = #{dischargeTime}</if>
  24. <if test="msgId != null "> and msg_id = #{msgId}</if>
  25. <if test="department != null and department != ''"> and department = #{department}</if>
  26. <if test="wardCode != null and wardCode != ''"> and ward_code = #{wardCode}</if>
  27. <if test="wardName != null and wardName != ''"> and ward_name = #{wardName}</if>
  28. </where>
  29. </select>
  30. <select id="getPatientCardByNameOrDepartment" resultType="com.ruoyi.web.work.domain.PatientCard">
  31. SELECT
  32. tb_pv1.department,
  33. tb_pv1.physician,
  34. tb_patient.`name`,
  35. tb_pv1.discharge_method,
  36. tb_pv1.discharge_time,
  37. tb_pv1.id,
  38. tb_pv1.patient_id,
  39. tb_pv1.card_id
  40. FROM
  41. tb_pv1
  42. JOIN
  43. tb_patient ON tb_pv1.patient_id = tb_patient.id
  44. <where>
  45. <if test="patientName!='' and patientName!=null">
  46. tb_patient.`name` like concat('%', #{patientName}, '%')
  47. </if>
  48. <if test="departmentName!='' and departmentName!= null">
  49. AND tb_pv1.department =#{departmentName}
  50. </if>
  51. <if test="physician!='' and physician!= null">
  52. AND tb_pv1.physician like concat('%', #{physician}, '%')
  53. </if>
  54. </where>
  55. </select>
  56. <select id="getAllDepartment" resultType="com.ruoyi.web.work.domain.PatientCard">
  57. select department from tb_pv1 GROUP BY department
  58. </select>
  59. </mapper>