初始化

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>

View File

@@ -0,0 +1,138 @@
<?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.DrugArchiveMapper">
<!-- 知无涯 -->
<resultMap type="DrugArchive" id="DrugArchiveResult">
<id 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="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="minNumber" column="min_number"/>
<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="selectDrugArchiveVo">
select id, medicine_name, manufacturer, barcode, specification, retail_price,
is_split, state, dosage_form, dosage_unit, volume, volume_unit,
unit_quantity, split_unit, package_unit, min_number,
create_by, create_time, update_by, update_time, remark
from healthcare_drug_archive
</sql>
<select id="selectDrugArchiveList" parameterType="DrugArchive" resultMap="DrugArchiveResult">
<include refid="selectDrugArchiveVo"/>
<where>
<if test="medicineName != null and medicineName != ''">
AND medicine_name like concat('%', #{medicineName}, '%')
</if>
<if test="barcode != null and barcode != ''">
AND barcode = #{barcode}
</if>
<if test="isSplit != null and isSplit != ''">
AND is_split = #{isSplit}
</if>
<if test="type != null and type != ''">
AND type = #{type}
</if>
</where>
</select>
<insert id="insertDrugArchive" parameterType="DrugArchive" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_drug_archive
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="medicineName != null">medicine_name,</if>
<if test="manufacturer != null">manufacturer,</if>
<if test="barcode != null">barcode,</if>
<if test="specification != null">specification,</if>
<if test="retailPrice != null">retail_price,</if>
<if test="isSplit != null">is_split,</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="minNumber != null">min_number,</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="medicineName != null">#{medicineName},</if>
<if test="manufacturer != null">#{manufacturer},</if>
<if test="barcode != null">#{barcode},</if>
<if test="specification != null">#{specification},</if>
<if test="retailPrice != null">#{retailPrice},</if>
<if test="isSplit != null">#{isSplit},</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="minNumber != null">#{minNumber},</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="updateDrugArchive" parameterType="DrugArchive">
update healthcare_drug_archive
<set>
<if test="medicineName != null">medicine_name = #{medicineName},</if>
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
<if test="barcode != null">barcode = #{barcode},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="retailPrice != null">retail_price = #{retailPrice},</if>
<if test="isSplit != null">is_split = #{isSplit},</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="minNumber != null">min_number = #{minNumber},</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="deleteDrugArchiveById" parameterType="Long">
delete from healthcare_drug_archive where id = #{id}
</delete>
<delete id="deleteDrugArchiveByIds" parameterType="Long">
delete from healthcare_drug_archive where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,113 @@
<?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.DrugArchivesVoMapper">
<resultMap type="DrugArchivesVO" id="drugInventoryListResult">
<!-- 药品 档案 -->
<result property="archiveId" column="da_id" />
<!-- 商品名称 -->
<result property="medicineName" column="da_medicine_name" />
<!-- 生产厂家 -->
<result property="manufacturer" column="da_manufacturer" />
<!-- 商品条码 -->
<result property="barcode" column="da_barcode" />
<!-- 商品规格 -->
<result property="specification" column="da_specification" />
<!-- 零售价 -->
<result property="retailPrice" column="da_retail_price" />
<!-- 是否允许拆分 -->
<result property="isSplit" column="da_is_split" />
<!-- 用于判断是否为固态或者液态用0,1表示 -->
<result property="state" column="da_state" />
<!-- 剂量(成分含量) -->
<result property="dosageForm" column="da_dosage_form" />
<!-- 剂量单位 -->
<result property="dosageUnit" column="da_dosage_unit" />
<!-- 容量 -->
<result property="volume" column="da_volume" />
<!-- 容量单位 -->
<result property="volumeUnit" column="da_volume_unit" />
<!-- 最小包装数量 -->
<result property="unitQuantity" column="da_unit_quantity" />
<!-- 最小包装单位 -->
<result property="splitUnit" column="da_split_unit" />
<!-- 包装单位 -->
<result property="packageUnit" column="da_package_unit" />
<!-- 最小单位数量 -->
<result property="minNumber" column="da_min_number" />
<!-- 药品 批次 库存 -->
<result property="filingId" column="df_id" />
<!-- 药品编号 -->
<result property="medicineCode" column="df_medicineCode" />
<!-- 批次 -->
<result property="batch" column="df_batch" />
<!-- 有效期至 -->
<result property="expiryDate" column="df_expiryDate" />
<!-- 盒数 -->
<result property="boxCount" column="df_box_count" />
<!-- 包数 -->
<result property="packCount" column="df_pack_count" />
<!-- 零售价 -->
<result property="filingRetailPrice" column="df_retail_price" />
<!-- 最小单位价格 -->
<result property="minNumberRetailPrice" column="df_min_price" />
<!-- 入库点 名称 -->
<result property="entryPoint" column="is_storeroom_name" />
</resultMap>
<!-- 药品 库存 -->
<sql id="selectHealthcareDrugFilingVo">
healthcare_drug_filing.id df_id , healthcare_drug_filing.archive_id df_archive_id , healthcare_drug_filing.storeroom_id df_storeroom_id , healthcare_drug_filing.medicineCode df_medicineCode ,
healthcare_drug_filing.batch df_batch , healthcare_drug_filing.expiryDate df_expiryDate , healthcare_drug_filing.box_count df_box_count ,
healthcare_drug_filing.inventoryUnit df_inventoryUnit , healthcare_drug_filing.pack_count df_pack_count , healthcare_drug_filing.retail_price df_retail_price ,
healthcare_drug_filing.min_price df_min_price , healthcare_drug_filing.create_time df_create_time ,
healthcare_drug_filing.create_by df_create_by , healthcare_drug_filing.update_by df_update_by , healthcare_drug_filing.update_time df_update_time ,
healthcare_drug_filing.remark df_remark
</sql>
<!-- 药品 档案 -->
<sql id="selectHealthcareDrugArchiveVo">
healthcare_drug_archive.id da_id , healthcare_drug_archive.medicine_name da_medicine_name , healthcare_drug_archive.manufacturer da_manufacturer ,
healthcare_drug_archive.barcode da_barcode , healthcare_drug_archive.specification da_specification , healthcare_drug_archive.retail_price da_retail_price ,
healthcare_drug_archive.is_split da_is_split , healthcare_drug_archive.min_number da_min_number , healthcare_drug_archive.state da_state ,
healthcare_drug_archive.dosage_form da_dosage_form , healthcare_drug_archive.dosage_unit da_dosage_unit , healthcare_drug_archive.volume da_volume ,
healthcare_drug_archive.volume_unit da_volume_unit , healthcare_drug_archive.unit_quantity da_unit_quantity , healthcare_drug_archive.split_unit da_split_unit ,
healthcare_drug_archive.package_unit da_package_unit , healthcare_drug_archive.create_time da_create_time , healthcare_drug_archive.create_by da_create_by ,
healthcare_drug_archive.update_by da_update_by , healthcare_drug_archive.update_time da_update_time , healthcare_drug_archive.remark da_remark
</sql>
<!-- 库房 -->
<sql id="selectHealthcareInventoryStoreroomVo">
healthcare_inventory_storeroom.id is_id , healthcare_inventory_storeroom.storeroom_name is_storeroom_name , healthcare_inventory_storeroom.location is_location ,
healthcare_inventory_storeroom.admin_userid is_admin_userid ,healthcare_inventory_storeroom.remarks is_remarks , healthcare_inventory_storeroom.created_at is_created_at ,
healthcare_inventory_storeroom.updated_at is_updated_at
</sql>
<!-- -->
<select id="selectDruyInventoryList" parameterType="DrugArchivesVO" resultMap="drugInventoryListResult">
select
<include refid="selectHealthcareDrugFilingVo"/>
,
<include refid="selectHealthcareDrugArchiveVo"/>
,
<include refid="selectHealthcareInventoryStoreroomVo"/>
,
<if test="currentTime != null">
TIMESTAMPDIFF(MINUTE, #{currentTime}, expiryDate) AS time_diff_minutes
</if>
from healthcare_drug_filing
left join healthcare_drug_archive
on healthcare_drug_archive.id = healthcare_drug_filing.archive_id
left join healthcare_inventory_storeroom
on healthcare_inventory_storeroom.id = healthcare_drug_filing.storeroom_id
<where>
<if test="medicineName != null and medicineName != ''"> and healthcare_drug_archive.medicine_name like concat('%', #{medicineName}, '%')</if>
<if test="barcode != null and barcode != ''"> and healthcare_drug_archive.barcode like concat('%', #{barcode}, '%')</if>
<if test="batch != null and batch != ''"> and healthcare_drug_filing.batch = #{batch}</if>
<if test="storeroomId != null " >and healthcare_drug_filing.storeroom_id = #{storeroomId}</if>
</where>
ORDER BY
time_diff_minutes ASC
</select>
</mapper>

View File

@@ -0,0 +1,112 @@
<?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>

View File

@@ -0,0 +1,91 @@
<?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.HealthcareOsComplaintsMapper">
<resultMap type="HealthcareOsComplaints" id="HealthcareOsComplaintsResult">
<result property="id" column="id" />
<result property="complaintName" column="complaint_name" />
<result property="currentHistory" column="current_history" />
<result property="pastHistory" column="past_history" />
<result property="diagnosis" column="diagnosis" />
<result property="medicalAdvice" column="medical_advice" />
<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="selectHealthcareOsComplaintsVo">
select id, complaint_name, current_history, past_history, diagnosis, medical_advice, create_by, create_time, update_by, update_time from healthcare_os_complaints
</sql>
<select id="selectHealthcareOsComplaintsList" parameterType="HealthcareOsComplaints" resultMap="HealthcareOsComplaintsResult">
<include refid="selectHealthcareOsComplaintsVo"/>
<where>
<if test="complaintName != null and complaintName != ''"> and complaint_name like concat('%', #{complaintName}, '%')</if>
<if test="currentHistory != null and currentHistory != ''"> and current_history = #{currentHistory}</if>
<if test="pastHistory != null and pastHistory != ''"> and past_history = #{pastHistory}</if>
<if test="diagnosis != null and diagnosis != ''"> and diagnosis = #{diagnosis}</if>
<if test="medicalAdvice != null and medicalAdvice != ''"> and medical_advice = #{medicalAdvice}</if>
</where>
</select>
<select id="selectHealthcareOsComplaintsById" parameterType="Long" resultMap="HealthcareOsComplaintsResult">
<include refid="selectHealthcareOsComplaintsVo"/>
where id = #{id}
</select>
<insert id="insertHealthcareOsComplaints" parameterType="HealthcareOsComplaints" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_complaints
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="complaintName != null and complaintName != ''">complaint_name,</if>
<if test="currentHistory != null">current_history,</if>
<if test="pastHistory != null">past_history,</if>
<if test="diagnosis != null">diagnosis,</if>
<if test="medicalAdvice != null">medical_advice,</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="complaintName != null and complaintName != ''">#{complaintName},</if>
<if test="currentHistory != null">#{currentHistory},</if>
<if test="pastHistory != null">#{pastHistory},</if>
<if test="diagnosis != null">#{diagnosis},</if>
<if test="medicalAdvice != null">#{medicalAdvice},</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="updateHealthcareOsComplaints" parameterType="HealthcareOsComplaints">
update healthcare_os_complaints
<trim prefix="SET" suffixOverrides=",">
<if test="complaintName != null and complaintName != ''">complaint_name = #{complaintName},</if>
<if test="currentHistory != null">current_history = #{currentHistory},</if>
<if test="pastHistory != null">past_history = #{pastHistory},</if>
<if test="diagnosis != null">diagnosis = #{diagnosis},</if>
<if test="medicalAdvice != null">medical_advice = #{medicalAdvice},</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="deleteHealthcareOsComplaintsById" parameterType="Long">
delete from healthcare_os_complaints where id = #{id}
</delete>
<delete id="deleteHealthcareOsComplaintsByIds" parameterType="String">
delete from healthcare_os_complaints where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,137 @@
<?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.HealthcareOsConventionalDrugMapper">
<resultMap type="HealthcareOsConventionalDrug" id="HealthcareOsConventionalDrugResult">
<result property="id" column="id" />
<result property="conventionalPrescriptionId" column="conventional_prescription_id" />
<result property="medicineName" column="medicine_name" />
<result property="specification" column="specification" />
<result property="usageValue" column="usage_value" />
<result property="dosageValue" column="dosage_value" />
<result property="frequency" column="frequency" />
<result property="eatingTime" column="eating_time" />
<result property="eatingDays" column="eating_days" />
<result property="splitUnit" column="split_unit" />
<result property="totalQuantity" column="total_quantity" />
<result property="isSplit" column="is_split" />
<result property="unitQuantity" column="unit_quantity" />
<result property="packageUnit" column="package_unit" />
<result property="remarks" column="remarks" />
<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="selectHealthcareOsConventionalDrugVo">
select id, conventional_prescription_id, medicine_name , specification, usage_value, dosage_value, frequency, eating_time, eating_days,split_unit ,total_quantity,is_split , unit_quantity , package_unit ,remarks, create_by, create_time, update_by, update_time from healthcare_os_conventional_drug
</sql>
<select id="selectHealthcareOsConventionalDrugList" parameterType="HealthcareOsConventionalDrug" resultMap="HealthcareOsConventionalDrugResult">
<include refid="selectHealthcareOsConventionalDrugVo"/>
<where>
<if test="conventionalPrescriptionId != null "> and conventional_prescription_id = #{conventionalPrescriptionId}</if>
<if test="medicineName != null and medicineName != ''"> and medicine_name like concat('%', #{medicineName}, '%')</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="usageValue != null and usageValue != ''"> and usage_value = #{usageValue}</if>
<if test="dosageValue != null and dosageValue != ''"> and dosage_value = #{dosageValue}</if>
<if test="frequency != null "> and frequency = #{frequency}</if>
<if test="eatingTime != null and eatingTime != ''"> and eating_time = #{eatingTime}</if>
<if test="eatingDays != null "> and eating_days = #{eatingDays}</if>
<if test="splitUnit != null "> and split_unit = #{splitUnit}</if>
<if test="totalQuantity != null "> and total_quantity = #{totalQuantity}</if>
<if test="isSplit != null "> and is_split = #{isSplit}</if>
<if test="unitQuantity != null "> and unit_quantity = #{unitQuantity}</if>
<if test="packageUnit != null "> and package_unit = #{packageUnit}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectHealthcareOsConventionalDrugById" parameterType="Long" resultMap="HealthcareOsConventionalDrugResult">
<include refid="selectHealthcareOsConventionalDrugVo"/>
where id = #{id}
</select>
<insert id="insertHealthcareOsConventionalDrug" parameterType="HealthcareOsConventionalDrug" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_conventional_drug
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="conventionalPrescriptionId != null">conventional_prescription_id,</if>
<if test="medicineName != null and medicineName != ''">medicine_name,</if>
<if test="specification != null and specification != ''">specification,</if>
<if test="usageValue != null">usage_value,</if>
<if test="dosageValue != null">dosage_value,</if>
<if test="frequency != null">frequency,</if>
<if test="eatingTime != null">eating_time,</if>
<if test="eatingDays != null">eating_days,</if>
<if test="splitUnit != null">split_unit,</if>
<if test="totalQuantity != null">total_quantity,</if>
<if test="isSplit != null">is_split,</if>
<if test="unitQuantity != null">unit_quantity,</if>
<if test="packageUnit != null">package_unit,</if>
<if test="remarks != null">remarks,</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="conventionalPrescriptionId != null">#{conventionalPrescriptionId},</if>
<if test="medicineName != null and medicineName != ''">#{medicineName},</if>
<if test="specification != null and specification != ''">#{specification},</if>
<if test="usageValue != null">#{usageValue},</if>
<if test="dosageValue != null">#{dosageValue},</if>
<if test="frequency != null">#{frequency},</if>
<if test="eatingTime != null">#{eatingTime},</if>
<if test="eatingDays != null">#{eatingDays},</if>
<if test="splitUnit != null">#{splitUnit},</if>
<if test="totalQuantity != null">#{totalQuantity},</if>
<if test="isSplit != null">#{isSplit},</if>
<if test="unitQuantity != null">#{unitQuantity},</if>
<if test="packageUnit != null">#{packageUnit},</if>
<if test="remarks != null">#{remarks},</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="updateHealthcareOsConventionalDrug" parameterType="HealthcareOsConventionalDrug">
update healthcare_os_conventional_drug
<trim prefix="SET" suffixOverrides=",">
<if test="conventionalPrescriptionId != null">conventional_prescription_id = #{conventionalPrescriptionId},</if>
<if test="medicineName != null and medicineName != ''">medicine_name = #{medicineName},</if>
<if test="specification != null and specification != ''">specification = #{specification},</if>
<if test="usageValue != null">usage_value = #{usageValue},</if>
<if test="dosageValue != null">dosage_value = #{dosageValue},</if>
<if test="frequency != null">frequency = #{frequency},</if>
<if test="eatingTime != null">eating_time = #{eatingTime},</if>
<if test="eatingDays != null">eating_days = #{eatingDays},</if>
<if test="splitUnit != null">split_unit = #{splitUnit},</if>
<if test="totalQuantity != null">total_quantity = #{totalQuantity},</if>
<if test="isSplit != null">is_split = #{isSplit},</if>
<if test="unitQuantity != null">unit_quantity = #{unitQuantity},</if>
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
<if test="remarks != null">remarks = #{remarks},</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="deleteHealthcareOsConventionalDrugById" parameterType="Long">
delete from healthcare_os_conventional_drug where id = #{id}
</delete>
<delete id="deleteHealthcareOsConventionalDrugByIds" parameterType="String">
delete from healthcare_os_conventional_drug where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</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.os.mapper.HealthcareOsConventionalPrescriptionsMapper">
<resultMap type="HealthcareOsConventionalPrescriptions" id="HealthcareOsConventionalPrescriptionsResult">
<result property="id" column="id" />
<result property="prescriptionName" column="prescription_name" />
<result property="function" column="function" />
<result property="indication" column="indication" />
<result property="medicalAdvice" column="medical_advice" />
<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="selectHealthcareOsConventionalPrescriptionsVo">
select id, prescription_name, `function`, indication, medical_advice, create_by, create_time, update_by, update_time from healthcare_os_conventional_prescriptions
</sql>
<select id="selectHealthcareOsConventionalPrescriptionsList" parameterType="HealthcareOsConventionalPrescriptions" resultMap="HealthcareOsConventionalPrescriptionsResult">
<include refid="selectHealthcareOsConventionalPrescriptionsVo"/>
<where>
<if test="prescriptionName != null and prescriptionName != ''"> and prescription_name like concat('%', #{prescriptionName}, '%')</if>
<if test="function != null and function != ''"> and `function` = #{function}</if>
<if test="indication != null and indication != ''"> and indication = #{indication}</if>
<if test="medicalAdvice != null and medicalAdvice != ''"> and medical_advice = #{medicalAdvice}</if>
</where>
</select>
<select id="selectHealthcareOsConventionalPrescriptionsById" parameterType="Long" resultMap="HealthcareOsConventionalPrescriptionsResult">
<include refid="selectHealthcareOsConventionalPrescriptionsVo"/>
where id = #{id}
</select>
<insert id="insertHealthcareOsConventionalPrescriptions" parameterType="HealthcareOsConventionalPrescriptions" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_conventional_prescriptions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="prescriptionName != null and prescriptionName != ''">prescription_name,</if>
<if test="function != null">`function`,</if>
<if test="indication != null">indication,</if>
<if test="medicalAdvice != null">medical_advice,</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="prescriptionName != null and prescriptionName != ''">#{prescriptionName},</if>
<if test="function != null">#{function},</if>
<if test="indication != null">#{indication},</if>
<if test="medicalAdvice != null">#{medicalAdvice},</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="updateHealthcareOsConventionalPrescriptions" parameterType="HealthcareOsConventionalPrescriptions">
update healthcare_os_conventional_prescriptions
<trim prefix="SET" suffixOverrides=",">
<if test="prescriptionName != null and prescriptionName != ''">prescription_name = #{prescriptionName},</if>
<if test="function != null">`function` = #{function},</if>
<if test="indication != null">indication = #{indication},</if>
<if test="medicalAdvice != null">medical_advice = #{medicalAdvice},</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="deleteHealthcareOsConventionalPrescriptionsById" parameterType="Long">
delete from healthcare_os_conventional_prescriptions where id = #{id}
</delete>
<delete id="deleteHealthcareOsConventionalPrescriptionsByIds" parameterType="String">
delete from healthcare_os_conventional_prescriptions where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,92 @@
<?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.HealthcareOsConventionalValueMapper">
<resultMap type="HealthcareOsConventionalValue" id="HealthcareOsConventionalValueResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="dictName" column="dict_name" />
<result property="name" column="name" />
<result property="value" column="value" />
<result property="isLinkage" column="is_linkage" />
<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="selectHealthcareOsConventionalValueVo">
select id, parent_id, dict_name, name, value, is_linkage, create_by, create_time, update_by, update_time from healthcare_os_conventional_value
</sql>
<select id="selectHealthcareOsConventionalValueList" parameterType="HealthcareOsConventionalValue" resultMap="HealthcareOsConventionalValueResult">
<include refid="selectHealthcareOsConventionalValueVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="dictName != null and dictName != ''"> and dict_name = #{dictName}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="value != null and value != ''"> and value = #{value}</if>
<if test="isLinkage != null and isLinkage != ''"> and is_linkage = #{isLinkage}</if>
</where>
</select>
<select id="selectHealthcareOsConventionalValueById" parameterType="Long" resultMap="HealthcareOsConventionalValueResult">
<include refid="selectHealthcareOsConventionalValueVo"/>
where id = #{id}
</select>
<insert id="insertHealthcareOsConventionalValue" parameterType="HealthcareOsConventionalValue" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_conventional_value
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="dictName != null and dictName != ''">dict_name,</if>
<if test="name != null and name != ''">name,</if>
<if test="value != null and value != ''">value,</if>
<if test="isLinkage != null and isLinkage != ''">is_linkage,</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="parentId != null">#{parentId},</if>
<if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="value != null and value != ''">#{value},</if>
<if test="isLinkage != null and isLinkage != ''">#{isLinkage},</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="updateHealthcareOsConventionalValue" parameterType="HealthcareOsConventionalValue">
update healthcare_os_conventional_value
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="value != null and value != ''">value = #{value},</if>
<if test="isLinkage != null and isLinkage != ''">is_linkage = #{isLinkage},</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="deleteHealthcareOsConventionalValueById" parameterType="Long">
delete from healthcare_os_conventional_value where id = #{id}
</delete>
<delete id="deleteHealthcareOsConventionalValueByIds" parameterType="String">
delete from healthcare_os_conventional_value where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,176 @@
<?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.HealthcareOsPatientDiagnosisMapper">
<resultMap type="HealthcareOsPatientDiagnosis" id="HealthcareOsPatientDiagnosisResult">
<result property="id" column="id" />
<result property="patientId" column="patient_id" />
<result property="diagnosisType" column="diagnosis_type" />
<result property="isInsured" column="is_insured" />
<result property="value" column="value" />
<result property="studentId" column="student_id" />
<result property="name" column="name" />
<result property="patientType" column="patient_type" />
<result property="chiefComplaint" column="chief_complaint" />
<result property="presentIllness" column="present_illness" />
<result property="pastHistory" column="past_history" />
<result property="diagnosis" column="diagnosis" />
<result property="medicalAdvice" column="medical_advice" />
<result property="doctorName" column="doctor_name" />
<result property="status" column="status" />
<result property="outpatientTime" column="outpatient_time" />
<!-- 库房 -->
<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" />
<result property="idCard" column="id_card" />
</resultMap>
<sql id="selectHealthcareOsPatientDiagnosisVo">
select id, patient_id, diagnosis_type, is_insured,AES_DECRYPT(UNHEX(id_card),'zhxg') as id_card ,value, student_id, name,
patient_type, chief_complaint, present_illness, past_history, diagnosis, medical_advice, doctor_name, status , outpatient_time ,storeroom_id , storeroom_name , create_by, create_time, update_by, update_time from healthcare_os_patient_diagnosis
</sql>
<select id="selectHealthcareOsPatientDiagnosisList" parameterType="HealthcareOsPatientDiagnosis" resultMap="HealthcareOsPatientDiagnosisResult" >
<include refid="selectHealthcareOsPatientDiagnosisVo"/>
<where>
<if test="patientId != null "> and patient_id = #{patientId}</if>
<if test="diagnosisType != null "> and diagnosis_type = #{diagnosisType}</if>
<if test="isInsured != null "> and is_insured = #{isInsured}</if>
<if test="value != null "> and value = #{value}</if>
<if test="studentId != null and studentId != ''"> and student_id like concat('%', #{studentId}, '%')</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="patientType != null "> and patient_type = #{patientType}</if>
<if test="chiefComplaint != null and chiefComplaint != ''"> and chief_complaint = #{chiefComplaint}</if>
<if test="presentIllness != null and presentIllness != ''"> and present_illness = #{presentIllness}</if>
<if test="pastHistory != null and pastHistory != ''"> and past_history = #{pastHistory}</if>
<if test="diagnosis != null and diagnosis != ''"> and diagnosis = #{diagnosis}</if>
<if test="medicalAdvice != null and medicalAdvice != ''"> and medical_advice = #{medicalAdvice}</if>
<if test="doctorName != null and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="outpatientTime != null and outpatientTime instanceof java.util.Date"> and outpatient_time between #{params.outpatientTimeFront} and #{params.outpatientTimeAfter}</if>
<if test="storeroomId != null" >and storeroom_id = #{storeroomId}</if>
<if test="storeroomName != null" >and storeroom_name = #{storeroomName}</if>
<if test="startTime != null and endTime != null">
AND healthcare_os_patient_diagnosis.outpatient_time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
ORDER BY outpatient_time DESC
</select>
<select id="selectHealthcareOsPatientDiagnosisById" parameterType="Long" resultMap="HealthcareOsPatientDiagnosisResult">
<include refid="selectHealthcareOsPatientDiagnosisVo"/>
where id = #{id}
</select>
<insert id="insertHealthcareOsPatientDiagnosis" parameterType="HealthcareOsPatientDiagnosis" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_patient_diagnosis
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">patient_id,</if>
<if test="diagnosisType != null">diagnosis_type,</if>
<if test="isInsured != null">is_insured,</if>
<if test="value != null">value,</if>
<if test="studentId != null">student_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="patientType != null">patient_type,</if>
<if test="chiefComplaint != null">chief_complaint,</if>
<if test="presentIllness != null">present_illness,</if>
<if test="pastHistory != null">past_history,</if>
<if test="diagnosis != null">diagnosis,</if>
<if test="medicalAdvice != null">medical_advice,</if>
<if test="doctorName != null">doctor_name,</if>
<if test="status != null">status,</if>
<if test="outpatientTime != null">outpatient_time,</if>
<if test="storeroomId != null" >storeroom_id ,</if>
<if test="storeroomName != null" >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>
<if test="idCard != null">id_card,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},</if>
<if test="diagnosisType != null">#{diagnosisType},</if>
<if test="isInsured != null">#{isInsured},</if>
<if test="value != null">#{value},</if>
<if test="studentId != null">#{studentId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="patientType != null">#{patientType},</if>
<if test="chiefComplaint != null">#{chiefComplaint},</if>
<if test="presentIllness != null">#{presentIllness},</if>
<if test="pastHistory != null">#{pastHistory},</if>
<if test="diagnosis != null">#{diagnosis},</if>
<if test="medicalAdvice != null">#{medicalAdvice},</if>
<if test="doctorName != null">#{doctorName},</if>
<if test="status != null">#{status},</if>
<if test="outpatientTime != null">#{outpatientTime},</if>
<if test="storeroomId != null">#{storeroomId},</if>
<if test="storeroomName != null">#{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>
<if test="idCard != null">#{idCard},</if>
</trim>
</insert>
<update id="updateHealthcareOsPatientDiagnosis" parameterType="HealthcareOsPatientDiagnosis">
update healthcare_os_patient_diagnosis
<trim prefix="SET" suffixOverrides=",">
<if test="patientId != null">patient_id = #{patientId},</if>
<if test="diagnosisType != null">diagnosis_type = #{diagnosisType},</if>
<if test="isInsured != null">is_insured = #{isInsured},</if>
<if test="value != null">value = #{value},</if>
<if test="studentId != null">student_id = #{studentId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="patientType != null">patient_type = #{patientType},</if>
<if test="chiefComplaint != null">chief_complaint = #{chiefComplaint},</if>
<if test="presentIllness != null">present_illness = #{presentIllness},</if>
<if test="pastHistory != null">past_history = #{pastHistory},</if>
<if test="diagnosis != null">diagnosis = #{diagnosis},</if>
<if test="medicalAdvice != null">medical_advice = #{medicalAdvice},</if>
<if test="doctorName != null">doctor_name = #{doctorName},</if>
<if test="status != null">status = #{status},</if>
<if test="outpatientTime != null">outpatient_time = #{outpatientTime},</if>
<if test="storeroomId != null">storeroom_id = #{storeroomId},</if>
<if test="storeroomName != null">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>
<if test="idCard != null">id_card = #{idCard},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthcareOsPatientDiagnosisById" parameterType="Long">
delete from healthcare_os_patient_diagnosis where id = #{id}
</delete>
<delete id="deleteHealthcareOsPatientDiagnosisByIds" parameterType="String">
delete from healthcare_os_patient_diagnosis where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateHealthchcareOsPatientDiagnoisDataUtile">
UPDATE healthcare_os_patient_diagnosis pd
JOIN healthcare_os_patient_info pi ON pd.student_id = pi.student_id
SET pd.patient_id = pi.id
WHERE pd.patient_id IS NULL;
</update>
<update id="updateHealthchcareOspatientDiagnoisDocitNameUtile">
update healthcare_os_patient_diagnosis hpd
join sys_user su on hpd.doctor_name = su.user_name COLLATE utf8mb4_unicode_ci
set hpd.doctor_name = su.nick_name where hpd.doctor_name COLLATE utf8mb4_unicode_ci is not null;
</update>
</mapper>

View File

@@ -0,0 +1,128 @@
<?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.HealthcareOsPatientInfoMapper">
<resultMap type="HealthcareOsPatientInfo" id="OsPatientInfoResult">
<result property="id" column="id" />
<result property="patientType" column="patient_type" />
<result property="studentId" column="student_id" />
<result property="name" column="name" />
<result property="gender" column="gender" />
<result property="age" column="age" />
<result property="major" column="major" />
<result property="classInfo" column="class_info" />
<result property="phone" column="phone" />
<result property="counselor" column="counselor" />
<result property="department" column="department" />
<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="idCard" column="id_card" />
</resultMap>
<sql id="selectOsPatientInfoVo">
select id, patient_type, student_id,AES_DECRYPT(UNHEX(id_card),'zhxg') as id_card , name, gender, age, major, class_info, phone, counselor, department, create_by, create_time, update_by, update_time from healthcare_os_patient_info
</sql>
<select id="selectOsPatientInfoList" parameterType="HealthcareOsPatientInfo" resultMap="OsPatientInfoResult">
<include refid="selectOsPatientInfoVo"/>
<where>
<if test="patientType != null "> and patient_type = #{patientType}</if>
<if test="studentId != null and studentId != ''"> and student_id = #{studentId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="gender != null and gender != ''"> and gender = #{gender}</if>
<if test="age != null "> and age = #{age}</if>
<if test="major != null and major != ''"> and major = #{major}</if>
<if test="classInfo != null and classInfo != ''"> and class_info = #{classInfo}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="counselor != null and counselor != ''"> and counselor = #{counselor}</if>
<if test="department != null and department != ''"> and department = #{department}</if>
</where>
</select>
<select id="selectOsPatientInfoById" parameterType="Long" resultMap="OsPatientInfoResult">
<include refid="selectOsPatientInfoVo"/>
where id = #{id}
</select>
<select id="selectOsPatientInfoByStudentId" parameterType="String" resultMap="OsPatientInfoResult">
<include refid="selectOsPatientInfoVo"/>
where student_id = #{studentId}
</select>
<insert id="insertOsPatientInfo" parameterType="HealthcareOsPatientInfo" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_patient_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientType != null">patient_type,</if>
<if test="studentId != null">student_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="gender != null and gender != ''">gender,</if>
<if test="age != null">age,</if>
<if test="major != null">major,</if>
<if test="classInfo != null">class_info,</if>
<if test="phone != null">phone,</if>
<if test="counselor != null">counselor,</if>
<if test="department != null">department,</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>
<if test="idCard != null">id_card,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientType != null">#{patientType},</if>
<if test="studentId != null">#{studentId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="gender != null and gender != ''">#{gender},</if>
<if test="age != null">#{age},</if>
<if test="major != null">#{major},</if>
<if test="classInfo != null">#{classInfo},</if>
<if test="phone != null">#{phone},</if>
<if test="counselor != null">#{counselor},</if>
<if test="department != null">#{department},</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>
<if test="idCard != null">#{idCard},</if>
</trim>
</insert>
<update id="updateOsPatientInfo" parameterType="HealthcareOsPatientInfo">
update healthcare_os_patient_info
<trim prefix="SET" suffixOverrides=",">
<if test="patientType != null">patient_type = #{patientType},</if>
<if test="studentId != null">student_id = #{studentId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="gender != null and gender != ''">gender = #{gender},</if>
<if test="age != null">age = #{age},</if>
<if test="major != null">major = #{major},</if>
<if test="classInfo != null">class_info = #{classInfo},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="counselor != null">counselor = #{counselor},</if>
<if test="department != null">department = #{department},</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>
<if test="idCard != null">id_card = #{idCard},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOsPatientInfoById" parameterType="Long">
delete from healthcare_os_patient_info where id = #{id}
</delete>
<delete id="deleteOsPatientInfoByIds" parameterType="String">
delete from healthcare_os_patient_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,192 @@
<?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.HealthcareOsPrescriptionDetailsMapper">
<resultMap type="HealthcareOsPrescriptionDetails" id="HealthcareOsPrescriptionDetailsResult">
<result property="id" column="id" />
<result property="patientDiagnosisId" column="patient_diagnosis_id" />
<result property="singular" column="singular" />
<result property="medicineId" column="medicine_id" />
<result property="medicineName" column="medicine_name" />
<result property="specification" column="specification" />
<result property="usageValue" column="usage_value" />
<result property="dosageValue" column="dosage_value" />
<result property="frequency" column="frequency" />
<result property="eatingTime" column="eating_time" />
<result property="eatingDays" column="eating_days" />
<result property="splitUnit" column="split_unit" />
<result property="totalQuantity" column="total_quantity" />
<result property="unitPrice" column="unit_price" />
<result property="totalPrice" column="total_price" />
<result property="isSplit" column="is_split" />
<result property="unitQuantity" column="unit_quantity" />
<result property="packageUnit" column="package_unit" />
<result property="remarks" column="remarks" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="batch" column="batch" />
<result property="expiryDate" column="expiry_date" />
</resultMap>
<sql id="selectHealthcareOsPrescriptionDetailsVo">
select id, patient_diagnosis_id, singular, medicine_id , medicine_name, specification , usage_value, dosage_value, frequency, eating_time,
eating_days , split_unit, total_quantity, unit_price , total_price ,is_split ,unit_quantity , package_unit , remarks , create_by,
create_time, update_by, update_time,batch,expiry_date from healthcare_os_prescription_details
</sql>
<select id="selectHealthcareOsPrescriptionDetailsList" parameterType="HealthcareOsPrescriptionDetails" resultMap="HealthcareOsPrescriptionDetailsResult">
<include refid="selectHealthcareOsPrescriptionDetailsVo"/>
<where>
<if test="patientDiagnosisId != null "> and patient_diagnosis_id = #{patientDiagnosisId}</if>
<if test="singular != null "> and singular = #{singular}</if>
<if test="medicineId != null "> and medicine_id = #{medicineId}</if>
<if test="medicineId != null "> and medicine_name = #{medicineName}</if>
<if test="specification != null "> and specification = #{specification}</if>
<if test="usageValue != null and usageValue != ''"> and usage_value = #{usageValue}</if>
<if test="dosageValue != null and dosageValue != ''"> and dosage_value = #{dosageValue}</if>
<if test="frequency != null "> and frequency = #{frequency}</if>
<if test="eatingTime != null and eatingTime != ''"> and eating_time = #{eatingTime}</if>
<if test="eatingDays != null "> and eating_days = #{eatingDays}</if>
<if test="splitUnit != null "> and split_unit = #{splitUnit}</if>
<if test="totalQuantity != null "> and total_quantity = #{totalQuantity}</if>
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
<if test="totalPrice != null "> and total_price = #{totalPrice}</if>
<if test="isSplit != null "> and is_split = #{isSplit}</if>
<if test="isSplit != null "> and unit_quantity = #{unitQuantity}</if>
<if test="isSplit != null "> and package_unit = #{packageUnit}</if>
<if test="remarks != null "> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectHealthcareOsPrescriptionDetailsById" parameterType="Long" resultMap="HealthcareOsPrescriptionDetailsResult">
<include refid="selectHealthcareOsPrescriptionDetailsVo"/>
where id = #{id}
</select>
<insert id="insertHealthcareOsPrescriptionDetails" parameterType="HealthcareOsPrescriptionDetails" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_prescription_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientDiagnosisId != null">patient_diagnosis_id,</if>
<if test="singular != null">singular,</if>
<if test="medicineId != null">medicine_id,</if>
<if test="medicineName != null">medicine_name,</if>
<if test="specification != null">specification,</if>
<if test="usageValue != null">usage_value,</if>
<if test="dosageValue != null">dosage_value,</if>
<if test="frequency != null">frequency,</if>
<if test="eatingTime != null">eating_time,</if>
<if test="eatingDays != null">eating_days,</if>
<if test="splitUnit != null">split_unit,</if>
<if test="totalQuantity != null">total_quantity,</if>
<if test="unitPrice != null">unit_price,</if>
<if test="totalPrice != null">total_price,</if>
<if test="isSplit != null">is_split,</if>
<if test="unitQuantity != null">unit_quantity,</if>
<if test="packageUnit != null">package_unit,</if>
<if test="remarks != null">remarks,</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>
<if test="batch != null">batch,</if>
<if test="expiryDate != null">expiry_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientDiagnosisId != null">#{patientDiagnosisId},</if>
<if test="singular != null">#{singular},</if>
<if test="medicineId != null">#{medicineId},</if>
<if test="medicineName != null">#{medicineName},</if>
<if test="specification != null">#{specification},</if>
<if test="usageValue != null">#{usageValue},</if>
<if test="dosageValue != null">#{dosageValue},</if>
<if test="frequency != null">#{frequency},</if>
<if test="eatingTime != null">#{eatingTime},</if>
<if test="eatingDays != null">#{eatingDays},</if>
<if test="splitUnit != null">#{splitUnit},</if>
<if test="totalQuantity != null">#{totalQuantity},</if>
<if test="unitPrice != null">CAST(ROUND(#{unitPrice}, 2) AS DECIMAL(10, 2)),</if>
<if test="totalPrice != null">CAST(ROUND(#{totalPrice}, 2) AS DECIMAL(10, 2)),</if>
<if test="isSplit != null">#{isSplit},</if>
<if test="unitQuantity != null">#{unitQuantity},</if>
<if test="packageUnit != null">#{packageUnit},</if>
<if test="remarks != null">#{remarks},</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>
<if test="batch != null">#{batch},</if>
<if test="expiryDate != null">#{expiryDate},</if>
</trim>
</insert>
<update id="updateHealthcareOsPrescriptionDetails" parameterType="HealthcareOsPrescriptionDetails">
update healthcare_os_prescription_details
<trim prefix="SET" suffixOverrides=",">
<if test="patientDiagnosisId != null">patient_diagnosis_id = #{patientDiagnosisId},</if>
<if test="singular != null">singular = #{singular},</if>
<if test="medicineId != null">medicine_id = #{medicineId},</if>
<if test="medicineName != null">medicine_name = #{medicineName},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="usageValue != null">usage_value = #{usageValue},</if>
<if test="dosageValue != null">dosage_value = #{dosageValue},</if>
<if test="frequency != null">frequency = #{frequency},</if>
<if test="eatingTime != null">eating_time = #{eatingTime},</if>
<if test="eatingDays != null">eating_days = #{eatingDays},</if>
<if test="splitUnit != null">split_unit = #{splitUnit},</if>
<if test="totalQuantity != null">total_quantity = #{totalQuantity},</if>
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
<if test="totalPrice != null">total_price = #{totalPrice},</if>
<if test="isSplit != null">is_split = #{isSplit},</if>
<if test="unitQuantity != null">unit_quantity = #{unitQuantity},</if>
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
<if test="remarks != null">remarks = #{remarks},</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>
<if test="batch != null">batch = #{batch},</if>
<if test="expiryDate != null">expiry_date = #{expiryDate},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthcareOsPrescriptionDetailsById" parameterType="Long">
delete from healthcare_os_prescription_details where id = #{id}
</delete>
<delete id="deleteHealthcareOsPrescriptionDetailsBy" parameterType="HealthcareOsPrescriptionDetails">
delete from healthcare_os_prescription_details where
<where>
<if test="patientDiagnosisId != null "> and patient_diagnosis_id = #{patientDiagnosisId}</if>
<if test="singular != null "> and singular = #{singular}</if>
<if test="medicineId != null "> and medicine_id = #{medicineId}</if>
<if test="medicineName != null "> and medicine_name = #{medicineName}</if>
<if test="specification != null "> and specification = #{specification}</if>
<if test="usageValue != null and usageValue != ''"> and usage_value = #{usageValue}</if>
<if test="dosageValue != null and dosageValue != ''"> and dosage_value = #{dosageValue}</if>
<if test="frequency != null "> and frequency = #{frequency}</if>
<if test="eatingTime != null and eatingTime != ''"> and eating_time = #{eatingTime}</if>
<if test="eatingDays != null "> and eating_days = #{eatingDays}</if>
<if test="splitUnit != null "> and split_unit = #{splitUnit}</if>
<if test="totalQuantity != null "> and total_quantity = #{totalQuantity}</if>
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
<if test="totalPrice != null "> and total_price = #{totalPrice}</if>
<if test="isSplit != null "> and is_split = #{isSplit}</if>
<if test="unitQuantity != null "> and unit_qantity = #{unitQuantity}</if>
<if test="packageUnit != null "> and package_unit = #{packageUnit}</if>
<if test="remarks != null "> and remarks = #{remarks}</if>
<if test="batch != null "> and batch = #{batch}</if>
<if test="expiryDate != null "> and expiry_date = #{expiryDate}</if>
</where>
</delete>
<delete id="deleteHealthcareOsPrescriptionDetailsByIds" parameterType="String">
delete from healthcare_os_prescription_details where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,312 @@
<?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.OsStatisticsMapper">
<!-- 复用 -->
<resultMap type="PatientMedicalRecordsVO" id="PatientMedicalRecordsVOResult">
<!-- 患者信息 -->
<!-- 患者 类型 ( 显示 ) -->
<result property="patientTypeLabel" column="opi_st_patient_type" />
<!-- 学号/工号 -->
<result property="studentId" column="opi_student_id" />
<!-- 姓名 -->
<result property="name" column="opi_name" />
<!-- 性别 ( 显示 ) -->
<result property="genderLabel" column="opi_st_gender" />
<!-- 年龄 -->
<result property="age" column="opi_age" />
<!-- 专业 -->
<result property="major" column="opi_major" />
<!-- 班级 -->
<result property="classInfo" column="opi_class_info" />
<!-- 电话 -->
<result property="phone" column="opi_phone" />
<!-- 辅导员 -->
<result property="counselor" column="opi_counselor" />
<!-- 部门 -->
<result property="department" column="opi_department" />
<!-- 以下为患者诊断信息 -->
<!-- 诊断id -->
<result property="patientDiagnosisId" column="ho_pd_id" />
<!-- 患者 id -->
<result property="patientId" column="ho_pd_patient_id" />
<!-- 诊断类型 -->
<result property="diagnosisType" column="ho_pd_diagnosis_type" />
<!-- 是否医保 ( 显示 ) -->
<result property="isInsuredLabel" column="ho_pd_st_is_insured" />
<!-- 数值 -->
<result property="value" column="ho_pd_value" />
<!-- 主诉 -->
<result property="chiefComplaint" column="ho_pd_chief_complaint" />
<!-- 现病史 -->
<result property="presentIllness" column="ho_pd_present_illness" />
<!-- 既往史 -->
<result property="pastHistory" column="ho_pd_past_history" />
<!-- 诊断 -->
<result property="diagnosis" column="ho_pd_diagnosis" />
<!-- 医嘱事项 -->
<result property="medicalAdvice" column="ho_pd_medical_advice" />
<!-- 医生名字 -->
<result property="doctorName" column="ho_pd_doctor_name" />
<!-- 状态 ( 显示 ) -->
<result property="statusLabel" column="ho_pd_st_status" />
<!-- 就诊时间 -->
<result property="outpatientTime" column="ho_pd_outpatient_time" />
<!-- 总价钱 -->
<result property="totalPrice" column="opi_st_total_price" />
<result property="idCard" column="ho_pd_id_card" />
</resultMap>
<!--导出-->
<resultMap type="PatientMedicalRecordsYesVO" id="PatientMedicalRecordsYesVOResult">
<!-- 患者信息 -->
<!-- 学号/工号 -->
<result property="studentId" column="opi_student_id" />
<!-- 姓名 -->
<result property="name" column="opi_name" />
<!-- 性别 ( 显示 ) -->
<result property="genderLabel" column="opi_st_gender" />
<!-- 年龄 -->
<result property="age" column="opi_age" />
<!-- 班级 -->
<result property="classInfo" column="opi_class_info" />
<!-- 是否医保 ( 显示 ) -->
<result property="isInsuredLabel" column="ho_pd_st_is_insured" />
<!-- 就诊时间 -->
<result property="outpatientTime" column="ho_pd_outpatient_time" />
<!-- 总价钱 -->
<result property="totalPrice" column="opi_st_total_price" />
<!-- 数值 -->
<result property="value" column="ho_pd_value" />
<result property="idCard" column="ho_pd_id_card" />
</resultMap>
<!-- 患者信息 -->
<sql id="selectOsPatientInfoVo">
healthcare_os_patient_info.id AS opi_id,
healthcare_os_patient_info.patient_type AS opi_patient_type,
healthcare_os_patient_info.student_id AS opi_student_id,
healthcare_os_patient_info.name AS opi_name,
healthcare_os_patient_info.gender AS opi_gender,
healthcare_os_patient_info.age AS opi_age,
healthcare_os_patient_info.major AS opi_major,
healthcare_os_patient_info.class_info AS opi_class_info,
healthcare_os_patient_info.phone AS opi_phone,
healthcare_os_patient_info.counselor AS opi_counselor,
healthcare_os_patient_info.department AS opi_department,
healthcare_os_patient_info.create_by AS opi_create_by,
healthcare_os_patient_info.create_time AS opi_create_time,
healthcare_os_patient_info.update_by AS opi_update_by,
healthcare_os_patient_info.update_time AS opi_update_time
</sql>
<!-- 诊断药品 -->
<sql id="selectHealthcareOsPrescriptionDetailsVo">
healthcare_os_prescription_details.id AS opd_id,
healthcare_os_prescription_details.patient_diagnosis_id AS opd_patient_diagnosis_id,
healthcare_os_prescription_details.singular AS opd_singular,
healthcare_os_prescription_details.medicine_id AS opd_medicine_id,
healthcare_os_prescription_details.medicine_name AS opd_medicine_name,
healthcare_os_prescription_details.specification AS opd_specification,
healthcare_os_prescription_details.usage_value AS opd_usage_value,
healthcare_os_prescription_details.dosage_value AS opd_dosage_value,
healthcare_os_prescription_details.frequency AS opd_frequency,
healthcare_os_prescription_details.eating_time AS opd_eating_time,
healthcare_os_prescription_details.eating_days AS opd_eating_days,
healthcare_os_prescription_details.split_unit AS opd_split_unit,
healthcare_os_prescription_details.total_quantity AS opd_total_quantity,
healthcare_os_prescription_details.unit_price AS opd_unit_price,
healthcare_os_prescription_details.total_price AS opd_total_price,
healthcare_os_prescription_details.is_split AS opd_is_split,
healthcare_os_prescription_details.unit_quantity AS opd_unit_quantity,
healthcare_os_prescription_details.package_unit AS opd_package_unit,
healthcare_os_prescription_details.remarks AS opd_remarks,
healthcare_os_prescription_details.create_by AS opd_create_by,
healthcare_os_prescription_details.create_time AS opd_create_time,
healthcare_os_prescription_details.update_by AS opd_update_by,
healthcare_os_prescription_details.update_time AS opd_update_time
</sql>
<!-- 诊断 -->
<sql id="selectHealthcareOsPatientDiagnosisVo">
healthcare_os_patient_diagnosis.id AS ho_pd_id,
healthcare_os_patient_diagnosis.patient_id AS ho_pd_patient_id,
healthcare_os_patient_diagnosis.diagnosis_type AS ho_pd_diagnosis_type,
healthcare_os_patient_diagnosis.is_insured AS ho_pd_is_insured,
healthcare_os_patient_diagnosis.value AS ho_pd_value,
healthcare_os_patient_diagnosis.student_id AS ho_pd_student_id,
healthcare_os_patient_diagnosis.name AS ho_pd_name,
healthcare_os_patient_diagnosis.patient_type AS ho_pd_patient_type,
healthcare_os_patient_diagnosis.chief_complaint AS ho_pd_chief_complaint,
healthcare_os_patient_diagnosis.present_illness AS ho_pd_present_illness,
healthcare_os_patient_diagnosis.past_history AS ho_pd_past_history,
healthcare_os_patient_diagnosis.diagnosis AS ho_pd_diagnosis,
healthcare_os_patient_diagnosis.medical_advice AS ho_pd_medical_advice,
healthcare_os_patient_diagnosis.doctor_name AS ho_pd_doctor_name,
healthcare_os_patient_diagnosis.status AS ho_pd_status,
healthcare_os_patient_diagnosis.outpatient_time AS ho_pd_outpatient_time,
healthcare_os_patient_diagnosis.create_by AS ho_pd_create_by,
healthcare_os_patient_diagnosis.create_time AS ho_pd_create_time,
healthcare_os_patient_diagnosis.update_by AS ho_pd_update_by,
healthcare_os_patient_diagnosis.update_time AS ho_pd_update_time,
healthcare_os_patient_diagnosis.id_card AS ho_pd_id_card
</sql>
<!-- 获取 患者 诊断 列表 信息 没有 药品 进行 xml 官场 dictionariesNamePatientType -->
<select id="obtainPatientDiagnosisList" parameterType="PatientMedicalRecordsVO" resultMap="PatientMedicalRecordsVOResult">
select
<include refid="selectOsPatientInfoVo"/>
,
<include refid="selectHealthcareOsPatientDiagnosisVo"/>
,
<if test="dictionariesNamePatientType != null and dictionariesNamePatientType != ''" >
(select dict_label from sys_dict_data
where sys_dict_data.dict_type = #{dictionariesNamePatientType} and
sys_dict_data.dict_value = healthcare_os_patient_info.patient_type )
AS opi_st_patient_type ,
</if>
<if test="dictionariesNameGender != null and dictionariesNameGender != ''">
(select dict_label from sys_dict_data
where sys_dict_data.dict_type = #{dictionariesNameGender} and
sys_dict_data.dict_value = healthcare_os_patient_info.gender
) AS opi_st_gender,
</if>
<if test="dictionariesNameIsInsured != null and dictionariesNameIsInsured != ''">
(select dict_label from sys_dict_data
where sys_dict_data.dict_type = #{dictionariesNameIsInsured} and
sys_dict_data.dict_value = healthcare_os_patient_diagnosis.is_insured
) AS ho_pd_st_is_insured ,
</if>
<if test="dictionariesNameStatus != null and dictionariesNameStatus != ''">
(select dict_label from sys_dict_data
where sys_dict_data.dict_type = #{dictionariesNameStatus} and
sys_dict_data.dict_value = healthcare_os_patient_diagnosis.status
) AS ho_pd_st_status,
</if>
(select sum(total_price) from healthcare_os_prescription_details
where healthcare_os_prescription_details.patient_diagnosis_id =
healthcare_os_patient_diagnosis.id ) AS opi_st_total_price
from healthcare_os_patient_diagnosis
left join healthcare_os_patient_info
on healthcare_os_patient_diagnosis.patient_id = healthcare_os_patient_info.id
<where>
<if test="status != null"> and healthcare_os_patient_diagnosis.status = #{status}</if>
<if test="name != null"> and healthcare_os_patient_diagnosis.name = #{name}</if>
<if test="diagnosis != null"> and healthcare_os_patient_diagnosis.diagnosis = #{diagnosis}</if>
<if test="studentId != null"> and healthcare_os_patient_diagnosis.student_id = #{studentId}</if>
<if test="doctorName != null"> and healthcare_os_patient_diagnosis.doctor_name = #{doctorName}</if>
<if test="isInsured != null "> and is_insured = #{isInsured}</if>
<if test="studentId != null and studentId != ''"> and student_id like concat('%', #{studentId}, '%')</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="doctorName != null and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
<if test="diagnosis != null and diagnosis != ''"> and diagnosis = #{diagnosis}</if>
<if test="startTime != null and endTime != null">
AND healthcare_os_patient_diagnosis.outpatient_time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
<!-- CountDiagnosisVO -->
<resultMap type="CountDiagnosisVO" id="CountDiagnosisVOResult">
<!-- -->
<result property="symptomName" column="value" />
<!-- -->
<result property="number" column="number" />
</resultMap>
<!-- 导出(接诊医保列表) -->
<!-- 获取 患者 诊断 列表 信息 没有 药品 进行 xml 官场 dictionariesNamePatientType -->
<select id="obtainPatientDiagnosisYesList" parameterType="PatientMedicalRecordsVO" resultMap="PatientMedicalRecordsYesVOResult">
select
<include refid="selectOsPatientInfoVo"/>
,
<include refid="selectHealthcareOsPatientDiagnosisVo"/>
,
<if test="dictionariesNameGender != null and dictionariesNameGender != ''">
(select dict_label from sys_dict_data
where sys_dict_data.dict_type = #{dictionariesNameGender} and
sys_dict_data.dict_value = healthcare_os_patient_info.gender
) AS opi_st_gender,
</if>
<if test="dictionariesNameIsInsured != null and dictionariesNameIsInsured != ''">
(select dict_label from sys_dict_data
where sys_dict_data.dict_type = #{dictionariesNameIsInsured} and
sys_dict_data.dict_value = healthcare_os_patient_diagnosis.is_insured
) AS ho_pd_st_is_insured ,
</if>
(select sum(total_price) from healthcare_os_prescription_details
where healthcare_os_prescription_details.patient_diagnosis_id =
healthcare_os_patient_diagnosis.id ) AS opi_st_total_price
from healthcare_os_patient_diagnosis
left join healthcare_os_patient_info
on healthcare_os_patient_diagnosis.patient_id = healthcare_os_patient_info.id
<where>
<if test="isInsured != null "> is_insured = #{isInsured} and</if>
<if test="startTime != null and endTime != null">
healthcare_os_patient_diagnosis.outpatient_time BETWEEN #{startTime} AND #{endTime} AND
</if>
healthcare_os_patient_diagnosis.status = 1
</where>
</select>
<!-- 获取 每个 症状 的 诊断 数量 obtain symptom corresponding number 234415 params -->
<!-- startTime -> 开始时间 , endTime -> 结束时间 -->
<!-- 知无涯修改 -->
<select id="obtainSymptomCorrespondingNumber" parameterType="CountDiagnosisVO" resultMap="CountDiagnosisVOResult">
SELECT
ho_cv.value as value,
COUNT(ho_pd.id) as number
FROM
healthcare_os_conventional_value as ho_cv
LEFT JOIN
healthcare_os_patient_diagnosis as ho_pd ON
ho_pd.diagnosis LIKE CONCAT('%', ho_cv.value, '%')
<if test="params.startTime != null and params.endTime != null">
AND ho_pd.create_time BETWEEN #{params.startTime} AND #{params.endTime}
</if>
WHERE
ho_cv.parent_id = (SELECT id FROM healthcare_os_conventional_value WHERE parent_id = 0 AND dict_name = #{dictionariesNameSymptom})
<if test="symptomName != null and symptomName != ''">
AND ho_cv.value = #{symptomName}
</if>
GROUP BY
ho_cv.value
ORDER BY
number DESC
</select>
<!-- 获取 症状 数量 单独 -->
<!-- 知无涯修改 -->
<select id="obtainSymptomNumber" parameterType="CountDiagnosisVO" resultMap="CountDiagnosisVOResult">
SELECT
ho_cv.value as value,
COUNT(ho_pd.id) as number
FROM
healthcare_os_conventional_value as ho_cv
LEFT JOIN
healthcare_os_patient_diagnosis as ho_pd ON
ho_pd.diagnosis LIKE CONCAT('%', ho_cv.value, '%')
WHERE
ho_cv.parent_id = (
SELECT id
FROM healthcare_os_conventional_value
WHERE parent_id = 0 AND dict_name = #{dictionariesNameSymptom}
)
<if test="symptomName != null and symptomName != ''">
AND ho_cv.value = #{symptomName}
</if>
GROUP BY
ho_cv.value
</select>
<select id="obtainPatientDiagnosisList_COUNT"
parameterType="PatientMedicalRecordsVO"
resultType="java.lang.Integer">
SELECT COUNT(1)
FROM healthcare_os_patient_diagnosis
LEFT JOIN healthcare_os_patient_info ON healthcare_os_patient_diagnosis.patient_id = healthcare_os_patient_info.id
<where>
<!-- 保持与主查询相同的条件 -->
<if test="status != null">AND healthcare_os_patient_diagnosis.status = #{status}</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,59 @@
<?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.StudentInfoMapper">
<resultMap type="StudentInfo" id="StudentInfoResult">
<result property="stuId" column="stu_id" />
<result property="stuNo" column="stu_no" />
<result property="stuName" column="stu_name" />
<result property="gender" column="gender" />
<result property="majorName" column="major_name" />
<result property="className" column="class_name" />
<result property="teacherName" column="teacher_name" />
<result property="deptName" column="dept_name" />
<result property="idCard" column="id_card" />
</resultMap>
<!-- 不是 完整 的 -->
<sql id="selectStudentInfo">
select stu_id, stu_no, stu_name, gender, major_name, class_name, teacher_name , dept_name,id_card from view_stu_info
</sql>
<!-- 查询 -->
<select id="selectStudentInfoList" parameterType="StudentInfo" resultMap="StudentInfoResult">
<include refid="selectStudentInfo"/>
<where>
<if test="stuNo != null and stuNo != ''"> and stu_no = #{stuNo}</if>
<if test="stuName != null and stuName != ''"> and stu_name like concat('%', #{stuName}, '%')</if>
</where>
</select>
<!-- 查询 id -->
<select id="selectStudentInfoByStudentId" parameterType="String" resultMap="StudentInfoResult">
<include refid="selectStudentInfo"/>
where stu_id = #{stuId}
</select>
<select id="getTeachingStaffInfo" parameterType="HealthcareOsPatientInfo" resultType="com.ruoyi.os.domain.HealthcareOsPatientInfo">
SELECT
'1' AS patientType,
u.user_name AS studentId,
u.nick_name AS name,
CASE
WHEN u.sex = '0' THEN 0
WHEN u.sex = '1' THEN 1
ELSE 2
END AS gender,
u.phonenumber AS phone,
d.dept_name AS department
FROM sys_user u
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
<where>
<if test="studentId != null and studentId != ''"> and u.user_name = #{studentId}</if>
<if test="name != null and name != ''"> and u.nick_name like concat('%', #{name}, '%')</if>
</where>
</select>
</mapper>