123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?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.lantone.report.mapper.AppealExamineInfoMapper">
- <select id="getComplaintRecord" resultType="com.lantone.report.dto.GetComplaintRecordDTO">
- SELECT
- a.*, b.linkman AS claimant_name,
- c.linkman AS check_name
- FROM
- (
- SELECT
- a.*, c.example_status,
- c.gmt_create AS check_gmt_create
- FROM
- (
- SELECT
- a.id,
- a.behospital_code,
- a.hospital_id,
- a.qcresult_detail_id,
- a.cases_entry_id,
- a.qcresult_detail_msg,
- a.cases_name,
- a.defect_content,
- a.claimant_id,
- a.check_id,
- a.gmt_create AS claimant_gmt_create,
- b.`name`,
- b.beh_dept_name,
- a.appeal_operation_type,
- a.qcresult_detai_value qcresultDetaiValue,
- a.cases_score,
- a.is_reject,
- a.cases_id
- FROM
- `med_appeal_info` a
- LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
- WHERE
- a.hospital_id = b.hospital_id
- AND a.is_deleted = 'N'
- AND a.hospital_id = #{getComplaintRecordVO.hospitalId}
- AND a.claimant_id = #{getComplaintRecordVO.complaintId}
- <if test="getComplaintRecordVO.complaintDateStart != null ">
- <![CDATA[ AND a.gmt_create >= #{getComplaintRecordVO.complaintDateStart}]]>
- </if>
- <if test="getComplaintRecordVO.complaintDateEnd != null ">
- <![CDATA[ AND a.gmt_create <= #{getComplaintRecordVO.complaintDateEnd}]]>
- </if>
- <if test="getComplaintRecordVO.casesName != null and getComplaintRecordVO.casesName != '' ">
- <![CDATA[ AND a.cases_name = #{getComplaintRecordVO.casesName}]]>
- </if>
- <if test="getComplaintRecordVO.operationType != null and getComplaintRecordVO.operationType != '' ">
- <![CDATA[ AND a.appeal_operation_type = #{getComplaintRecordVO.operationType}]]>
- </if>
- <if test="getComplaintRecordVO.isPlacefile != null and getComplaintRecordVO.isPlacefile != '' ">
- <![CDATA[ AND b.is_placefile = #{getComplaintRecordVO.isPlacefile}]]>
- </if>
- <if test="getComplaintRecordVO.deptName != null and getComplaintRecordVO.deptName != '' ">
- <![CDATA[ AND b.beh_dept_name = #{getComplaintRecordVO.deptName}]]>
- </if>
- ) a
- LEFT JOIN med_appeal_examine_info c ON a.id = c.appeal_info_id
- WHERE
- c.is_deleted = 'N'
- <if test="getComplaintRecordVO.state != null and getComplaintRecordVO.state != '' ">
- <![CDATA[ AND c.example_status = #{getComplaintRecordVO.state}]]>
- </if>
- ) a
- LEFT JOIN sys_user b ON a.claimant_id = b.id
- LEFT JOIN sys_user c ON a.check_id = c.id
- WHERE b.is_deleted='N'
- AND c.is_deleted='N'
- <if test="getComplaintRecordVO.name != null and getComplaintRecordVO.name != '' ">
- <![CDATA[ AND c.linkman like concat('%',#{getComplaintRecordVO.name},'%')]]>
- </if>
- </select>
- <select id="getAppealReview" resultType="com.lantone.report.dto.GetAppealReviewDTO">
- SELECT
- a.*, b.linkman AS claimant_name,
- c.linkman AS check_name
- FROM
- (
- SELECT
- a.*, c.example_status,
- c.gmt_create AS check_gmt_create
- FROM
- (
- SELECT
- a.id,
- a.behospital_code,
- a.hospital_id,
- a.qcresult_detail_id,
- a.cases_entry_id,
- a.qcresult_detail_msg,
- a.cases_name,
- a.defect_content,
- a.claimant_id,
- a.check_id,
- a.gmt_create AS claimant_gmt_create,
- b.`name`,
- b.beh_dept_name,
- a.appeal_operation_type
- FROM
- med_appeal_info a
- LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
- WHERE
- a.is_deleted = 'N'
- AND a.hospital_id = #{getAppealReviewVO.hospitalId}
- AND a.hospital_id = b.hospital_id
- AND a.check_id = #{getAppealReviewVO.appealId}
- <if test="getAppealReviewVO.isPlacefile != null and getAppealReviewVO.isPlacefile != '' ">
- <![CDATA[ AND b.is_placefile = #{getAppealReviewVO.isPlacefile}]]>
- </if>
- <if test="getAppealReviewVO.complaintDateStart != null ">
- <![CDATA[ AND a.gmt_create >= #{getAppealReviewVO.complaintDateStart}]]>
- </if>
- <if test="getAppealReviewVO.complaintDateEnd != null ">
- <![CDATA[ AND a.gmt_create <= #{getAppealReviewVO.complaintDateEnd}]]>
- </if>
- <if test="getAppealReviewVO.deptName != null and getAppealReviewVO.deptName != '' ">
- <![CDATA[ AND b.beh_dept_name = #{getAppealReviewVO.deptName}]]>
- </if>
- <if test="getAppealReviewVO.casesName != null and getAppealReviewVO.casesName != '' ">
- <![CDATA[ AND a.cases_name = #{getAppealReviewVO.casesName}]]>
- </if>
- <if test="getAppealReviewVO.operationType != null and getAppealReviewVO.operationType != '' ">
- <![CDATA[ AND a.appeal_operation_type = #{getAppealReviewVO.operationType}]]>
- </if>
- ) a
- LEFT JOIN med_appeal_examine_info c ON a.id = c.appeal_info_id
- WHERE
- c.is_deleted = 'N'
- <if test="getAppealReviewVO.state != null and getAppealReviewVO.state != '' ">
- <![CDATA[ AND c.example_status = #{getAppealReviewVO.state}]]>
- </if>
- ) a
- LEFT JOIN sys_user b ON a.claimant_id = b.id
- LEFT JOIN sys_user c ON a.check_id = c.id
- WHERE b.is_deleted='N'
- AND c.is_deleted='N'
- <if test="getAppealReviewVO.name != null and getAppealReviewVO.name != '' ">
- <![CDATA[ AND b.linkman like concat('%',#{getAppealReviewVO.name},'%')]]>
- </if>
- </select>
- <select id="approved" resultType="java.lang.Boolean">
- </select>
- </mapper>
|