采购代码调整,退费代码增加
This commit is contained in:
@@ -8,23 +8,21 @@
|
||||
T2.bus_no AS supply_bus_no,
|
||||
T2.status_enum,
|
||||
T2.supplier_id,
|
||||
T2.purpose_location_id,
|
||||
T2.approver_id,
|
||||
T2.approval_time,
|
||||
T2.applicant_id,
|
||||
T2.apply_time,
|
||||
T2.purpose_location_id,
|
||||
T2.practitioner_id,
|
||||
T2.tenant_id
|
||||
FROM (SELECT T1.id,
|
||||
T1.bus_no,
|
||||
T1.status_enum,
|
||||
T1.supplier_id,
|
||||
T1.purpose_location_id,
|
||||
T1.approver_id,
|
||||
T1.approval_time,
|
||||
T1.applicant_id,
|
||||
T1.apply_time,
|
||||
T1.purpose_location_id,
|
||||
T1.practitioner_id,
|
||||
T1.tenant_id
|
||||
FROM wor_supply_request AS T1
|
||||
WHERE type_enum = #{purchaseInventory}
|
||||
@@ -32,15 +30,47 @@
|
||||
T1.bus_no,
|
||||
T1.status_enum,
|
||||
T1.supplier_id,
|
||||
T1.purpose_location_id,
|
||||
T1.approver_id,
|
||||
T1.approval_time,
|
||||
T1.applicant_id,
|
||||
T1.apply_time,
|
||||
T1.purpose_location_id,
|
||||
T1.practitioner_id,
|
||||
T1.tenant_id
|
||||
ORDER BY T1.bus_no desc
|
||||
) AS T2
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectDetail" resultType="com.openhis.web.inventorymanage.dto.ReceiptDetailDto">
|
||||
SELECT *
|
||||
FROM wor_supply_request T1
|
||||
LEFT JOIN med_medication_definition T2
|
||||
ON T1.item_id = T2.id
|
||||
LEFT JOIN med_medication T3
|
||||
ON T3.medication_def_id = T2.id
|
||||
LEFT JOIN adm_supplier T4
|
||||
ON T4.id = T1.supplier_id
|
||||
LEFT JOIN adm_practitioner T5
|
||||
ON T1.practitioner_id = T5.id
|
||||
LEFT JOIN adm_location T6
|
||||
ON T1.purpose_location_id = T6.id
|
||||
LEFT JOIN adm_location T7
|
||||
ON T1.purpose_location_store_id = T7.id
|
||||
WHERE T1.bus_no = #{busNo}
|
||||
AND T1.delete_flag = '0'
|
||||
UNION ALL
|
||||
SELECT *
|
||||
FROM wor_supply_request T1
|
||||
LEFT JOIN adm_device_definition T8
|
||||
ON T1.item_id = T8.id
|
||||
LEFT JOIN adm_supplier T4
|
||||
ON T4.id = T1.supplier_id
|
||||
LEFT JOIN adm_practitioner T5
|
||||
ON T1.practitioner_id = T5.id
|
||||
LEFT JOIN adm_location T6
|
||||
ON T1.purpose_location_id = T6.id
|
||||
LEFT JOIN adm_location T7
|
||||
ON T1.purpose_location_store_id = T7.id
|
||||
WHERE T1.bus_no = #{busNo}
|
||||
AND T1.delete_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -50,6 +50,7 @@
|
||||
T1.unit_price,
|
||||
T1.total_price,
|
||||
T1.prescription_no,
|
||||
T1.bus_no,
|
||||
T1.enterer_id,
|
||||
T1.entered_date,
|
||||
T1.account_id,
|
||||
@@ -72,7 +73,7 @@
|
||||
ON T1.context_enum = #{device}
|
||||
AND T1.product_id = T4.id
|
||||
WHERE T1.encounter_id = #{encounterId}
|
||||
AND T1.status_enum IN (1 , 2 , 5)
|
||||
AND T1.status_enum IN (#{planned} , #{billable} , #{billed})
|
||||
AND T1.delete_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -14,7 +14,6 @@
|
||||
T1.tendered_amount,
|
||||
T1.returned_amount,
|
||||
T1.contract_no,
|
||||
T1.charge_item_ids,
|
||||
T2.prescription_no,
|
||||
T2.account_id
|
||||
FROM fin_payment_reconciliation AS T1
|
||||
@@ -24,4 +23,48 @@
|
||||
AND T1.status_enum IN (#{success},#{refundAll},#{refundPart})
|
||||
AND T1.delete_flag = '0'
|
||||
</select>
|
||||
<select id="selectRefundItem" resultType="com.openhis.web.chargemanage.dto.RefundItemDto">
|
||||
SELECT T1.*,
|
||||
T2.name AS service_name
|
||||
FROM fin_payment_reconciliation AS T1
|
||||
LEFT JOIN adm_charge_item AS T2
|
||||
ON T2.id IN T1.charge_item_ids
|
||||
LEFT JOIN med_medication_request AS T3
|
||||
ON T3.bus_no = SUBSTRING(T2.bus_no, #{three})
|
||||
LEFT JOIN med_medication_dispense AS T4
|
||||
ON T4.med_req_id = T3.id
|
||||
WHERE T2.service_table = #{medMedicationRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="paymentIdList" item="paymentId" separator="," open="(" close=")">
|
||||
#{paymentId}
|
||||
</foreach>
|
||||
UNION ALL
|
||||
SELECT T1.*,
|
||||
T2.name AS service_name
|
||||
FROM fin_payment_reconciliation AS T1
|
||||
LEFT JOIN adm_charge_item AS T2
|
||||
ON T2.id IN T1.charge_item_ids
|
||||
LEFT JOIN wor_device_request AS T5
|
||||
ON T6.bus_no = SUBSTRING(T2.bus_no, #{three})
|
||||
LEFT JOIN wor_device_dispense AS T6
|
||||
ON T6.device_req_id = T5.id
|
||||
WHERE T2.service_table = #{worDeviceRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="paymentIdList" item="paymentId" separator="," open="(" close=")">
|
||||
#{paymentId}
|
||||
</foreach>
|
||||
UNION ALL
|
||||
SELECT T1.*,
|
||||
T2.name AS service_name
|
||||
FROM fin_payment_reconciliation AS T1
|
||||
LEFT JOIN adm_charge_item AS T2
|
||||
ON T2.id IN T1.charge_item_ids
|
||||
LEFT JOIN wor_service_request AS T7
|
||||
ON T7.bus_no = SUBSTRING(T2.bus_no, #{three})
|
||||
WHERE T2.service_table = #{worServiceRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="paymentIdList" item="paymentId" separator="," open="(" close=")">
|
||||
#{paymentId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user