贵阳试剂耗材
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/target/classes/mapper/PurchaseCatalogueMapper.xml

75 lines
3.3 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.PurchaseCatalogueMapper">
<resultMap id="purchaseCatalogueMap" type="digital.laboratory.platform.reagent.entity.PurchaseCatalogue">
<id property="purchaseCatalogueId" column="purchase_catalogue_id"/>
<result property="auditOpinionOfPrimary" column="audit_opinion_of_primary"/>
<result property="auditOpinionOfSecondary" column="audit_opinion_of_secondary"/>
<result property="auditResultOfPrimary" column="auditResult_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="primaryAuditorId" column="primary_auditor_id"/>
<result property="releaseDate" column="release_date"/>
<result property="status" column="status"/>
<result property="secondaryAuditorId" column="secondary_auditor_id"/>
</resultMap>
<resultMap id="purchaseCatalogueVO" type="digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO"
extends="purchaseCatalogueMap">
<result property="primaryAuditorName" column="primary_auditor_name"/>
<result property="secondaryAuditorName" column="secondary_auditor_name"/>
</resultMap>
<sql id="getPurchaseCatalogueVOSQL">
SELECT pc.*,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id = pc.primary_auditor_id) AS primary_auditor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=pc.secondary_auditor_id
) AS secondary_auditor_name
FROM purchase_catalogue pc
</sql>
<sql id="getPurchaseCatalogueSQL">
SELECT pc.*,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id = pc.primary_auditor_id) AS primary_auditor_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=pc.secondary_auditor_id
) AS secondary_auditor_name
FROM purchase_catalogue pc
WHERE pc.purchase_catalogue_id = #{purchaseCatalogueId}
</sql>
<!-- 根据条件取 PurchaseCataloguetVO 列表分页 -->
<select id="getPurchaseCatalogueVOPage" resultMap="purchaseCatalogueVO"
resultType="digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO">
<include refid="getPurchaseCatalogueVOSQL"/>
${ew.customSqlSegment}
</select>
<!-- 根据条件取 PurchaseCatalogueVO 列表 -->
<select id="getPurchaseCatalogueVOList" resultMap="purchaseCatalogueVO"
resultType="digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO">
<include refid="getPurchaseCatalogueVOSQL"/>
${ew.customSqlSegment}
</select>
<!-- 根据条件取 CentralizedRequestVO -->
<select id="getPurchaseCatalogueVO" resultMap="purchaseCatalogueVO"
resultType="digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO">
<include refid="getPurchaseCatalogueSQL"></include>
</select>
</mapper>