Files
his/openhis-server-new/openhis-domain/src/main/resources/mapper/medication/MedicationMapper.xml
zhangfei 9c3e603b94 Fix Bug #443: 手术计费:点击签发耗材时异常报错
当手术计费弹窗中点击"签发"耗材时,因耗材的locationId(发放库房)为空导致后端异常。
在DoctorStationAdviceAppServiceImpl.handDevice方法中,当locationId为null时,使用登录用户的科室ID作为默认值,
与NurseBillingAppService中的处理方式保持一致。
2026-05-08 09:14:18 +08:00

74 lines
3.4 KiB
XML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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="com.openhis.medication.mapper.MedicationMapper">
<select id="selectDetailList" resultType="com.openhis.medication.domain.MedicationDetail">
SELECT T1.id,
T1.medication_product_id,
T1.status_enum,
T1.org_id,
T1.dose_form_code,
T1.total_volume,
T1.ingredient_item,
T1.active_flag,
T1.lot_number,
T1.effective_date,
T1.expiration_date,
T1.effective_date,
T1.method_code,
T1.rate_code,
T1.dose,
T1.dose_unit_code,
T1.max_unit,
T1.definition,
T2.code,
T2.name,
T2.domain_enum,
T2.name_en,
T2.py_code,
T2.wb_code,
T2.category_code,
T2.merchandise_name,
T2.merchandise_py_code,
T2.merchandise_wb_code,
T2.unit_code,
T2.min_unit_code,
T2.part_percent,
T2.dose_from
FROM med_medication AS T1
LEFT JOIN med_medication_definition AS T2
ON T1.medication_product_id = T2.id
WHERE T1.delete_flag = 0
</select>
<!-- 根据关键字查询 如果关键字为空查询10条否则返回查询到的所有 -->
<select id="searchMedListByKeyWord" resultType="com.openhis.medication.dto.AdjustPriceMedListDto">
select med_def.id as targetId, med_def.name as name, med.total_volume as volume, details.amount as
originRetailPrice,def_details.amount as originBuyingPrice,med_def.bus_no as busNo,med_def.min_unit_code as unitCode
from med_medication med
inner join med_medication_definition med_def on med.medication_def_id = med_def.id
inner join adm_charge_item_definition actd on actd.instance_id = med_def.id
left join adm_charge_item_def_detail details on actd.id = details.definition_id
and details.id = (select cidd.id from adm_charge_item_def_detail cidd where actd.id = cidd.definition_id and
cidd.condition_code = '5' and cidd.delete_flag = '0' ORDER BY create_time DESC
LIMIT 1)
left join adm_charge_item_def_detail def_details on actd.id = def_details.definition_id
and def_details.id = (select cidd.id from adm_charge_item_def_detail cidd where actd.id = cidd.definition_id and
cidd.condition_code = '1' and cidd.delete_flag = '0' ORDER BY create_time DESC
LIMIT 1)
WHERE med.delete_flag = '0' and med_def.id in (select inventoty.item_id FROM wor_inventory_item inventoty where
inventoty.quantity > 0 and inventoty.delete_flag = '0' )
<if test="keyWord == ''">
limit 10
</if>
<if test="keyWord !=''">
and
(med_def.name like concat('%',#{keyWord},'%') or med_def.merchandise_name like concat('%',#{keyWord},'%') or
med_def.py_str like concat('%',#{keyWord},'%') or
med_def.wb_str like concat('%',#{keyWord},'%') or med_def.merchandise_py_str like concat('%',#{keyWord},'%')
or med_def.merchandise_wb_str like concat('%',#{keyWord},'%'))
</if>
</select>
</mapper>