初始化

This commit is contained in:
2025-07-28 14:58:32 +08:00
commit fca0460190
566 changed files with 67468 additions and 0 deletions

View File

@@ -0,0 +1,279 @@
<?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.inventory.mapper.HealthcareDrugArchiveMapper">
<resultMap type="HealthcareDrugArchive" id="HealthcareDrugArchiveResult">
<result property="id" column="id" />
<result property="medicineName" column="medicine_name" />
<result property="manufacturer" column="manufacturer" />
<result property="barcode" column="barcode" />
<result property="specification" column="specification" />
<result property="retailPrice" column="retail_price" />
<result property="isSplit" column="is_split" />
<result property="minNumber" column="min_number"/>
<result property="state" column="state" />
<result property="dosageForm" column="dosage_form" />
<result property="dosageUnit" column="dosage_unit" />
<result property="volume" column="volume" />
<result property="volumeUnit" column="volume_unit" />
<result property="unitQuantity" column="unit_quantity" />
<result property="splitUnit" column="split_unit" />
<result property="packageUnit" column="package_unit" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHealthcareDrugArchiveVo">
select * from healthcare_drug_archive
</sql>
<select id="selectHealthcareDrugArchiveList" parameterType="HealthcareDrugArchive" resultMap="HealthcareDrugArchiveResult">
<include refid="selectHealthcareDrugArchiveVo"/>
<where>
<if test="medicineName != null and medicineName != ''">
medicine_name like concat('%', #{medicineName}, '%')
</if>
<if test="barcode != null and barcode != ''">
<if test="medicineName != null and medicineName != ''">
OR
</if>
barcode like concat('%', #{barcode}, '%')
</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectHealthcareDrugArchiveById" parameterType="Long" resultMap="HealthcareDrugArchiveResult">
<include refid="selectHealthcareDrugArchiveVo"/>
where id = #{id}
</select>
<select id="selectHealthcareDrugArchiveByBarcode" parameterType="String" resultMap="HealthcareDrugArchiveResult">
<include refid="selectHealthcareDrugArchiveVo"/>
where barcode = #{barcode}
</select>
<insert id="insertHealthcareDrugArchive" parameterType="HealthcareDrugArchive" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_drug_archive
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="medicineName != null and medicineName != ''">medicine_name,</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
<if test="barcode != null and barcode != ''">barcode,</if>
<if test="specification != null and specification != ''">specification,</if>
<if test="retailPrice != null">retail_price,</if>
<if test="isSplit != null">is_split,</if>
<if test="minNumber !=null">min_number,</if>
<if test="state != null">state,</if>
<if test="dosageForm != null">dosage_form,</if>
<if test="dosageUnit != null">dosage_unit,</if>
<if test="volume != null">volume,</if>
<if test="volumeUnit != null">volume_unit,</if>
<if test="unitQuantity != null">unit_quantity,</if>
<if test="splitUnit != null">split_unit,</if>
<if test="packageUnit != null">package_unit,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</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="medicineName != null and medicineName != ''">#{medicineName},</if>
<if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
<if test="barcode != null and barcode != ''">#{barcode},</if>
<if test="specification != null and specification != ''">#{specification},</if>
<if test="retailPrice != null">#{retailPrice},</if>
<if test="isSplit != null">#{isSplit},</if>
<if test="minNumber !=null">#{minNumber},</if>
<if test="state != null">#{state},</if>
<if test="dosageForm != null">#{dosageForm},</if>
<if test="dosageUnit != null">#{dosageUnit},</if>
<if test="volume != null">#{volume},</if>
<if test="volumeUnit != null">#{volumeUnit},</if>
<if test="unitQuantity != null">#{unitQuantity},</if>
<if test="splitUnit != null">#{splitUnit},</if>
<if test="packageUnit != null">#{packageUnit},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHealthcareDrugArchive" parameterType="HealthcareDrugArchive">
update healthcare_drug_archive
<trim prefix="SET" suffixOverrides=",">
<if test="medicineName != null and medicineName != ''">medicine_name = #{medicineName},</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
<if test="barcode != null and barcode != ''">barcode = #{barcode},</if>
<if test="specification != null and specification != ''">specification = #{specification},</if>
<if test="retailPrice != null">retail_price = #{retailPrice},</if>
<if test="isSplit != null">is_split = #{isSplit},</if>
<if test="minNumber != null">min_number = #{minNumber},</if>
<if test="state != null">state = #{state},</if>
<if test="dosageForm != null">dosage_form = #{dosageForm},</if>
<if test="dosageUnit != null">dosage_unit = #{dosageUnit},</if>
<if test="volume != null">volume = #{volume},</if>
<if test="volumeUnit != null">volume_unit = #{volumeUnit},</if>
<if test="unitQuantity != null">unit_quantity = #{unitQuantity},</if>
<if test="splitUnit != null">split_unit = #{splitUnit},</if>
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthcareDrugArchiveById" parameterType="Long">
delete from healthcare_drug_archive where id = #{id}
</delete>
<delete id="deleteHealthcareDrugArchiveByIds" parameterType="String">
delete from healthcare_drug_archive where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertHealthcareDrugArchives" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_drug_archive (
medicine_name,
manufacturer,
barcode,
specification,
retail_price,
is_split,
min_number,
state,
dosage_form,
dosage_unit,
volume,
volume_unit,
unit_quantity,
split_unit,
package_unit,
create_time,
create_by,
update_by,
update_time,
remark
) values
<foreach collection="list" item="item" separator=",">
(
#{item.medicineName},
#{item.manufacturer},
#{item.barcode},
#{item.specification},
#{item.retailPrice},
#{item.isSplit},
#{item.minNumber},
#{item.state},
#{item.dosageForm},
#{item.dosageUnit},
#{item.volume},
#{item.volumeUnit},
#{item.unitQuantity},
#{item.splitUnit},
#{item.packageUnit},
#{item.createTime},
#{item.createBy},
#{item.updateBy},
#{item.updateTime},
#{item.remark}
)
</foreach>
</insert>
<select id="selectcountMedicine" resultType="int">
SELECT SUM(box_count)
FROM healthcare_drug_filing
<where>
<if test="startDate != null and endDate != null">
AND CAST(create_time AS DATE) BETWEEN #{startDate} AND #{endDate}
</if>
</where>
</select>
<select id="selectHealthcareDrugArchiveAdevntList" parameterType="HealthcareDrugArchive" resultMap="HealthcareDrugArchiveResult">
SELECT
a.id,
a.medicine_name,
a.manufacturer,
a.barcode,
a.specification,
a.retail_price,
a.is_split,
a.state,
a.dosage_form,
a.dosage_unit,
a.volume,
a.volume_unit,
a.unit_quantity,
a.split_unit,
a.package_unit,
a.create_time,
a.create_by,
a.update_by,
a.update_time,
a.remark,
a.min_number,
MIN(f.expiryDate) AS expiryDate
FROM
healthcare_drug_archive a
LEFT JOIN
healthcare_drug_filing f ON a.id = f.archive_id
WHERE
f.expiryDate &lt; DATE_ADD(CURDATE(), INTERVAL 1 MONTH)
GROUP BY
a.id
ORDER BY
a.create_time DESC
</select>
<!-- 查询库存数量低于10的药品 -->
<select id="selectHealthcareDrugArchiveAertsList" parameterType="HealthcareDrugArchive" resultMap="HealthcareDrugArchiveResult">
SELECT
a.id,
a.medicine_name,
a.manufacturer,
a.barcode,
a.specification,
a.retail_price,
a.is_split,
a.state,
a.dosage_form,
a.dosage_unit,
a.volume,
a.volume_unit,
a.unit_quantity,
a.split_unit,
a.package_unit,
a.create_time,
a.create_by,
a.update_by,
a.update_time,
a.remark,
a.min_number,
SUM(f.box_count) AS total_inventory
FROM
healthcare_drug_archive a
LEFT JOIN
healthcare_drug_filing f ON a.id = f.archive_id
GROUP BY
a.id
HAVING
total_inventory &lt; 10
ORDER BY
a.create_time DESC
</select>
</mapper>

View File

@@ -0,0 +1,246 @@
<?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.inventory.mapper.HealthcareDrugFilingMapper">
<resultMap type="HealthcareDrugFiling" id="HealthcareDrugFilingResult">
<result 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="minNumber" column="min_number" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHealthcareDrugFilingVo">
select * from healthcare_drug_filing
</sql>
<select id="selectHealthcareDrugFilingList" parameterType="HealthcareDrugFiling" resultMap="HealthcareDrugFilingResult">
<include refid="selectHealthcareDrugFilingVo"/>
<where>
<if test="archiveId != null and archiveId != '0' "> and archive_id = #{archiveId}</if>
<if test="storeroomid != null and storeroomid != '0' "> and storeroom_id = #{storeroomid}</if>
<if test="medicineCode != null and medicineCode != ''"> and medicine_code = #{medicineCode}</if>
<if test="batch != null and batch != ''"> and batch = #{batch}</if>
<if test="expiryDate != null "> and expiry_date = #{expiryDate,jdbcType=DATE}</if>
<if test="boxCount != null "> and box_count = #{boxCount}</if>
<if test="inventoryUnit != null "> and inventoryUnit = #{inventoryUnit}</if>
<if test="packCount != null "> and pack_count = #{packCount}</if>
<if test="retailPrice != null "> and retail_price = #{retailPrice}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectHealthcareDrugFilingById" parameterType="Long" resultMap="HealthcareDrugFilingResult">
<include refid="selectHealthcareDrugFilingVo"/>
where id = #{id}
</select>
<select id="selectHealthcareDrugFilingByArchiveId" parameterType="Long" resultMap="HealthcareDrugFilingResult" resultType="com.ruoyi.inventory.domain.HealthcareDrugFiling">
<include refid="selectHealthcareDrugFilingVo"/>
WHERE archive_id = #{archiveId}
</select>
<select id="selectHealthcareDrugFilingByArchiveBatch" parameterType="map" resultMap="HealthcareDrugFilingResult">
SELECT *
FROM healthcare_drug_filing
WHERE batch = #{batch}
</select>
<insert id="insertHealthcareDrugFiling" parameterType="HealthcareDrugFiling" 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 and medicineCode != ''">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="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</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 and medicineCode != ''">#{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="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHealthcareDrugFiling" parameterType="HealthcareDrugFiling">
update healthcare_drug_filing
<trim prefix="SET" suffixOverrides=",">
<if test="archiveId != null">archive_id = #{archiveId},</if>
<if test="storeroomId != null">storeroom_id = #{storeroomId},</if>
<if test="medicineCode != null and medicineCode != ''">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="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthcareDrugFilingById" parameterType="Long">
delete from healthcare_drug_filing where id = #{id}
</delete>
<delete id="deleteHealthcareDrugFilingByIds" parameterType="String">
delete from healthcare_drug_filing where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertHealthcareDrugFilings" parameterType="java.util.List">
INSERT INTO healthcare_drug_filing (
archive_id,
storeroom_id,
medicineCode,
batch,
expiryDate,
box_count,
pack_count,
retail_price,
min_price
create_time,
create_by,
update_by,
update_time,
remark
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.archiveId},
#{item.storeroomId},
#{item.medicineCode},
#{item.batch},
#{item.expiryDate},
#{item.boxCount},
#{item.inventoryUnit},
#{item.packCount},
#{item.retailPrice},
#{item.minPrice},
#{item.createTime},
#{item.createBy},
#{item.updateBy},
#{item.updateTime},
#{item.remark}
)
</foreach>
</insert>
<delete id="deleteHealthcareDrugArchiveByIds" parameterType="String">
delete from healthcare_drug_filing where archive_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="findByBatchAndStoreroomId" resultType="com.ruoyi.inventory.domain.HealthcareDrugFiling" parameterType="HealthcareDrugFiling">
select * from healthcare_drug_filing where batch = #{batch} and storeroom_id = #{storeroomId}
</select>
<select id="selectHealthcareDrugFilingByIdAndStoreroom" resultType="com.ruoyi.inventory.domain.HealthcareDrugFiling" resultMap="HealthcareDrugFilingResult">
select * from healthcare_drug_filing where batch = #{batch} and storeroom_id = #{storeroomId} and archive_id = #{archiveId}
</select>
<select id="selectHealthcareDrugFilingByBarcodeAndBatch" resultType="com.ruoyi.inventory.domain.HealthcareDrugFiling" resultMap="HealthcareDrugFilingResult">
SELECT DISTINCT f.* <!-- 使用DISTINCT避免由于JOIN产生的重复记录 -->
FROM healthcare_drug_filing f
JOIN healthcare_drug_archive a ON f.archive_id = a.id
LEFT JOIN healthcare_inventory_storeroom s ON f.remark = s.storeroom_name <!-- 加入库房信息表的JOIN -->
WHERE 1 = 1
<if test="batch != null and batch != ''">
AND f.batch = #{batch}
</if>
<if test="barcode != null and barcode != ''">
AND a.barcode = #{barcode}
</if>
<if test="storeroomName != null and storeroomName != ''">
AND s.storeroom_name = #{storeroomName}
</if>
<if test="storeroomId != null and storeroomId != ''">
AND s.id = #{storeroomId}
</if>
</select>
<select id="selectcountAmount" resultType="int">
SELECT SUM(retail_price) AS totalAmount
FROM healthcare_drug_filing
<where>
<if test="startDate != null and endDate != null">
AND CAST(create_time AS DATE) BETWEEN #{startDate} AND #{endDate}
</if>
</where>
</select>
<select id="selectcountAdvent" resultType="java.lang.Integer">
SELECT SUM(box_count) AS expired_count
FROM healthcare_drug_filing
<where>
<if test="startDate != null and endDate != null">
expiryDate &lt;= #{startDate} AND expiryDate &lt; DATE_ADD(#{endDate}, INTERVAL 1 MONTH)
</if>
<if test="startDate == null and endDate == null">
expiryDate &lt; DATE_ADD(CURDATE(), INTERVAL 1 MONTH)
</if>
</where>
</select>
<select id="selectcountAlerts" parameterType="map" resultType="int">
SELECT COUNT(*) AS count_less_than_10
FROM (
SELECT ha.id
FROM healthcare_drug_archive ha
JOIN healthcare_drug_filing hdf ON ha.id = hdf.archive_id
<where>
<if test="startDate != null and endDate != null">
AND hdf.create_time BETWEEN #{startDate} AND #{endDate}
</if>
</where>
GROUP BY ha.id
HAVING SUM(hdf.box_count) &lt; 10
) subquery
</select>
</mapper>

