From 27df1079c1d230fab29f565f5209f2a02e0def8a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 20 七月 2026 16:56:51 +0800
Subject: [PATCH] 省立同德的功能
---
smartor/src/main/resources/mapper/smartor/MedicationItemMapper.xml | 434 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 434 insertions(+), 0 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/MedicationItemMapper.xml b/smartor/src/main/resources/mapper/smartor/MedicationItemMapper.xml
new file mode 100644
index 0000000..e46d8ac
--- /dev/null
+++ b/smartor/src/main/resources/mapper/smartor/MedicationItemMapper.xml
@@ -0,0 +1,434 @@
+<?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.smartor.mapper.MedicationItemMapper">
+
+ <resultMap type="com.smartor.domain.MedicationItem" id="MedicationItemResult">
+ <result property="id" column="id"/>
+ <result property="identificationCode" column="identification_code"/>
+ <result property="wbm" column="wbm"/>
+ <result property="medicationCommonName" column="medication_common_name"/>
+ <result property="manufacturerName" column="manufacturer_name"/>
+ <result property="itemCode" column="item_code"/>
+ <result property="smallLargePackageRatio" column="small_large_package_ratio"/>
+ <result property="remark" column="remark"/>
+ <result property="orgId" column="org_id"/>
+ <result property="itemName" column="item_name"/>
+ <result property="medicationType" column="medication_type"/>
+ <result property="antimicrobialGradeCode" column="antimicrobial_grade_code"/>
+ <result property="licenseNumber" column="license_number"/>
+ <result property="defaultUsageName" column="default_usage_name"/>
+ <result property="specialDrugsName" column="special_drugs_name"/>
+ <result property="antimicrobialGradeName" column="antimicrobial_grade_name"/>
+ <result property="commonPinyin" column="common_pinyin"/>
+ <result property="commonWbm" column="common_wbm"/>
+ <result property="manufacturerId" column="manufacturer_id"/>
+ <result property="defaultUsageId" column="default_usage_id"/>
+ <result property="specification" column="specification"/>
+ <result property="smallPackageUnit" column="small_package_unit"/>
+ <result property="itemId" column="item_id"/>
+ <result property="specialDrugsCode" column="special_drugs_code"/>
+ <result property="pinyin" column="pinyin"/>
+ <result property="doseFormName" column="dose_form_name"/>
+ <result property="largePackageUnit" column="large_package_unit"/>
+ <result property="retailPrice" column="retail_price"/>
+ <result property="status" column="status"/>
+ <result property="createBy" column="create_by"/>
+ <result property="createTime" column="create_time"/>
+ <result property="updateBy" column="update_by"/>
+ <result property="updateTime" column="update_time"/>
+ </resultMap>
+
+ <sql id="selectMedicationItemVo">
+ select id,
+ identification_code,
+ wbm,
+ medication_common_name,
+ manufacturer_name,
+ item_code,
+ small_large_package_ratio,
+ remark,
+ org_id,
+ item_name,
+ medication_type,
+ antimicrobial_grade_code,
+ license_number,
+ default_usage_name,
+ special_drugs_name,
+ antimicrobial_grade_name,
+ common_pinyin,
+ common_wbm,
+ manufacturer_id,
+ default_usage_id,
+ specification,
+ small_package_unit,
+ item_id,
+ special_drugs_code,
+ pinyin,
+ dose_form_name,
+ large_package_unit,
+ retail_price,
+ status,
+ create_by,
+ create_time,
+ update_by,
+ update_time
+ from medication_item
+ </sql>
+
+ <select id="selectMedicationItemList" parameterType="com.smartor.domain.MedicationItem"
+ resultMap="MedicationItemResult">
+ <include refid="selectMedicationItemVo"/>
+ where 1=1
+ and del_flag=0
+ <if test="identificationCode != null and identificationCode != ''">
+ and identification_code = #{identificationCode}
+ </if>
+ <if test="wbm != null and wbm != ''">
+ and wbm = #{wbm}
+ </if>
+ <if test="medicationCommonName != null and medicationCommonName != ''">
+ and medication_common_name like concat('%', #{medicationCommonName}, '%')
+ </if>
+ <if test="manufacturerName != null and manufacturerName != ''">
+ and manufacturer_name like concat('%', #{manufacturerName}, '%')
+ </if>
+ <if test="itemCode != null and itemCode != ''">
+ and item_code = #{itemCode}
+ </if>
+ <if test="smallLargePackageRatio != null ">
+ and small_large_package_ratio = #{smallLargePackageRatio}
+ </if>
+ <if test="orgId != null ">
+ and org_id = #{orgId}
+ </if>
+ <if test="itemName != null and itemName != ''">
+ and item_name like concat('%', #{itemName}, '%')
+ </if>
+ <if test="medicationType != null and medicationType != ''">
+ and medication_type = #{medicationType}
+ </if>
+ <if test="antimicrobialGradeCode != null and antimicrobialGradeCode != ''">
+ and antimicrobial_grade_code = #{antimicrobialGradeCode}
+ </if>
+ <if test="licenseNumber != null and licenseNumber != ''">
+ and license_number = #{licenseNumber}
+ </if>
+ <if test="defaultUsageName != null and defaultUsageName != ''">
+ and default_usage_name like concat('%', #{defaultUsageName}, '%')
+ </if>
+ <if test="specialDrugsName != null and specialDrugsName != ''">
+ and special_drugs_name like concat('%', #{specialDrugsName}, '%')
+ </if>
+ <if test="antimicrobialGradeName != null and antimicrobialGradeName != ''">
+ and antimicrobial_grade_name like concat('%', #{antimicrobialGradeName}, '%')
+ </if>
+ <if test="commonPinyin != null and commonPinyin != ''">
+ and common_pinyin = #{commonPinyin}
+ </if>
+ <if test="commonWbm != null and commonWbm != ''">
+ and common_wbm = #{commonWbm}
+ </if>
+ <if test="manufacturerId != null ">
+ and manufacturer_id = #{manufacturerId}
+ </if>
+ <if test="defaultUsageId != null ">
+ and default_usage_id = #{defaultUsageId}
+ </if>
+ <if test="specification != null and specification != ''">
+ and specification = #{specification}
+ </if>
+ <if test="smallPackageUnit != null and smallPackageUnit != ''">
+ and small_package_unit = #{smallPackageUnit}
+ </if>
+ <if test="itemId != null ">
+ and item_id = #{itemId}
+ </if>
+ <if test="specialDrugsCode != null and specialDrugsCode != ''">
+ and special_drugs_code = #{specialDrugsCode}
+ </if>
+ <if test="pinyin != null and pinyin != ''">
+ and pinyin = #{pinyin}
+ </if>
+ <if test="doseFormName != null and doseFormName != ''">
+ and dose_form_name like concat('%', #{doseFormName}, '%')
+ </if>
+ <if test="largePackageUnit != null and largePackageUnit != ''">
+ and large_package_unit = #{largePackageUnit}
+ </if>
+ <if test="retailPrice != null ">
+ and retail_price = #{retailPrice}
+ </if>
+ <if test="status != null ">
+ and status = #{status}
+ </if>
+ </select>
+
+ <select id="selectMedicationItemById" parameterType="Long"
+ resultMap="MedicationItemResult">
+ <include refid="selectMedicationItemVo"/>
+ where id = #{id}
+ </select>
+
+ <insert id="insertMedicationItem" parameterType="com.smartor.domain.MedicationItem" useGeneratedKeys="true"
+ keyProperty="id">
+ insert into medication_item
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="identificationCode != null">identification_code,
+ </if>
+ <if test="wbm != null">wbm,
+ </if>
+ <if test="medicationCommonName != null">medication_common_name,
+ </if>
+ <if test="manufacturerName != null">manufacturer_name,
+ </if>
+ <if test="itemCode != null">item_code,
+ </if>
+ <if test="smallLargePackageRatio != null">small_large_package_ratio,
+ </if>
+ <if test="remark != null">remark,
+ </if>
+ <if test="orgId != null">org_id,
+ </if>
+ <if test="itemName != null">item_name,
+ </if>
+ <if test="medicationType != null">medication_type,
+ </if>
+ <if test="antimicrobialGradeCode != null">antimicrobial_grade_code,
+ </if>
+ <if test="licenseNumber != null">license_number,
+ </if>
+ <if test="defaultUsageName != null">default_usage_name,
+ </if>
+ <if test="specialDrugsName != null">special_drugs_name,
+ </if>
+ <if test="antimicrobialGradeName != null">antimicrobial_grade_name,
+ </if>
+ <if test="commonPinyin != null">common_pinyin,
+ </if>
+ <if test="commonWbm != null">common_wbm,
+ </if>
+ <if test="manufacturerId != null">manufacturer_id,
+ </if>
+ <if test="defaultUsageId != null">default_usage_id,
+ </if>
+ <if test="specification != null">specification,
+ </if>
+ <if test="smallPackageUnit != null">small_package_unit,
+ </if>
+ <if test="itemId != null">item_id,
+ </if>
+ <if test="specialDrugsCode != null">special_drugs_code,
+ </if>
+ <if test="pinyin != null">pinyin,
+ </if>
+ <if test="doseFormName != null">dose_form_name,
+ </if>
+ <if test="largePackageUnit != null">large_package_unit,
+ </if>
+ <if test="retailPrice != null">retail_price,
+ </if>
+ <if test="status != null">status,
+ </if>
+ <if test="createBy != null">create_by,
+ </if>
+ <if test="createTime != null">create_time,
+ </if>
+ <if test="updateBy != null">update_by,
+ </if>
+ <if test="updateTime != null">update_time,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="identificationCode != null">#{identificationCode},
+ </if>
+ <if test="wbm != null">#{wbm},
+ </if>
+ <if test="medicationCommonName != null">#{medicationCommonName},
+ </if>
+ <if test="manufacturerName != null">#{manufacturerName},
+ </if>
+ <if test="itemCode != null">#{itemCode},
+ </if>
+ <if test="smallLargePackageRatio != null">#{smallLargePackageRatio},
+ </if>
+ <if test="remark != null">#{remark},
+ </if>
+ <if test="orgId != null">#{orgId},
+ </if>
+ <if test="itemName != null">#{itemName},
+ </if>
+ <if test="medicationType != null">#{medicationType},
+ </if>
+ <if test="antimicrobialGradeCode != null">#{antimicrobialGradeCode},
+ </if>
+ <if test="licenseNumber != null">#{licenseNumber},
+ </if>
+ <if test="defaultUsageName != null">#{defaultUsageName},
+ </if>
+ <if test="specialDrugsName != null">#{specialDrugsName},
+ </if>
+ <if test="antimicrobialGradeName != null">#{antimicrobialGradeName},
+ </if>
+ <if test="commonPinyin != null">#{commonPinyin},
+ </if>
+ <if test="commonWbm != null">#{commonWbm},
+ </if>
+ <if test="manufacturerId != null">#{manufacturerId},
+ </if>
+ <if test="defaultUsageId != null">#{defaultUsageId},
+ </if>
+ <if test="specification != null">#{specification},
+ </if>
+ <if test="smallPackageUnit != null">#{smallPackageUnit},
+ </if>
+ <if test="itemId != null">#{itemId},
+ </if>
+ <if test="specialDrugsCode != null">#{specialDrugsCode},
+ </if>
+ <if test="pinyin != null">#{pinyin},
+ </if>
+ <if test="doseFormName != null">#{doseFormName},
+ </if>
+ <if test="largePackageUnit != null">#{largePackageUnit},
+ </if>
+ <if test="retailPrice != null">#{retailPrice},
+ </if>
+ <if test="status != null">#{status},
+ </if>
+ <if test="createBy != null">#{createBy},
+ </if>
+ <if test="createTime != null">#{createTime},
+ </if>
+ <if test="updateBy != null">#{updateBy},
+ </if>
+ <if test="updateTime != null">#{updateTime},
+ </if>
+ </trim>
+ </insert>
+
+ <update id="updateMedicationItem" parameterType="com.smartor.domain.MedicationItem">
+ update medication_item
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="identificationCode != null">identification_code =
+ #{identificationCode},
+ </if>
+ <if test="wbm != null">wbm =
+ #{wbm},
+ </if>
+ <if test="medicationCommonName != null">medication_common_name =
+ #{medicationCommonName},
+ </if>
+ <if test="manufacturerName != null">manufacturer_name =
+ #{manufacturerName},
+ </if>
+ <if test="itemCode != null">item_code =
+ #{itemCode},
+ </if>
+ <if test="smallLargePackageRatio != null">small_large_package_ratio =
+ #{smallLargePackageRatio},
+ </if>
+ <if test="remark != null">remark =
+ #{remark},
+ </if>
+ <if test="orgId != null">org_id =
+ #{orgId},
+ </if>
+ <if test="itemName != null">item_name =
+ #{itemName},
+ </if>
+ <if test="medicationType != null">medication_type =
+ #{medicationType},
+ </if>
+ <if test="antimicrobialGradeCode != null">antimicrobial_grade_code =
+ #{antimicrobialGradeCode},
+ </if>
+ <if test="licenseNumber != null">license_number =
+ #{licenseNumber},
+ </if>
+ <if test="defaultUsageName != null">default_usage_name =
+ #{defaultUsageName},
+ </if>
+ <if test="specialDrugsName != null">special_drugs_name =
+ #{specialDrugsName},
+ </if>
+ <if test="antimicrobialGradeName != null">antimicrobial_grade_name =
+ #{antimicrobialGradeName},
+ </if>
+ <if test="commonPinyin != null">common_pinyin =
+ #{commonPinyin},
+ </if>
+ <if test="commonWbm != null">common_wbm =
+ #{commonWbm},
+ </if>
+ <if test="manufacturerId != null">manufacturer_id =
+ #{manufacturerId},
+ </if>
+ <if test="defaultUsageId != null">default_usage_id =
+ #{defaultUsageId},
+ </if>
+ <if test="specification != null">specification =
+ #{specification},
+ </if>
+ <if test="smallPackageUnit != null">small_package_unit =
+ #{smallPackageUnit},
+ </if>
+ <if test="itemId != null">item_id =
+ #{itemId},
+ </if>
+ <if test="specialDrugsCode != null">special_drugs_code =
+ #{specialDrugsCode},
+ </if>
+ <if test="pinyin != null">pinyin =
+ #{pinyin},
+ </if>
+ <if test="doseFormName != null">dose_form_name =
+ #{doseFormName},
+ </if>
+ <if test="largePackageUnit != null">large_package_unit =
+ #{largePackageUnit},
+ </if>
+ <if test="retailPrice != null">retail_price =
+ #{retailPrice},
+ </if>
+ <if test="status != null">status =
+ #{status},
+ </if>
+ <if test="createBy != null">create_by =
+ #{createBy},
+ </if>
+ <if test="createTime != null">create_time =
+ #{createTime},
+ </if>
+ <if test="updateBy != null">update_by =
+ #{updateBy},
+ </if>
+ <if test="updateTime != null">update_time =
+ #{updateTime},
+ </if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <update id="deleteMedicationItemById" parameterType="Long">
+ update medication_item
+ <trim prefix="SET" suffixOverrides=",">
+ del_flag =1
+ </trim>
+ where id = #{id}
+ </update>
+
+ <update id="deleteMedicationItemByIds" parameterType="String">
+ update medication_item
+ <trim prefix="SET" suffixOverrides=",">
+ del_flag =1
+ </trim>
+ where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </update>
+
+
+</mapper>
--
Gitblit v1.9.3