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.
173 lines
8.7 KiB
173 lines
8.7 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.WarehousingContentMapper">
|
|
|
|
<resultMap id="warehousingContentMap" type="digital.laboratory.platform.reagent.entity.WarehousingContent">
|
|
<id property="id" column="id"></id>
|
|
<result property="reagentConsumableId" column="reagent_consumable_id"></result>
|
|
<result property="totalQuantity" column="total_quantity"></result>
|
|
<result property="warehousingRecordFormId" column="warehousing_record_form_id"></result>
|
|
<result property="warehousingQuantity" column="warehousing_quantity"></result>
|
|
<result property="catalogueNumber" column="catalogue_number"></result>
|
|
<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="acceptanceRecordFormId" column="acceptance_record_form_id"/>
|
|
<result property="supplierId" column="supplier_id"/>
|
|
<result property="reagentConsumableName" column="reagent_consumable_name"/>
|
|
<result property="evaluationFormId" column="evaluation_form_id"/>
|
|
<result property="purchaseListDetailsId" column="purchase_list_details_id"/>
|
|
<result property="status" column="status"/>
|
|
<result property="warningValue" column="warning_value"/>
|
|
<result property="code" column="code"/>
|
|
<result property="lastStorageLocation" column="last_storage_location"/>
|
|
<result property="latticeId" column="lattice_id"/>
|
|
<result property="boxId" column="box_id"/>
|
|
|
|
</resultMap>
|
|
|
|
<resultMap id="warehousingContentVO" type="digital.laboratory.platform.reagent.vo.WarehousingContentVO"
|
|
extends="warehousingContentMap">
|
|
<result property="supplierName" column="supplier_name"/>
|
|
<result property="applicantName" column="applicant_name"/>
|
|
<result property="brand" column="brand"/>
|
|
<result property="category" column="category"/>
|
|
<result property="specificationAndModel" column="specification_and_model"/>
|
|
<result property="standardValueOrPurity" column="standard_value_or_purity"/>
|
|
<collection property="warehousingBatchListVOList" ofType="warehousingBatchListVOMap"
|
|
select="getWarehousingBatchListVOList"
|
|
column="id"></collection>
|
|
</resultMap>
|
|
|
|
<resultMap id="warehousingBatchListVOMap" type="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO">
|
|
<id property="id" column="id"/>
|
|
<result property="batch" column="batch"/>
|
|
<result property="batchNumber" column="batch_number"/>
|
|
<result property="dateOfProduction" column="date_of_production"/>
|
|
<result property="dateOfPurchase" column="date_of_purchase"/>
|
|
<result property="dateOfReceipt" column="date_of_receipt"/>
|
|
<result property="expirationDate" column="expiration_date"/>
|
|
<result property="quantity" column="quantity"/>
|
|
<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="reagentConsumableId" column="reagent_consumable_id"/>
|
|
<result property="warehousingContentId" column="warehousing_content_id"/>
|
|
<result property="warningValue" column="warning_value"/>
|
|
<result property="depositorId" column="depositor_id"/>
|
|
<result property="latticeId" column="lattice_id"/>
|
|
<result property="limitDate" column="limit_date"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="location" column="location"/>
|
|
<result property="batchId" column="batch_id"/>
|
|
<result property="depositorName" column="depositor_name"></result>
|
|
<result property="reagentConsumableName" column="reagent_consumable_name"></result>
|
|
<result property="standardValueOrPurity" column="standard_value_or_purity"></result>
|
|
<result property="specificationAndModel" column="specification_and_model"></result>
|
|
<result property="reagentConsumableId" column="reagent_consumable_id"></result>
|
|
<result property="category" column="category"></result>
|
|
<collection property="idList" ofType="referenceMaterialMap"
|
|
select="getReferenceMaterialMapByBatchId" column="batch_id"></collection>
|
|
</resultMap>
|
|
|
|
<resultMap id="referenceMaterialMap" type="digital.laboratory.platform.reagent.entity.ReferenceMaterial">
|
|
<id property="id" column="id"></id>
|
|
<result property="number" column="number"></result>
|
|
<result property="reagentConsumableName" column="reagent_consumable_name"></result>
|
|
</resultMap>
|
|
|
|
<select id="getReferenceMaterialMapByBatchId" resultMap="referenceMaterialMap">
|
|
select rm.id, rm.number, rm.reagent_consumable_name
|
|
from reference_material rm
|
|
where rm.batch_details_id = #{batch_id}
|
|
order by number asc
|
|
</select>
|
|
|
|
<select id="getWarehousingBatchListVOList" resultMap="warehousingBatchListVOMap"
|
|
resultType="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO">
|
|
SELECT wb.*,
|
|
wc.reagent_consumable_id as reagent_consumable_id,
|
|
rc.reagent_consumable_name,
|
|
rc.standard_value_or_purity,
|
|
rc.specification_and_model,
|
|
rc.category,
|
|
u.`name` as
|
|
depositor_name
|
|
FROM warehousing_batch_list wb
|
|
LEFT JOIN warehousing_content wc ON wb.warehousing_content_id = wc.id
|
|
LEFT JOIN reagent_consumables rc ON wc.reagent_consumable_id = rc.reagent_consumable_id
|
|
LEFT JOIN dlp_base.sys_user u ON u.user_id = wb.create_by
|
|
WHERE wb.warehousing_content_id = #{id}
|
|
ORDER BY create_time DESC;
|
|
</select>
|
|
|
|
|
|
<select id="getWarehousingContentVOList" resultMap="warehousingContentVO"
|
|
resultType="digital.laboratory.platform.reagent.vo.WarehousingContentVO">
|
|
SELECT
|
|
wc.*,
|
|
ri.warning_value,
|
|
si.supplier_name,
|
|
user.name AS applicant_name,
|
|
rc.category,
|
|
rc.specification_and_model,
|
|
rc.brand,
|
|
rc.standard_value_or_purity,
|
|
rc.deviation_or_uncertainty,
|
|
rc.unit_price
|
|
FROM
|
|
warehousing_content wc
|
|
LEFT JOIN
|
|
supplier_information si ON wc.supplier_id = si.id
|
|
LEFT JOIN
|
|
dlp_base.sys_user user ON wc.update_by = user.user_id
|
|
LEFT JOIN
|
|
reagent_consumables rc ON wc.reagent_consumable_id = rc.reagent_consumable_id
|
|
LEFT JOIN
|
|
reagent_consumable_inventory ri ON wc.reagent_consumable_id = ri.reagent_consumable_id
|
|
WHERE
|
|
wc.warehousing_record_form_id = #{warehousingRecordFormId}
|
|
<if test="opCode != null and opCode == 1">
|
|
and wc.total_quantity > wc.warehousing_quantity
|
|
</if>
|
|
<if test="opCode != null and opCode == -1">
|
|
and wc.warehousing_quantity = wc.total_quantity
|
|
</if>
|
|
<if test="keywords != null and keywords != ''">
|
|
and wc.reagent_consumable_name = #{keywords}
|
|
</if>
|
|
<if test="category != null and category != ''">
|
|
and rc.category = #{category}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getWarehousingContentVOPage" resultMap="warehousingContentVO"
|
|
resultType="digital.laboratory.platform.reagent.vo.WarehousingContentVO">
|
|
SELECT wc.*,
|
|
(select si.supplier_name from supplier_information si where si.id = wc.supplier_id) as supplier_name,
|
|
(select user.name from dlp_base.sys_user user
|
|
where user.user_id=wc.update_by ) as applicant_name
|
|
, (
|
|
select rc.category
|
|
from reagent_consumables rc
|
|
where rc.reagent_consumable_id = wc.reagent_consumable_id) AS category
|
|
, (
|
|
select rc.specification_and_model
|
|
from reagent_consumables rc
|
|
where rc.reagent_consumable_id = wc.reagent_consumable_id) AS specification_and_model
|
|
, (
|
|
select rc.brand
|
|
from reagent_consumables rc
|
|
where rc.reagent_consumable_id = wc.reagent_consumable_id) AS brand
|
|
, (
|
|
select rc.standard_value_or_purity
|
|
from reagent_consumables rc
|
|
where rc.reagent_consumable_id = wc.reagent_consumable_id) AS standard_value_or_purity
|
|
FROM warehousing_content wc
|
|
${ew.customSqlSegment}
|
|
</select>
|
|
</mapper> |