View File

@@ -0,0 +1,247 @@
<?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.inventory.mapper.HealthcareInventoryDrugentryMapper">
<resultMap type="HealthcareInventoryDrugentry" id="HealthcareInventoryDrugentryResult">
<result property="id" column="id" />
<result property="orderNumber" column="order_number" />
<result property="status" column="status" />
<result property="type" column="type" />
<result property="variety" column="variety" />
<result property="tatolquantity" column="tatolquantity" />
<result property="amount" column="amount" />
<result property="entryPerson" column="entry_person" />
<result property="entryTime" column="entry_time" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<resultMap id="HealthcareInventoryDrugentryHealthcareInventoryDrugentryDetailsResult" type="com.ruoyi.inventory.domain.HealthcareInventoryDrugentry">
<id property="id" column="entry_id"/>
<result property="orderNumber" column="order_number"/>
<result property="status" column="status"/>
<result property="type" column="type"/>
<result property="variety" column="variety"/>
<result property="tatolquantity" column="tatolquantity"/>
<result property="amount" column="amount"/>
<result property="entryPerson" column="entry_person"/>
<result property="entryTime" column="entry_time"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<collection property="healthcareInventoryDrugentryDetailsList" ofType="com.ruoyi.inventory.domain.HealthcareInventoryDrugentryDetails">
<id property="id" column="detail_id"/>
<result property="entryRecordId" column="entry_record_id"/>
<result property="drugArchiveId" column="drug_archive_id"/>
<result property="drugFilingId" column="drug_filing_id"/>
<result property="storeroomId" column="storeroom_id"/>
<result property="medicineName" column="medicine_name"/>
<result property="barcode" column="barcode"/>
<result property="manufacturer" column="manufacturer"/>
<result property="batch" column="batch"/>
<result property="quantity" column="quantity"/>
<result property="price" column="price"/>
<result property="detailAmount" column="detail_amount" />
<result property="expiryDate" column="expiry_date"/>
<!-- 其他字段映射 -->
</collection>
</resultMap>
<resultMap type="HealthcareInventoryDrugentryDetails" id="HealthcareInventoryDrugentryDetailsResult">
<result property="id" column="id" />
<result property="entryRecordId" column="entry_record_id" />
<result property="drugArchiveId" column="drug_archive_id" />
<result property="drugFilingId" column="drug_filing_id" />
<result property="storeroomId" column="storeroom_id" />
<result property="price" column="price" />
<result property="batch" column="batch"/>
<result property="detailAmount" column="detail_amount"/>
<result property="quantity" column="quantity" />
<result property="expiryDate" column="expiry_date" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHealthcareInventoryDrugentryVo">
select * from healthcare_inventory_drugentry
</sql>
<select id="selectHealthcareInventoryDrugentryList" parameterType="HealthcareInventoryDrugentry" resultMap="HealthcareInventoryDrugentryResult">
<include refid="selectHealthcareInventoryDrugentryVo"/>
<where>
<if test="status != null "> and status = #{status}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectHealthcareInventoryDrugentryById" parameterType="Long" resultMap="HealthcareInventoryDrugentryHealthcareInventoryDrugentryDetailsResult">
SELECT
e.id AS entry_id,
e.order_number,
e.status,
e.type,
e.variety,
e.tatolquantity,
e.amount,
e.entry_point,
e.entry_person,
e.entry_time,
e.create_time,
e.create_by,
e.update_by,
e.update_time,
e.remark,
d.id AS id,
d.entry_record_id,
d.drug_archive_id,
d.drug_filing_id,
d.storeroom_id,
a.medicine_name,
a.barcode,
a.manufacturer,
d.batch,
d.quantity AS quantity,
d.detail_amount,
d.price,
d.expiry_date
FROM
healthcare_inventory_drugentry e
LEFT JOIN
healthcare_inventory_drugentry_details d ON e.id = d.entry_record_id
LEFT JOIN
healthcare_drug_archive a ON d.drug_archive_id = a.id
WHERE
e.id = #{id}
</select>
<!-- <select id="selectHealthcareInventoryDrugentryDetailsList" resultMap="HealthcareInventoryDrugentryDetailsResult">-->
<!-- select id, entry_record_id, drug_archive_id,batch, price, quantity, amount, expiry_date, create_time, create_by, update_by, update_time, remark-->
<!-- from healthcare_inventory_drugentry_details-->
<!-- where entry_record_id = #{entry_record_id}-->
<!-- </select>-->
<insert id="insertHealthcareInventoryDrugentry" parameterType="HealthcareInventoryDrugentry" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_inventory_drugentry
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNumber != null">order_number,</if>
<if test="status != null">status,</if>
<if test="type != null and type != ''">type,</if>
<if test="variety != null">variety,</if>
<if test="tatolquantity != null">tatolquantity,</if>
<if test="amount != null">amount,</if>
<if test="entryPerson != null">entry_person,</if>
<if test="entryTime != null">entry_time,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</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="orderNumber != null">#{orderNumber},</if>
<if test="status != null">#{status},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="variety != null">#{variety},</if>
<if test="tatolquantity != null">#{tatolquantity},</if>
<if test="amount != null">#{amount},</if>
<if test="entryPerson != null">#{entryPerson},</if>
<if test="entryTime != null">#{entryTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHealthcareInventoryDrugentry" parameterType="HealthcareInventoryDrugentry">
update healthcare_inventory_drugentry
<trim prefix="SET" suffixOverrides=",">
<if test="orderNumber != null">order_number = #{orderNumber},</if>
<if test="status != null">status = #{status},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="variety != null">variety = #{variety},</if>
<if test="tatolquantity != null">tatolquantity = #{tatolquantity},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="entryPerson != null">entry_person = #{entryPerson},</if>
<if test="entryTime != null">entry_time = #{entryTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthcareInventoryDrugentryById" parameterType="Long">
delete from healthcare_inventory_drugentry where id = #{id}
</delete>
<delete id="deleteHealthcareInventoryDrugentryByIds" parameterType="String">
delete from healthcare_inventory_drugentry where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteHealthcareInventoryDrugentryDetailsByEntryRecordIds" parameterType="String">
delete from healthcare_inventory_drugentry_details where entry_record_id in
<foreach item="entryRecordId" collection="array" open="(" separator="," close=")">
#{entryRecordId}
</foreach>
</delete>
<delete id="deleteHealthcareInventoryDrugentryDetailsByEntryRecordId" parameterType="Long">
delete from healthcare_inventory_drugentry_details where entry_record_id = #{entryRecordId}
</delete>
<insert id="batchHealthcareInventoryDrugentryDetails" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_inventory_drugentry_details
(entry_record_id, drug_archive_id,drug_filing_id, storeroom_id,batch, price, quantity, detail_amount, expiry_date, create_time, create_by, update_by, update_time, remark)
values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.entryRecordId, jdbcType=INTEGER},
#{item.drugArchiveId, jdbcType=INTEGER},
#{item.drugFilingId, jdbcType=INTEGER},
#{item.storeroomId, jdbcType=INTEGER},
#{item.batch, jdbcType=VARCHAR},
#{item.price, jdbcType=DECIMAL},
#{item.quantity, jdbcType=INTEGER},
#{item.detailAmount, jdbcType=DECIMAL},
<if test="item.expiryDate != null">
#{item.expiryDate, jdbcType=TIMESTAMP},
</if>
<if test="item.expiryDate == null">
NULL,
</if>
#{item.createTime, jdbcType=TIMESTAMP},
#{item.createBy, jdbcType=VARCHAR},
#{item.updateBy, jdbcType=VARCHAR},
#{item.updateTime, jdbcType=TIMESTAMP},
<if test="item.remark != null">
#{item.remark, jdbcType=VARCHAR}
</if>
<if test="item.remark == null">
NULL
</if>
)
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,190 @@
<?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.inventory.mapper.HealthcareInventoryDrugoutMapper">
<resultMap type="HealthcareInventoryDrugout" id="HealthcareInventoryDrugoutResult">
<result property="id" column="id" />
<result property="outCode" column="out_code" />
<result property="outStatus" column="out_status" />
<result property="outType" column="out_type" />
<result property="variety" column="variety" />
<result property="outQuantity" column="out_quantity" />
<result property="affiliation" column="affiliation" />
<result property="outPoint" column="out_Point" />
<result property="outPerson" column="out_Person" />
<result property="outTime" column="out_Time" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<resultMap id="HealthcareInventoryDrugoutHealthcareInventoryDrugoutDetailsResult" type="HealthcareInventoryDrugout" extends="HealthcareInventoryDrugoutResult">
<collection property="healthcareInventoryDrugoutDetailsList" ofType="HealthcareInventoryDrugoutDetails" column="id" select="selectHealthcareInventoryDrugoutDetailsList" />
</resultMap>
<resultMap type="HealthcareInventoryDrugoutDetails" id="HealthcareInventoryDrugoutDetailsResult">
<result property="id" column="id" />
<result property="drugOutId" column="drug_out_id" />
<result property="drugId" column="drug_id" />
<result property="filingId" column="filing_id"/>
<result property="outPointId" column="out_point_id"/>
<result property="unit" column="unit" />
<result property="expiryDate" column="expiry_date"/>
<result property="outBatch" column="out_batch"/>
<result property="remainingQuantity" column="remainingQuantity"/>
<result property="quantity" column="quantity" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHealthcareInventoryDrugoutVo">
select id, out_code, out_status, out_type, variety, out_quantity, affiliation, out_Point, out_Person, out_Time, create_time, create_by, update_by, update_time, remark from healthcare_inventory_drugout
</sql>
<select id="selectHealthcareInventoryDrugoutList" parameterType="HealthcareInventoryDrugout" resultMap="HealthcareInventoryDrugoutResult">
<include refid="selectHealthcareInventoryDrugoutVo"/>
<where>
<if test="outStatus != null "> and out_status = #{outStatus}</if>
<if test="variety != null and variety != ''"> and variety = #{variety}</if>
<if test="outTime != null "> and out_Time = #{outTime}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectHealthcareInventoryDrugoutById" parameterType="Long" resultMap="HealthcareInventoryDrugoutHealthcareInventoryDrugoutDetailsResult">
select id, out_code, out_status, out_type, variety, out_quantity, affiliation, out_Point, out_Person, out_Time, create_time, create_by, update_by, update_time, remark
from healthcare_inventory_drugout
where id = #{id}
</select>
<select id="selectHealthcareInventoryDrugoutDetailsList" resultMap="HealthcareInventoryDrugoutDetailsResult">
select id, drug_out_id, drug_id, filing_id, out_point_id,unit,expiry_date, out_batch,remainingQuantity,quantity, create_time, create_by, update_by, update_time, remark
from healthcare_inventory_drugout_details
where drug_out_id = #{drug_out_id}
</select>
<insert id="insertHealthcareInventoryDrugout" parameterType="HealthcareInventoryDrugout" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_inventory_drugout
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outCode != null">out_code,</if>
<if test="outStatus != null">out_status,</if>
<if test="outType != null">out_type,</if>
<if test="variety != null and variety != ''">variety,</if>
<if test="outQuantity != null">out_quantity,</if>
<if test="affiliation != null and affiliation != ''">affiliation,</if>
<if test="outPoint != null and outPoint != ''">out_Point,</if>
<if test="outPerson != null and outPerson != ''">out_Person,</if>
<if test="outTime != null">out_Time,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</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="outCode != null">#{outCode},</if>
<if test="outStatus != null">#{outStatus},</if>
<if test="outType != null">#{outType},</if>
<if test="variety != null and variety != ''">#{variety},</if>
<if test="outQuantity != null">#{outQuantity},</if>
<if test="affiliation != null and affiliation != ''">#{affiliation},</if>
<if test="outPoint != null and outPoint != ''">#{outPoint},</if>
<if test="outPerson != null and outPerson != ''">#{outPerson},</if>
<if test="outTime != null">#{outTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHealthcareInventoryDrugout" parameterType="HealthcareInventoryDrugout">
update healthcare_inventory_drugout
<trim prefix="SET" suffixOverrides=",">
<if test="outCode != null">out_code = #{outCode},</if>
<if test="outStatus != null">out_status = #{outStatus},</if>
<if test="outType != null">out_type = #{outType},</if>
<if test="variety != null and variety != ''">variety = #{variety},</if>
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
<if test="affiliation != null and affiliation != ''">affiliation = #{affiliation},</if>
<if test="outPoint != null and outPoint != ''">out_Point = #{outPoint},</if>
<if test="outPerson != null and outPerson != ''">out_Person = #{outPerson},</if>
<if test="outTime != null">out_Time = #{outTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthcareInventoryDrugoutById" parameterType="Long">
delete from healthcare_inventory_drugout where id = #{id}
</delete>
<delete id="deleteHealthcareInventoryDrugoutByIds" parameterType="String">
delete from healthcare_inventory_drugout where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteHealthcareInventoryDrugoutDetailsByDrugOutIds" parameterType="String">
delete from healthcare_inventory_drugout_details where drug_out_id in
<foreach item="drugOutId" collection="array" open="(" separator="," close=")">
#{drugOutId}
</foreach>
</delete>
<delete id="deleteHealthcareInventoryDrugoutDetailsByDrugOutId" parameterType="Long">
delete from healthcare_inventory_drugout_details where drug_out_id = #{drugOutId}
</delete>
<insert id="batchHealthcareInventoryDrugoutDetails">
insert into healthcare_inventory_drugout_details(
id,
drug_out_id,
drug_id,
filing_id,
out_point_id,
expiry_date,
out_batch,
remainingQuantity,
unit,
quantity,
create_time,
create_by,
update_by,
update_time,
remark
) values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.id},
#{item.drugOutId},
#{item.drugId},
#{item.filingId},
#{item.outPointId},
#{item.expiryDate},
#{item.outBatch},
#{item.remainingQuantity},
#{item.unit},
#{item.quantity},
#{item.createTime},
#{item.createBy},
#{item.updateBy},
#{item.updateTime},
#{item.remark}
)
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,135 @@
<?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.inventory.mapper.HealthcareInventoryDrugoutTypeMapper">
<resultMap type="HealthcareInventoryDrugoutType" id="HealthcareInventoryDrugoutTypeResult">
<result property="outTypeId" column="out_type_id" />
<result property="drugOutId" column="drug_out_id" />
<result property="inboundLocation" column="inbound_location" />
<result property="signee" column="signee" />
<result property="proofMaterial" column="proof_material" />
<result property="purposeDetails" column="purpose_details" />
<result property="unit" column="unit" />
<result property="expirationDate" column="expiration_date" />
<result property="currentDatetime" column="current_datetime" />
<result property="destroyer" column="destroyer" />
<result property="destructionLocation" column="destruction_location" />
<result property="destructionProcess" column="destruction_process" />
<result property="scrapReason" column="scrap_reason" />
<result property="disposalMethod" column="disposal_method" />
<result property="damageReason" column="damage_reason" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHealthcareInventoryDrugoutTypeVo">
select out_type_id, drug_out_id, inbound_location, signee, proof_material, purpose_details, unit, expiration_date, current_datetime, destroyer, destruction_location, destruction_process, scrap_reason, disposal_method, damage_reason, create_time, create_by, update_by, update_time, remark from healthcare_inventory_drugout_type
</sql>
<select id="selectHealthcareInventoryDrugoutTypeList" parameterType="HealthcareInventoryDrugoutType" resultMap="HealthcareInventoryDrugoutTypeResult">
<include refid="selectHealthcareInventoryDrugoutTypeVo"/>
<where>
</where>
</select>
<select id="selectHealthcareInventoryDrugoutTypeByOutTypeId" parameterType="Long" resultMap="HealthcareInventoryDrugoutTypeResult">
<include refid="selectHealthcareInventoryDrugoutTypeVo"/>
where out_type_id = #{outTypeId}
</select>
<select id="selectHealthcareInventoryDrugoutTypeByDrugOutId" parameterType="Long" resultMap="HealthcareInventoryDrugoutTypeResult">
SELECT * FROM healthcare_inventory_drugout_type
WHERE drug_out_id = #{drugOutId}
</select>
<insert id="insertHealthcareInventoryDrugoutType" parameterType="HealthcareInventoryDrugoutType" useGeneratedKeys="true" keyProperty="outTypeId">
insert into healthcare_inventory_drugout_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="drugOutId != null">drug_out_id,</if>
<if test="inboundLocation != null and inboundLocation != ''">inbound_location,</if>
<if test="signee != null and signee != ''">signee,</if>
<if test="proofMaterial != null and proofMaterial != ''">proof_material,</if>
<if test="purposeDetails != null and purposeDetails != ''">purpose_details,</if>
<if test="unit != null and unit != ''">unit,</if>
<if test="expirationDate != null">expiration_date,</if>
<if test="currentDatetime != null">current_datetime,</if>
<if test="destroyer != null and destroyer != ''">destroyer,</if>
<if test="destructionLocation != null and destructionLocation != ''">destruction_location,</if>
<if test="destructionProcess != null and destructionProcess != ''">destruction_process,</if>
<if test="scrapReason != null and scrapReason != ''">scrap_reason,</if>
<if test="disposalMethod != null and disposalMethod != ''">disposal_method,</if>
<if test="damageReason != null and damageReason != ''">damage_reason,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</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="drugOutId != null">#{drugOutId},</if>
<if test="inboundLocation != null and inboundLocation != ''">#{inboundLocation},</if>
<if test="signee != null and signee != ''">#{signee},</if>
<if test="proofMaterial != null and proofMaterial != ''">#{proofMaterial},</if>
<if test="purposeDetails != null and purposeDetails != ''">#{purposeDetails},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="expirationDate != null">#{expirationDate},</if>
<if test="currentDatetime != null">#{currentDatetime},</if>
<if test="destroyer != null and destroyer != ''">#{destroyer},</if>
<if test="destructionLocation != null and destructionLocation != ''">#{destructionLocation},</if>
<if test="destructionProcess != null and destructionProcess != ''">#{destructionProcess},</if>
<if test="scrapReason != null and scrapReason != ''">#{scrapReason},</if>
<if test="disposalMethod != null and disposalMethod != ''">#{disposalMethod},</if>
<if test="damageReason != null and damageReason != ''">#{damageReason},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHealthcareInventoryDrugoutType" parameterType="HealthcareInventoryDrugoutType">
update healthcare_inventory_drugout_type
<trim prefix="SET" suffixOverrides=",">
<if test="drugOutId != null">drug_out_id = #{drugOutId},</if>
<if test="inboundLocation != null and inboundLocation != ''">inbound_location = #{inboundLocation},</if>
<if test="signee != null and signee != ''">signee = #{signee},</if>
<if test="proofMaterial != null and proofMaterial != ''">proof_material = #{proofMaterial},</if>
<if test="purposeDetails != null and purposeDetails != ''">purpose_details = #{purposeDetails},</if>
<if test="unit != null and unit != ''">unit = #{unit},</if>
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
<if test="currentDatetime != null">current_datetime = #{currentDatetime},</if>
<if test="destroyer != null and destroyer != ''">destroyer = #{destroyer},</if>
<if test="destructionLocation != null and destructionLocation != ''">destruction_location = #{destructionLocation},</if>
<if test="destructionProcess != null and destructionProcess != ''">destruction_process = #{destructionProcess},</if>
<if test="scrapReason != null and scrapReason != ''">scrap_reason = #{scrapReason},</if>
<if test="disposalMethod != null and disposalMethod != ''">disposal_method = #{disposalMethod},</if>
<if test="damageReason != null and damageReason != ''">damage_reason = #{damageReason},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where out_type_id = #{outTypeId}
</update>
<delete id="deleteHealthcareInventoryDrugoutTypeByOutTypeId" parameterType="Long">
delete from healthcare_inventory_drugout_type where out_type_id = #{outTypeId}
</delete>
<delete id="deleteHealthcareInventoryDrugoutTypeByOutTypeIds" parameterType="String">
delete from healthcare_inventory_drugout_type where out_type_id in
<foreach item="outTypeId" collection="array" open="(" separator="," close=")">
#{outTypeId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,88 @@
<?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.inventory.mapper.HealthcareInventoryStoreroomMapper">
<resultMap type="HealthcareInventoryStoreroom" id="HealthcareInventoryStoreroomResult">
<result property="id" column="id" />
<result property="storeroomName" column="storeroom_name" />
<result property="location" column="location" />
<result property="adminUserid" column="admin_userid" />
<result property="remarks" column="remarks" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectHealthcareInventoryStoreroomVo">
select id, storeroom_name, location, admin_userid, remarks, created_at, updated_at from healthcare_inventory_storeroom
</sql>
<select id="selectHealthcareInventoryStoreroomList" parameterType="HealthcareInventoryStoreroom" resultMap="HealthcareInventoryStoreroomResult">
<include refid="selectHealthcareInventoryStoreroomVo"/>
<where>
<if test="storeroomName != null and storeroomName != ''"> and storeroom_name like concat('%', #{storeroomName}, '%')</if>
</where>
</select>
<select id="selectHealthcareInventoryStoreroomById" parameterType="Long" resultMap="HealthcareInventoryStoreroomResult">
<include refid="selectHealthcareInventoryStoreroomVo"/>
where id = #{id}
</select>
<insert id="insertHealthcareInventoryStoreroom" parameterType="HealthcareInventoryStoreroom" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_inventory_storeroom
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="storeroomName != null and storeroomName != ''">storeroom_name,</if>
<if test="location != null and location != ''">location,</if>
<if test="adminUserid != null">admin_userid,</if>
<if test="remarks != null">remarks,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="storeroomName != null and storeroomName != ''">#{storeroomName},</if>
<if test="location != null and location != ''">#{location},</if>
<if test="adminUserid != null">#{adminUserid},</if>
<if test="remarks != null">#{remarks},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateHealthcareInventoryStoreroom" parameterType="HealthcareInventoryStoreroom">
update healthcare_inventory_storeroom
<trim prefix="SET" suffixOverrides=",">
<if test="storeroomName != null and storeroomName != ''">storeroom_name = #{storeroomName},</if>
<if test="location != null and location != ''">location = #{location},</if>
<if test="adminUserid != null">admin_userid = #{adminUserid},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthcareInventoryStoreroomById" parameterType="Long">
delete from healthcare_inventory_storeroom where id = #{id}
</delete>
<delete id="deleteHealthcareInventoryStoreroomByIds" parameterType="String">
delete from healthcare_inventory_storeroom where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectHealthcareInventoryStoreroomExcel" parameterType="HealthcareInventoryStoreroom" resultMap="HealthcareInventoryStoreroomResult">
<include refid="selectHealthcareInventoryStoreroomVo"/>
<where>
<if test="storeroomName != null and storeroomName != ''"> and storeroom_name = #{storeroomName}</if>
</where>
</select>
<select id="selectHealthcareInventoryStoreroomByName"
resultType="com.ruoyi.inventory.domain.HealthcareInventoryStoreroom">
SELECT * FROM `healthcare_inventory_storeroom` WHERE storeroom_name = #{storeroomName}
</select>
</mapper>

View File

@@ -0,0 +1,87 @@
<?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.inventory.mapper.HealthcareInventoryWarehouseSelectionMapper">
<resultMap type="HealthcareInventoryWarehouseSelection" id="HealthcareInventoryWarehouseSelectionResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="storeroomId" column="storeroom_id" />
<result property="storeroomName" column="storeroom_name" />
<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="selectHealthcareInventoryWarehouseSelectionVo">
select id, user_id, user_name, storeroom_id, storeroom_name, create_by, create_time, update_by, update_time from healthcare_inventory_warehouse_selection
</sql>
<select id="selectHealthcareInventoryWarehouseSelectionList" parameterType="HealthcareInventoryWarehouseSelection" resultMap="HealthcareInventoryWarehouseSelectionResult">
<include refid="selectHealthcareInventoryWarehouseSelectionVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="storeroomId != null and storeroomId != ''"> and storeroom_id = #{storeroomId}</if>
<if test="storeroomName != null and storeroomName != ''"> and storeroom_name like concat('%', #{storeroomName}, '%')</if>
</where>
</select>
<select id="selectHealthcareInventoryWarehouseSelectionByUserId" parameterType="Long" resultMap="HealthcareInventoryWarehouseSelectionResult">
<include refid="selectHealthcareInventoryWarehouseSelectionVo"/>
where user_id = #{id}
</select>
<insert id="insertHealthcareInventoryWarehouseSelection" parameterType="HealthcareInventoryWarehouseSelection" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_inventory_warehouse_selection
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="storeroomId != null and storeroomId != ''">storeroom_id,</if>
<if test="storeroomName != null and storeroomName != ''">storeroom_name,</if>
<if test="createBy != null and createBy != ''">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="userId != null">#{userId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="storeroomId != null and storeroomId != ''">#{storeroomId},</if>
<if test="storeroomName != null and storeroomName != ''">#{storeroomName},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateHealthcareInventoryWarehouseSelection" parameterType="HealthcareInventoryWarehouseSelection">
update healthcare_inventory_warehouse_selection
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="storeroomId != null and storeroomId != ''">storeroom_id = #{storeroomId},</if>
<if test="storeroomName != null and storeroomName != ''">storeroom_name = #{storeroomName},</if>
<if test="createBy != null and createBy != ''">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>
<delete id="deleteHealthcareInventoryWarehouseSelectionById" parameterType="Long">
delete from healthcare_inventory_warehouse_selection where id = #{id}
</delete>
<delete id="deleteHealthcareInventoryWarehouseSelectionByIds" parameterType="String">
delete from healthcare_inventory_warehouse_selection where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>