Files
his/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/DeviceDefinitionMapper.xml
2025-12-10 14:20:24 +08:00

33 lines
1.8 KiB
XML
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.administration.mapper.DeviceDefinitionMapper">
<!-- 根据关键字查询 如果关键字为空查询10条否则返回查询到的所有 -->
<select id="searchDeviceListByKeyWord" resultType="com.openhis.medication.dto.AdjustPriceMedListDto">
select df.id as targetId, df.name as name, df.size as volume, details.amount as
originRetailPrice,def_details.amount as originBuyingPrice,df.bus_no as busNo,df.min_unit_code as unitCode
from adm_device_definition df
inner join adm_charge_item_definition actd on actd.instance_id = df.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 1 = 1 and df.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
(df.name like concat('%',#{keyWord},'%') or df.py_str like concat('%',#{keyWord},'%') or df.wb_str like
concat('%',#{keyWord},'%'))
</if>
</select>
</mapper>