代码修改 项目定价修改

This commit is contained in:
Zhuangxingyu
2025-02-25 17:14:17 +08:00
parent 6a5e6eb4b9
commit 9f2067745f
4 changed files with 134 additions and 173 deletions

View File

@@ -1,84 +1,69 @@
<?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.web.datadictionary.mapper.ChargeItemDefSearchMapper">
<select id="getMedList" resultType="com.openhis.web.datadictionary.dto.ChargeItemDefPageDto">
SELECT
T5.id,
T5.charge_name,
T5.status_enum,
T5.description,
T5.effective_start,
T5.effective_end,
T5.instance_table,
T5.price,
T5.create_time,
T5.update_time,
T5.item_id,
T5.condition_rule_id,
T5.condition_lotnumber,
T5.condition_yb_code,
T5.priority,
T5.amount,
T5.item_no,
T5.py_str,
T5.wb_str,
T5.unit_code,
T5.category_code,
T5.total_volume,
T5.lot_number,
COUNT(1) OVER() AS TOTAL_COUNT
T5.id,
T5.charge_name,
T5.status_enum,
T5.description,
T5.effective_start,
T5.effective_end,
T5.instance_table,
T5.price,
T5.create_time,
T5.update_time,
T5.item_id,
T5.condition_rule_id,
T5.condition_lotnumber,
T5.condition_yb_code,
T5.priority,
T5.amount,
T5.item_no,
T5.py_str,
T5.wb_str,
T5.unit_code,
T5.category_code,
T5.part_percent,
T5.total_volume,
T5.lot_number
FROM (
SELECT
T1.id,
T1.charge_name,
T1.status_enum,
T1.description,
T1.effective_start,
T1.effective_end,
T1.instance_table,
T1.price,
T1.create_time,
T1.update_time,
T2.id AS item_id,
T2.condition_rule_id,
T2.condition_lotnumber,
T2.condition_yb_code,
T2.priority,
T2.amount,
T3.bus_no AS item_no,
T3.py_str,
T3.wb_str,
T3.unit_code,
T3.category_code,
T4.total_volume,
T4.lot_number
FROM
adm_charge_item_definition T1
LEFT JOIN adm_charge_item_def_app T2
ON T1.id = T2.definition_id
LEFT JOIN med_medication_definition T3
ON T1.instance_id = T3.id
LEFT JOIN med_medication T4
ON T3.id = T4.medication_def_id) T5
<where>
T5.instance_table = 'med_medication_definition'
<if test="searchKey != null">
AND T5.charge_name LIKE CONCAT('%', #{searchKey}, '%')
OR T5.item_no LIKE CONCAT('%', #{searchKey}, '%')
OR T5.py_str LIKE CONCAT('%', #{searchKey}, '%')
</if>
<if test="itemDefSearchParam.getChargeItem() != null">
AND T5.category_code = #{itemDefSearchParam.chargeItem}
</if>
</where>
ORDER BY T5.create_time DESC
<!-- 拼接页码 -->
<if test="skipCount != null and pageSize != null and pageSize > 0">
LIMIT #{pageSize} OFFSET #{skipCount}
</if>
SELECT
T1.id,
T1.charge_name,
T1.status_enum,
T1.description,
T1.effective_start,
T1.effective_end,
T1.instance_table,
T1.price,
T1.create_time,
T1.update_time,
T2.id AS item_id,
T2.condition_rule_id,
T2.condition_lotnumber,
T2.condition_yb_code,
T2.priority,
T2.amount,
T3.bus_no AS item_no,
T3.py_str,
T3.wb_str,
T3.unit_code,
T1.yb_type AS category_code,
T3.part_percent,
T4.total_volume,
T4.lot_number
FROM
adm_charge_item_definition T1
LEFT JOIN adm_charge_item_def_app T2
ON T1.id = T2.definition_id
LEFT JOIN med_medication_definition T3
ON T1.instance_id = T3.id
LEFT JOIN med_medication T4
ON T3.id = T4.medication_def_id
ORDER BY T1.create_time DESC) T5
${ew.customSqlSegment}
</select>
<select id="getDevList" resultType="com.openhis.web.datadictionary.dto.ChargeItemDefPageDto">
SELECT
T5.id,
@@ -102,8 +87,8 @@
T5.wb_str,
T5.unit_code,
T5.category_code,
T5.lot_number,
COUNT(1) OVER() AS TOTAL_COUNT
T5.part_percent,
T5.lot_number
FROM (
SELECT
T1.id,
@@ -126,7 +111,8 @@
T3.py_str,
T3.wb_str,
T3.unit_code AS unit_code,
T3.category_enum AS category_code,
T1.yb_type AS category_code,
T3.part_percent,
T4.lot_number
FROM
adm_charge_item_definition T1
@@ -135,25 +121,10 @@
LEFT JOIN adm_device_definition T3
ON T1.instance_id = T3.id
LEFT JOIN adm_device T4
ON T3.id = T4.device_def_id) T5
<where>
T5.instance_table = 'adm_device_definition'
<if test="searchKey != null">
AND T5.charge_name LIKE CONCAT('%', #{searchKey}, '%')
OR T5.item_no LIKE CONCAT('%', #{searchKey}, '%')
OR T5.py_str LIKE CONCAT('%', #{searchKey}, '%')
</if>
<if test="itemDefSearchParam.getChargeItem() != null">
AND T5.category_code = #{itemDefSearchParam.chargeItem}
</if>
</where>
ORDER BY T5.create_time DESC
<!-- 拼接页码 -->
<if test="skipCount != null and pageSize != null and pageSize > 0">
LIMIT #{pageSize} OFFSET #{skipCount}
</if>
ON T3.id = T4.device_def_id
ORDER BY T1.create_time DESC) T5
${ew.customSqlSegment}
</select>
<select id="getActList" resultType="com.openhis.web.datadictionary.dto.ChargeItemDefPageDto">
SELECT
T5.id,
@@ -176,8 +147,7 @@
T5.py_str,
T5.wb_str,
T5.unit_code,
T5.category_code,
COUNT(1) OVER() AS TOTAL_COUNT
T5.category_code
FROM (
SELECT
T1.id,
@@ -200,28 +170,14 @@
T3.py_str,
T3.wb_str,
T3.permitted_unit_code AS unit_code,
T3.type_enum AS category_code
T1.yb_type AS category_code
FROM
adm_charge_item_definition T1
LEFT JOIN adm_charge_item_def_app T2
ON T1.id = T2.definition_id
LEFT JOIN wor_activity_definition T3
ON T1.instance_id = T3.id) T5
<where>
T5.instance_table = 'wor_activity_definition'
<if test="searchKey != null">
AND T5.charge_name LIKE CONCAT('%', #{searchKey}, '%')
OR T5.item_no LIKE CONCAT('%', #{searchKey}, '%')
OR T5.py_str LIKE CONCAT('%', #{searchKey}, '%')
</if>
<if test="itemDefSearchParam.getChargeItem() != null">
AND T5.category_code = #{itemDefSearchParam.chargeItem}
</if>
</where>
ORDER BY T5.create_time DESC
<!-- 拼接页码 -->
<if test="skipCount != null and pageSize != null and pageSize > 0">
LIMIT #{pageSize} OFFSET #{skipCount}
</if>
ON T1.instance_id = T3.id
ORDER BY T1.create_time DESC) T5
${ew.customSqlSegment}
</select>
</mapper>