初始化

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,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>