贵阳试剂耗材
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dlp-reagent-managment/src/main/resources/mapper/ComplianceCheckMapper.xml

114 lines
5.4 KiB

<?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="digital.laboratory.platform.reagent.mapper.ComplianceCheckMapper">
<resultMap id="complianceCheckMap" type="digital.laboratory.platform.reagent.entity.ComplianceCheck">
<id property="id" column="id"/>
<result property="auditOpinionOfPrimary" column="audit_opinion_of_primary"/>
<result property="auditOpinionOfSecondary" column="audit_opinion_of_secondary"/>
<result property="auditResultOfPrimary" column="audit_result_of_primary"/>
<result property="auditResultOfSecondary" column="audit_result_of_secondary"/>
<result property="auditTimeOfPrimary" column="audit_time_of_primary"/>
<result property="auditTimeOfSecondary" column="audit_time_of_secondary"/>
<result property="dateOfInspection" column="date_of_inspection"/>
<result property="examinationConclusion" column="examination_conclusion"/>
<result property="primaryAuditorId" column="primary_auditor_id"/>
<result property="inspectionScheme" column="inspection_scheme"/>
<result property="status" column="status"/>
<result property="secondaryAuditorId" column="secondary_auditor_id"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="number" column="number"/>
<result property="brand" column="brand"/>
<result property="reagentConsumableId" column="reagent_consumable_id"/>
<result property="specificationAndModel" column="specification_and_model"/>
<result property="nonconformingItem" column="nonconforming_item"/>
<result property="reagentConsumableNumber" column="reagent_consumable_number"/>
<result property="executorId" column="executor_id"/>
<result property="batchDetailsId" column="batch_details_id"/>
<result property="commitTime" column="commit_time"/>
<result property="reagentConsumableName" column="reagent_consumable_name"/>
<result property="referenceMaterialId" column="reference_material_id"/>
</resultMap>
<resultMap id="complianceCheckVO" type="digital.laboratory.platform.reagent.vo.ComplianceCheckVO"
extends="complianceCheckMap">
<result property="executorName" column="executor_name"></result>
<result property="primaryAuditorName" column="primary_auditor_name"></result>
<result property="secondaryAuditorName" column="secondary_auditor_name"></result>
<result property="makerName" column="maker_name"></result>
<result property="createName" column="create_name"></result>
<result property="department" column="department"></result>
</resultMap>
<sql id="getComplianceCheckVOSQL">
SELECT cc.*,
(
select department
from dlp_base.sys_user
where user_id = cc.executor_id) as department
,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.executor_id) AS executor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.create_by) AS maker_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.primary_auditor_id) AS primary_auditor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.secondary_auditor_id) AS secondary_auditor_name
FROM compliance_check cc
</sql>
<select id="getComplianceCheckVOPage" resultMap="complianceCheckVO"
resultType="digital.laboratory.platform.reagent.vo.ComplianceCheckVO">
<include refid="getComplianceCheckVOSQL"></include>
${ew.customSqlSegment}
</select>
<select id="getComplianceCheckVOList" resultMap="complianceCheckVO"
resultType="digital.laboratory.platform.reagent.vo.ComplianceCheckVO">
<include refid="getComplianceCheckVOSQL"></include>
</select>
<select id="getComplianceCheckVO" resultMap="complianceCheckVO"
resultType="digital.laboratory.platform.reagent.vo.ComplianceCheckVO">
SELECT cc.*,
(
select department
from dlp_base.sys_user
where user_id = cc.executor_id) as department
,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.executor_id) AS executor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.create_by) AS maker_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.primary_auditor_id) AS primary_auditor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.secondary_auditor_id) AS secondary_auditor_name,
(
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id =cc.executor_id) AS create_name
FROM compliance_check cc
WHERE cc.id = #{complianceCheckId}
</select>
</mapper>