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/MedicationDoseInfoMapper.xml |  172 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 172 insertions(+), 0 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/MedicationDoseInfoMapper.xml b/smartor/src/main/resources/mapper/smartor/MedicationDoseInfoMapper.xml
new file mode 100644
index 0000000..b1d35d7
--- /dev/null
+++ b/smartor/src/main/resources/mapper/smartor/MedicationDoseInfoMapper.xml
@@ -0,0 +1,172 @@
+<?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.MedicationDoseInfoMapper">
+
+    <resultMap type="com.smartor.domain.MedicationDoseInfo" id="MedicationDoseInfoResult">
+            <result property="id" column="id"/>
+            <result property="medicationItemId" column="medication_item_id"/>
+            <result property="doseSmallPackageRation" column="dose_small_package_ration"/>
+            <result property="dose" column="dose"/>
+            <result property="doseSmallPackageNum" column="dose_small_package_num"/>
+            <result property="doseUnit" column="dose_unit"/>
+            <result property="doseUnitType" column="dose_unit_type"/>
+            <result property="remark" column="remark"/>
+            <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="selectMedicationDoseInfoVo">
+        select id, medication_item_id, dose_small_package_ration, dose, dose_small_package_num, dose_unit, dose_unit_type, remark, create_by, create_time, update_by, update_time
+        from medication_dose_info
+    </sql>
+
+    <select id="selectMedicationDoseInfoList" parameterType="com.smartor.domain.MedicationDoseInfo"
+            resultMap="MedicationDoseInfoResult">
+        <include refid="selectMedicationDoseInfoVo"/>
+        where 1=1
+            and del_flag=0
+                        <if test="medicationItemId != null ">
+                            and medication_item_id = #{medicationItemId}
+                        </if>
+                        <if test="doseSmallPackageRation != null ">
+                            and dose_small_package_ration = #{doseSmallPackageRation}
+                        </if>
+                        <if test="dose != null ">
+                            and dose = #{dose}
+                        </if>
+                        <if test="doseSmallPackageNum != null ">
+                            and dose_small_package_num = #{doseSmallPackageNum}
+                        </if>
+                        <if test="doseUnit != null  and doseUnit != ''">
+                            and dose_unit = #{doseUnit}
+                        </if>
+                        <if test="doseUnitType != null ">
+                            and dose_unit_type = #{doseUnitType}
+                        </if>
+    </select>
+
+    <select id="selectMedicationDoseInfoById" parameterType="Long"
+            resultMap="MedicationDoseInfoResult">
+            <include refid="selectMedicationDoseInfoVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertMedicationDoseInfo" parameterType="com.smartor.domain.MedicationDoseInfo"            useGeneratedKeys="true" keyProperty="id">
+        insert into medication_dose_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="medicationItemId != null">medication_item_id,
+                    </if>
+                    <if test="doseSmallPackageRation != null">dose_small_package_ration,
+                    </if>
+                    <if test="dose != null">dose,
+                    </if>
+                    <if test="doseSmallPackageNum != null">dose_small_package_num,
+                    </if>
+                    <if test="doseUnit != null">dose_unit,
+                    </if>
+                    <if test="doseUnitType != null">dose_unit_type,
+                    </if>
+                    <if test="remark != null">remark,
+                    </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="medicationItemId != null">#{medicationItemId},
+                    </if>
+                    <if test="doseSmallPackageRation != null">#{doseSmallPackageRation},
+                    </if>
+                    <if test="dose != null">#{dose},
+                    </if>
+                    <if test="doseSmallPackageNum != null">#{doseSmallPackageNum},
+                    </if>
+                    <if test="doseUnit != null">#{doseUnit},
+                    </if>
+                    <if test="doseUnitType != null">#{doseUnitType},
+                    </if>
+                    <if test="remark != null">#{remark},
+                    </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="updateMedicationDoseInfo" parameterType="com.smartor.domain.MedicationDoseInfo">
+        update medication_dose_info
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="medicationItemId != null">medication_item_id =
+                        #{medicationItemId},
+                    </if>
+                    <if test="doseSmallPackageRation != null">dose_small_package_ration =
+                        #{doseSmallPackageRation},
+                    </if>
+                    <if test="dose != null">dose =
+                        #{dose},
+                    </if>
+                    <if test="doseSmallPackageNum != null">dose_small_package_num =
+                        #{doseSmallPackageNum},
+                    </if>
+                    <if test="doseUnit != null">dose_unit =
+                        #{doseUnit},
+                    </if>
+                    <if test="doseUnitType != null">dose_unit_type =
+                        #{doseUnitType},
+                    </if>
+                    <if test="remark != null">remark =
+                        #{remark},
+                    </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="deleteMedicationDoseInfoById" parameterType="Long">
+        update medication_dose_info
+        <trim prefix="SET" suffixOverrides=",">
+            del_flag =1
+        </trim>
+        where  id = #{id}
+    </update>
+
+                            <update id="deleteMedicationDoseInfoByIds" parameterType="String">
+        update  medication_dose_info
+        <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