Files

112 lines
5.7 KiB
XML
Raw Permalink Normal View History

2025-07-28 14:58:32 +08:00
<?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.ruoyi.os.mapper.DrugFilingMapper">
<!-- 知无涯 -->
<resultMap type="DrugFiling" id="DrugFilingResult">
<id property="id" column="id"/>
<result property="archiveId" column="archive_id"/>
<result property="storeroomId" column="storeroom_id"/>
<result property="medicineCode" column="medicineCode"/>
<result property="batch" column="batch"/>
<result property="expiryDate" column="expiryDate"/>
<result property="boxCount" column="box_count"/>
<result property="inventoryUnit" column="inventoryUnit"/>
<result property="packCount" column="pack_count"/>
<result property="retailPrice" column="retail_price"/>
<result property="minPrice" column="min_price"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectDrugFilingVo">
select id, archive_id, storeroom_id, medicineCode, batch, expiryDate,
box_count, inventoryUnit, pack_count, retail_price, min_price,
create_by, create_time, update_by, update_time, remark
from healthcare_drug_filing
</sql>
<select id="selectDrugFilingList" parameterType="DrugFiling" resultMap="DrugFilingResult">
<include refid="selectDrugFilingVo"/>
<where>
<if test="archiveId != null">and archive_id = #{archiveId}</if>
<if test="storeroomId != null">and storeroom_id = #{storeroomId}</if>
<if test="medicineCode != null and medicineCode != ''">and medicineCode = #{medicineCode}</if>
<if test="batch != null and batch != ''">and batch like concat('%', #{batch}, '%')</if>
</where>
order by expiryDate asc
</select>
<select id="selectDrugFilingById" parameterType="Long" resultMap="DrugFilingResult">
<include refid="selectDrugFilingVo"/>
where id = #{id}
</select>
<insert id="insertDrugFiling" parameterType="DrugFiling" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_drug_filing
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="archiveId != null">archive_id,</if>
<if test="storeroomId != null">storeroom_id,</if>
<if test="medicineCode != null">medicineCode,</if>
<if test="batch != null">batch,</if>
<if test="expiryDate != null">expiryDate,</if>
<if test="boxCount != null">box_count,</if>
<if test="inventoryUnit != null">inventoryUnit,</if>
<if test="packCount != null">pack_count,</if>
<if test="retailPrice != null">retail_price,</if>
<if test="minPrice != null">min_price,</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>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="archiveId != null">#{archiveId},</if>
<if test="storeroomId != null">#{storeroomId},</if>
<if test="medicineCode != null">#{medicineCode},</if>
<if test="batch != null">#{batch},</if>
<if test="expiryDate != null">#{expiryDate},</if>
<if test="boxCount != null">#{boxCount},</if>
<if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="packCount != null">#{packCount},</if>
<if test="retailPrice != null">#{retailPrice},</if>
<if test="minPrice != null">#{minPrice},</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>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateDrugFiling" parameterType="DrugFiling">
update healthcare_drug_filing
<set>
<if test="archiveId != null">archive_id = #{archiveId},</if>
<if test="storeroomId != null">storeroom_id = #{storeroomId},</if>
<if test="medicineCode != null">medicineCode = #{medicineCode},</if>
<if test="batch != null">batch = #{batch},</if>
<if test="expiryDate != null">expiryDate = #{expiryDate},</if>
<if test="boxCount != null">box_count = #{boxCount},</if>
<if test="inventoryUnit != null">inventoryUnit = #{inventoryUnit},</if>
<if test="packCount != null">pack_count = #{packCount},</if>
<if test="retailPrice != null">retail_price = #{retailPrice},</if>
<if test="minPrice != null">min_price = #{minPrice},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</set>
where id = #{id}
</update>
<delete id="deleteDrugFilingById" parameterType="Long">
delete from healthcare_drug_filing where id = #{id}
</delete>
<delete id="deleteDrugFilingByArchiveId" parameterType="Long">
delete from healthcare_drug_filing where archive_id = #{archiveId}
</delete>
</mapper>