dimensional-health-interrog.../target/classes/mapper/RegistrationInformationMapp...

86 lines
4.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.four.patient.mapper.RegistrationInformationMapper">
<resultMap id="ResponseRegistrationInformation" type="com.four.common.duck.response.ResponseRegistrationInformation">
<id property="registrationInformationId" column="registration_information_id"/>
<result property="userId" column="user_id"/>
<result property="realName" column="real_name"/>
<result property="affiliatedHospital" column="affiliated_hospital"/>
<result property="medicalDepartmentId" column="medical_department_id"/>
<result property="professionalTitleDoctorId" column="professional_title_doctor_id"/>
<result property="personalResume" column="personal_resume"/>
<result property="areaExpertise" column="area_expertise"/>
<result property="registrationTime" column="registration_time"/>
<result property="numberPatientsServed" column="number_patients_served"/>
<result property="consultingPrice" column="consulting_price"/>
<result property="praise" column="praise"/>
<result property="registrationInformationExamineStatus" column="registration_information_examine_status"/>
<result property="registrationInformationMedicStatus" column="registration_information_medic_status"/>
<result property="name" column="name"/>
<result property="professionalTitleDoctorName" column="professional_title_doctor_name"/>
<result property="username" column="username"/>
</resultMap>
<sql id="selectRegistrationInformation">
SELECT r.registration_information_id,
r.user_id,r.real_name,
r.affiliated_hospital,
r.medical_department_id,
r.professional_title_doctor_id,
r.personal_resume,
r.area_expertise,
r.registration_time,
r.number_patients_served,
r.consulting_price,
r.praise,
r.registration_information_examine_status,
r.registration_information_medic_status,
s.`name`, p.professional_title_doctor_name
FROM `registration_information` r
LEFT JOIN symptoms_drugs s ON r.medical_department_id = s.id
LEFT JOIN professional_title_doctor p
ON r.professional_title_doctor_id = p.professional_title_doctor_id
</sql>
<select id="ShowRegistrationInformationAllPrice" resultMap="ResponseRegistrationInformation">
<include refid="selectRegistrationInformation"></include>
<where>
<if test="null!=medicalDepartmentId and ''!=medicalDepartmentId">
and r.medical_department_id = #{medicalDepartmentId}
</if>
</where>
ORDER BY r.consulting_price DESC
</select>
<select id="ShowRegistrationInformationNumber" resultMap="ResponseRegistrationInformation">
<include refid="selectRegistrationInformation"></include>
<where>
<if test="null!=medicalDepartmentId and ''!=medicalDepartmentId">
and r.medical_department_id = #{medicalDepartmentId}
</if>
</where>
ORDER BY r.number_patients_served DESC
</select>
<select id="ShowRegistrationInformationPraise" resultMap="ResponseRegistrationInformation">
<include refid="selectRegistrationInformation"></include>
<where>
<if test="null!=medicalDepartmentId and ''!=medicalDepartmentId">
and r.medical_department_id = #{medicalDepartmentId}
</if>
</where>
ORDER BY r.praise DESC
</select>
<select id="ShowRegistrationInformationAll" resultMap="ResponseRegistrationInformation">
<include refid="selectRegistrationInformation"></include>
<where>
<if test="null!=medicalDepartmentId and ''!=medicalDepartmentId">
and r.medical_department_id=#{medicalDepartmentId}
</if>
</where>
ORDER BY r.consulting_price,r.number_patients_served,r.praise DESC
</select>
</mapper>