采购代码调整,退费代码增加

This commit is contained in:
Zhang.WH
2025-03-19 09:22:15 +08:00
parent 615810461f
commit 2d0decb7e9
39 changed files with 615 additions and 233 deletions

View File

@@ -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>

View File

@@ -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>