| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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="cn.tr.module.smart.common.repository.BizQuestionAnswerRepository">
- <select id="selectWebQuestionAnswerList" resultType="cn.tr.module.smart.web.vo.BizWebQuestionAnswerVO">
- SELECT
- bcr.id as id,
- bcr.patient_name as patientName,
- bcr.clinic_name as clinicName,
- bcr.dept_id as deptId,
- bcr.dept_name as deptName,
- bcr.clinic_start_time as clinicStartTime,
- bcr.clinic_end_time as clinicEndTime,
- bqa.id as answerId,
- bqa.question_type as questionType,
- bcr.patient_code as patientCode,
- bcr.create_time as create_time,
- bcr.create_by as create_by,
- bcr.update_time as update_time,
- bcr.update_by as update_by,
- bcr.patient_age as patientAge,
- bcr.patient_gender as patientGender,
- bcr.image_url as imageUrl
- FROM
- biz_clinic_room bcr
- JOIN biz_question_answer bqa ON bcr.ID = bqa.clinic_id
- JOIN biz_clinic_room_doctor_user bcrmu ON bcr.ID = bcrmu.clinic_room_id
- <where>
- <if test="query.condition != null">
- AND bcr.patient_name like concat('%',#{query.condition,jdbcType=VARCHAR},'%')
- OR bcr.clinic_name like concat('%',#{query.condition,jdbcType=VARCHAR},'%')
- </if>
- <if test="query.clinicTime != null and query.clinicTime.size() > 0">
- AND bcr.clinic_start_time >= #{query.clinicTime[0]}
- </if>
- <if test="query.clinicTime != null and query.clinicTime.size() > 1">
- AND bcr.clinic_start_time <= #{query.clinicTime[1]}
- </if>
- <if test="query.questionType != null">
- AND bqa.question_type = #{query.questionType}
- </if>
- <if test="query.deptId != null">
- AND bcr.dept_id = #{query.deptId}
- </if>
- <if test="query.userId != null">
- AND bcrmu.user_id = #{query.userId}
- </if>
- </where>
- </select>
- <select id="selectAnswerByClinicList"
- resultType="cn.tr.module.smart.web.dto.BizWebQuestionAnswerByClinicIdDTO">
- SELECT
- bqa.id AS questionId,
- bqg.name AS groupName,
- bqa.send_time as sendTime,
- bqa.answer_time as answerTime,
- bqa.id as answerId
- FROM
- biz_question_answer bqa
- JOIN biz_question_group bqg ON bqa.question_group_id = bqg.id
- <where>
- bqa.deleted = 0
- <if test="query.clinicId != null">
- AND bqa.clinic_id = #{query.clinicId}
- </if>
- <if test="query.questionType != null">
- AND bqa.question_type = #{query.questionType}
- </if>
- </where>
- </select>
- </mapper>
|