|
@@ -3,14 +3,11 @@
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="DTPMapper">
|
|
<mapper namespace="DTPMapper">
|
|
-<!--处方登记 -->
|
|
|
|
|
|
+<!--处方登记信息查询 -->
|
|
<select id="RecipeRegisterList" parameterType="pd" resultType="pd">
|
|
<select id="RecipeRegisterList" parameterType="pd" resultType="pd">
|
|
- select id, orderId, saleOrderNumber, genericName, productName, specification, quantity, manufacturer, mdmCode,
|
|
|
|
- posMemberName, posMemberPhone, prescriptionType, prescriptionNumber, hospital, department,
|
|
|
|
- doctor, patientName, patientPhone, storeName, registrar, completionTime,lastUpdated, deliveryMethod, paymentCode,
|
|
|
|
- paymentMethod, status , createTime from s_dtp_cfdj_prescription
|
|
|
|
|
|
+ select * from s_dtp_cfdj_prescription
|
|
<where>
|
|
<where>
|
|
- <if test="id != null">AND id = #{id}</if>
|
|
|
|
|
|
+ <if test="id != null and id!=''">AND id = #{id}</if>
|
|
<if test="orderId != null and orderId!=''">AND orderId = #{orderId}</if>
|
|
<if test="orderId != null and orderId!=''">AND orderId = #{orderId}</if>
|
|
<if test="saleOrderNumber != null and saleOrderNumber!=''">AND saleOrderNumber = #{saleOrderNumber}</if>
|
|
<if test="saleOrderNumber != null and saleOrderNumber!=''">AND saleOrderNumber = #{saleOrderNumber}</if>
|
|
<if test="genericName != null and genericName!=''">AND genericName = #{genericName}</if>
|
|
<if test="genericName != null and genericName!=''">AND genericName = #{genericName}</if>
|
|
@@ -25,6 +22,8 @@
|
|
<if test="beginTime != null and beginTime!='' and endTime != null and endTime!=''">
|
|
<if test="beginTime != null and beginTime!='' and endTime != null and endTime!=''">
|
|
and createTime between #{beginTime} and #{endTime}
|
|
and createTime between #{beginTime} and #{endTime}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="orderTime != null and orderTime!=''">AND orderTime= #{orderTime}</if>
|
|
|
|
+ <if test="saleOrderTime != null and saleOrderTime!=''">AND saleOrderTime= #{saleOrderTime}</if>
|
|
<if test="prescriptionNumber != null and prescriptionNumber!=''">AND prescriptionNumber = #{prescriptionNumber}</if>
|
|
<if test="prescriptionNumber != null and prescriptionNumber!=''">AND prescriptionNumber = #{prescriptionNumber}</if>
|
|
<if test="hospital != null and hospital!=''">AND hospital = #{hospital}</if>
|
|
<if test="hospital != null and hospital!=''">AND hospital = #{hospital}</if>
|
|
<if test="department != null and department!=''">AND department = #{department}</if>
|
|
<if test="department != null and department!=''">AND department = #{department}</if>
|
|
@@ -40,7 +39,9 @@
|
|
<if test="paymentCode != null and paymentCode!=''">AND paymentCode = #{paymentCode}</if>
|
|
<if test="paymentCode != null and paymentCode!=''">AND paymentCode = #{paymentCode}</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">AND paymentMethod = #{paymentMethod}</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">AND paymentMethod = #{paymentMethod}</if>
|
|
<if test="status != null and status!=''">AND status = #{status}</if>
|
|
<if test="status != null and status!=''">AND status = #{status}</if>
|
|
|
|
+ <if test="isFlipItem != null and isFlipItem!=''">AND isFlipItem = #{isFlipItem}</if>
|
|
<if test="createTime != null and createTime!=''">AND createTime = #{createTime}</if>
|
|
<if test="createTime != null and createTime!=''">AND createTime = #{createTime}</if>
|
|
|
|
+
|
|
and del_flag = '0'
|
|
and del_flag = '0'
|
|
</where>
|
|
</where>
|
|
order by createTime desc
|
|
order by createTime desc
|
|
@@ -49,6 +50,7 @@
|
|
<insert id="insertRecipe" parameterType="pd">
|
|
<insert id="insertRecipe" parameterType="pd">
|
|
insert into s_dtp_cfdj_prescription
|
|
insert into s_dtp_cfdj_prescription
|
|
<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
|
+ <if test="id != null and id!=''">id,</if>
|
|
<if test="orderId != null and orderId!=''">orderId,</if>
|
|
<if test="orderId != null and orderId!=''">orderId,</if>
|
|
<if test="saleOrderNumber != null and saleOrderNumber!=''">saleOrderNumber,</if>
|
|
<if test="saleOrderNumber != null and saleOrderNumber!=''">saleOrderNumber,</if>
|
|
<if test="genericName != null and genericName!=''">genericName,</if>
|
|
<if test="genericName != null and genericName!=''">genericName,</if>
|
|
@@ -72,11 +74,17 @@
|
|
<if test="deliveryMethod != null and deliveryMethod!=''">deliveryMethod,</if>
|
|
<if test="deliveryMethod != null and deliveryMethod!=''">deliveryMethod,</if>
|
|
<if test="paymentCode != null and paymentCode!=''">paymentCode,</if>
|
|
<if test="paymentCode != null and paymentCode!=''">paymentCode,</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">paymentMethod,</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">paymentMethod,</if>
|
|
- <if test="status != null and status!=''">status},</if>
|
|
|
|
|
|
+ <if test="status != null and status!=''">status,</if>
|
|
|
|
+ <if test="isFlipItem != null and isFlipItem!=''">isFlipItem,</if>
|
|
<if test="lastUpdated != null and lastUpdated!=''">lastUpdated,</if>
|
|
<if test="lastUpdated != null and lastUpdated!=''">lastUpdated,</if>
|
|
<if test="createTime != null and createTime!=''">createTime,</if>
|
|
<if test="createTime != null and createTime!=''">createTime,</if>
|
|
|
|
+ <if test="orderTime != null and orderTime!=''">orderTime,</if>
|
|
|
|
+ <if test="saleOrderTime != null and saleOrderTime!=''">saleOrderTime,</if>
|
|
|
|
+
|
|
|
|
+
|
|
</trim>
|
|
</trim>
|
|
<trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
<trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
|
+ <if test="id != null and id!=''">#{id},</if>
|
|
<if test="orderId != null and orderId!=''">#{orderId},</if>
|
|
<if test="orderId != null and orderId!=''">#{orderId},</if>
|
|
<if test="saleOrderNumber != null and saleOrderNumber!=''">#{saleOrderNumber},</if>
|
|
<if test="saleOrderNumber != null and saleOrderNumber!=''">#{saleOrderNumber},</if>
|
|
<if test="genericName != null and genericName!=''">#{genericName},</if>
|
|
<if test="genericName != null and genericName!=''">#{genericName},</if>
|
|
@@ -101,17 +109,23 @@
|
|
<if test="paymentCode != null and paymentCode!=''">#{paymentCode},</if>
|
|
<if test="paymentCode != null and paymentCode!=''">#{paymentCode},</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">#{paymentMethod},</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">#{paymentMethod},</if>
|
|
<if test="status != null and status!=''">#{status},</if>
|
|
<if test="status != null and status!=''">#{status},</if>
|
|
|
|
+ <if test="isFlipItem != null and isFlipItem!=''">#{isFlipItem},</if>
|
|
<if test="lastUpdated != null and lastUpdated!=''">#{lastUpdated},</if>
|
|
<if test="lastUpdated != null and lastUpdated!=''">#{lastUpdated},</if>
|
|
<if test="createTime != null and createTime!=''">#{createTime},</if>
|
|
<if test="createTime != null and createTime!=''">#{createTime},</if>
|
|
|
|
+ <if test="orderTime != null and orderTime!=''">#{orderTime},</if>
|
|
|
|
+ <if test="saleOrderTime != null and saleOrderTime!=''">#{saleOrderTime},</if>
|
|
|
|
+
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
- <delete id="deleteRecipe" parameterType="pd">
|
|
|
|
- <if test="ids != null and ids!=''">
|
|
|
|
|
|
+ <delete id="deleteRecipe" parameterType="java.util.List">
|
|
|
|
+ <if test="list != null and list.size() > 0">
|
|
delete from s_dtp_cfdj_prescription
|
|
delete from s_dtp_cfdj_prescription
|
|
- where id in (${ids})
|
|
|
|
|
|
+ where id in
|
|
|
|
+ <foreach item="id" index="index" collection="list" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
</if>
|
|
</if>
|
|
-
|
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
<update id="updateRecipe" parameterType="pd">
|
|
<update id="updateRecipe" parameterType="pd">
|
|
@@ -141,19 +155,22 @@
|
|
<if test="paymentCode != null and paymentCode!=''">paymentCode=#{paymentCode},</if>
|
|
<if test="paymentCode != null and paymentCode!=''">paymentCode=#{paymentCode},</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">paymentMethod=#{paymentMethod},</if>
|
|
<if test="paymentMethod != null and paymentMethod!=''">paymentMethod=#{paymentMethod},</if>
|
|
<if test="status != null and status!=''">status=#{status},</if>
|
|
<if test="status != null and status!=''">status=#{status},</if>
|
|
|
|
+ <if test="isFlipItem != null and isFlipItem!=''">isFlipItem=#{isFlipItem},</if>
|
|
<if test="lastUpdated != null and lastUpdated!=''">lastUpdated=#{lastUpdated},</if>
|
|
<if test="lastUpdated != null and lastUpdated!=''">lastUpdated=#{lastUpdated},</if>
|
|
<if test="createTime != null and createTime!=''">createTime=#{createTime},</if>
|
|
<if test="createTime != null and createTime!=''">createTime=#{createTime},</if>
|
|
|
|
+ <if test="orderTime != null and orderTime!=''">orderTime=#{orderTime},</if>
|
|
|
|
+ <if test="saleOrderTime != null and saleOrderTime!=''">saleOrderTime=#{saleOrderTime},</if>
|
|
</trim>
|
|
</trim>
|
|
where id=#{id}
|
|
where id=#{id}
|
|
</update>
|
|
</update>
|
|
<select id="checkPatientNameAndPhoneUnique" parameterType="pd" resultType="pd">
|
|
<select id="checkPatientNameAndPhoneUnique" parameterType="pd" resultType="pd">
|
|
- select patientName, patientPhone from s_dtp_cfdj_prescription where patientName=#{patientName} and patientPhone=#{patientPhone} and del_flag = '0' limit 1
|
|
|
|
|
|
+ select name, phoneNumber from s_dtp_ysfw_archive_management where name=#{name} and phoneNumber=#{phoneNumber} and del_flag = '0' limit 1
|
|
|
|
+ </select>
|
|
|
|
+ <select id="checkPatientNameAndIdCardUnique" parameterType="pd" resultType="pd">
|
|
|
|
+ select documentNumber, name from s_dtp_ysfw_archive_management where documentNumber=#{documentNumber} and name=#{name} and del_flag = '0' limit 1
|
|
</select>
|
|
</select>
|
|
<select id="selectOne" parameterType="pd" resultType="pd">
|
|
<select id="selectOne" parameterType="pd" resultType="pd">
|
|
- select id, orderId, saleOrderNumber, genericName, productName, specification, quantity, manufacturer, mdmCode,
|
|
|
|
- posMemberName, posMemberPhone, prescriptionType, prescriptionNumber, hospital, department,
|
|
|
|
- doctor, patientName, patientPhone, storeName, registrar, completionTime, lastUpdated,deliveryMethod, paymentCode,
|
|
|
|
- paymentMethod, status ,createTime from s_dtp_cfdj_prescription where id=#{id}
|
|
|
|
|
|
+ select * from s_dtp_cfdj_prescription where id=#{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
@@ -433,27 +450,10 @@
|
|
</if>
|
|
</if>
|
|
</update>
|
|
</update>
|
|
|
|
|
|
- <!--配置信息查询模块-->
|
|
|
|
|
|
+ <!--配置信息查询模块一店一目-->
|
|
<select id="StoreProductList" parameterType="pd" resultType="pd">
|
|
<select id="StoreProductList" parameterType="pd" resultType="pd">
|
|
select
|
|
select
|
|
- id,
|
|
|
|
- createdBy,
|
|
|
|
- createdDate,
|
|
|
|
- storeId,
|
|
|
|
- storeCode,
|
|
|
|
- storeName,
|
|
|
|
- mdmCode,
|
|
|
|
- genericName,
|
|
|
|
- productName,
|
|
|
|
- manufacturer,
|
|
|
|
- specification,
|
|
|
|
- isPrescriptionItem,
|
|
|
|
- isFlipItem,
|
|
|
|
- isFollowUpItem,
|
|
|
|
- isMandatoryRegistration,
|
|
|
|
- isColdChainItem,
|
|
|
|
- create_time as createTime,
|
|
|
|
- updatedAt
|
|
|
|
|
|
+ *
|
|
from s_dtp_pzxx_store_product_list
|
|
from s_dtp_pzxx_store_product_list
|
|
<where>
|
|
<where>
|
|
<if test="id != null">AND id = #{id}</if>
|
|
<if test="id != null">AND id = #{id}</if>
|
|
@@ -479,21 +479,27 @@
|
|
AND updatedAt BETWEEN #{updatedAt_start} AND #{updatedAt_end}
|
|
AND updatedAt BETWEEN #{updatedAt_start} AND #{updatedAt_end}
|
|
</if>
|
|
</if>
|
|
<if test="query != null and query != ''">
|
|
<if test="query != null and query != ''">
|
|
- AND (genericName LIKE CONCAT('%', #{query}, '%') OR productName LIKE CONCAT('%', #{query}, '%'))
|
|
|
|
|
|
+ AND (genericName LIKE CONCAT('%', #{query}, '%') OR productName LIKE CONCAT('%', #{query}, '%') OR mdmCode LIKE CONCAT('%', #{query}, '%'))
|
|
</if>
|
|
</if>
|
|
AND del_flag = '0'
|
|
AND del_flag = '0'
|
|
</where>
|
|
</where>
|
|
order by create_time desc
|
|
order by create_time desc
|
|
</select>
|
|
</select>
|
|
|
|
+ <!--配置信息删除 一店一目-->
|
|
|
|
+ <delete id="deleteProductList" parameterType="java.util.List">
|
|
|
|
+ <if test="list != null and list.size() > 0">
|
|
|
|
+ delete from s_dtp_pzxx_store_product_list
|
|
|
|
+ where id in
|
|
|
|
+ <foreach item="id" index="index" collection="list" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+
|
|
<select id="HospitalList" parameterType="pd" resultType="pd">
|
|
<select id="HospitalList" parameterType="pd" resultType="pd">
|
|
select
|
|
select
|
|
- id,
|
|
|
|
- createdBy,
|
|
|
|
- standardName,
|
|
|
|
- address,
|
|
|
|
- phone,
|
|
|
|
- create_time as createTime,
|
|
|
|
- updated_time as updatedTime
|
|
|
|
|
|
+ *
|
|
from s_dtp_pzxx_hospital_list
|
|
from s_dtp_pzxx_hospital_list
|
|
<where>
|
|
<where>
|
|
<if test="id != null and id != ''">AND id = #{id}</if>
|
|
<if test="id != null and id != ''">AND id = #{id}</if>
|
|
@@ -514,4 +520,300 @@
|
|
order by create_time desc
|
|
order by create_time desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 查询处方药品信息 -->
|
|
|
|
+ <select id="selectPrescriptionDrugs" parameterType="pd" resultType="pd">
|
|
|
|
+ SELECT * FROM s_dtp_cfdj_prescription_drug WHERE 1=1
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ AND id = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="productName != null and productName != ''">
|
|
|
|
+ AND productName =#{productName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="genericName != null and genericName != ''">
|
|
|
|
+ AND genericName = #{genericName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="prescriptionNumber != null and prescriptionNumber != ''">
|
|
|
|
+ AND prescriptionNumber = #{prescriptionNumber}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="drugCode != null and drugCode != ''">
|
|
|
|
+ AND drugCode = #{drugCode}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="specification != null and specification != ''">
|
|
|
|
+ AND specification= #{specification}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="usageMethod != null and usageMethod != ''">
|
|
|
|
+ AND usageMethod = #{usageMethod}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="quantity != null">
|
|
|
|
+ AND quantity = #{quantity}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="frequency != null and frequency != ''">
|
|
|
|
+ AND frequency = #{frequency}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="wordUsage != null and wordUsage != ''">
|
|
|
|
+ AND wordUsage = #{wordUsage}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="medicationCycle != null and medicationCycle != ''">
|
|
|
|
+ AND medicationCycle = #{medicationCycle}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="mdmCode != null and mdmCode != ''">
|
|
|
|
+ AND mdmCode = #{mdmCode}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dosage != null and dosage != ''">
|
|
|
|
+ AND dosage = #{dosage}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="indication != null and indication != ''">
|
|
|
|
+ AND indication= #{indication}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sideEffects != null and sideEffects != ''">
|
|
|
|
+ AND sideEffects =#{sideEffects}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="creator != null and creator != ''">
|
|
|
|
+ AND creator = #{creator}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ AND createTime = #{createTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ AND status = #{status}
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 插入处方药品信息 -->
|
|
|
|
+ <insert id="insertPrescriptionDrug" parameterType="pd">
|
|
|
|
+ INSERT INTO s_dtp_cfdj_prescription_drug
|
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
|
+ <if test="productName != null and productName != ''">productName,</if>
|
|
|
|
+ <if test="genericName != null and genericName != ''">genericName,</if>
|
|
|
|
+ <if test="prescriptionNumber != null and prescriptionNumber != ''">prescriptionNumber,</if>
|
|
|
|
+ <if test="drugCode != null and drugCode != ''">drugCode,</if>
|
|
|
|
+ <if test="specification != null and specification != ''">specification,</if>
|
|
|
|
+ <if test="usageMethod != null and usageMethod != ''">usageMethod,</if>
|
|
|
|
+ <if test="quantity != null">quantity,</if>
|
|
|
|
+ <if test="frequency != null and frequency != ''">frequency,</if>
|
|
|
|
+ <if test="wordUsage != null and wordUsage != ''">wordUsage,</if>
|
|
|
|
+ <if test="medicationCycle != null and medicationCycle != ''">medicationCycle,</if>
|
|
|
|
+ <if test="mdmCode != null and mdmCode != ''">mdmCode,</if>
|
|
|
|
+ <if test="dosage != null and dosage != ''">dosage,</if>
|
|
|
|
+ <if test="indication != null and indication != ''">indication,</if>
|
|
|
|
+ <if test="sideEffects != null and sideEffects != ''">sideEffects,</if>
|
|
|
|
+ <if test="creator != null and creator != ''">creator,</if>
|
|
|
|
+ <if test="createTime != null">createTime,</if>
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
+ <if test="isFlipItem != null">isFlipItem,</if>
|
|
|
|
+ <if test="remarks != null and remarks != ''">remarks</if>
|
|
|
|
+ </trim>
|
|
|
|
+ VALUES
|
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
|
+ <if test="productName != null and productName != ''">#{productName},</if>
|
|
|
|
+ <if test="genericName != null and genericName != ''">#{genericName},</if>
|
|
|
|
+ <if test="prescriptionNumber != null and prescriptionNumber != ''">#{prescriptionNumber},</if>
|
|
|
|
+ <if test="drugCode != null and drugCode != ''">#{drugCode},</if>
|
|
|
|
+ <if test="specification != null and specification != ''">#{specification},</if>
|
|
|
|
+ <if test="usageMethod != null and usageMethod != ''">#{usageMethod},</if>
|
|
|
|
+ <if test="quantity != null">#{quantity},</if>
|
|
|
|
+ <if test="frequency != null and frequency != ''">#{frequency},</if>
|
|
|
|
+ <if test="wordUsage != null and wordUsage != ''">#{wordUsage},</if>
|
|
|
|
+ <if test="medicationCycle != null and medicationCycle != ''">#{medicationCycle},</if>
|
|
|
|
+ <if test="mdmCode != null and mdmCode != ''">#{mdmCode},</if>
|
|
|
|
+ <if test="dosage != null and dosage != ''">#{dosage},</if>
|
|
|
|
+ <if test="indication != null and indication != ''">#{indication},</if>
|
|
|
|
+ <if test="sideEffects != null and sideEffects != ''">#{sideEffects},</if>
|
|
|
|
+ <if test="creator != null and creator != ''">#{creator},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
+ <if test="isFlipItem != null">#{isFlipItem},</if>
|
|
|
|
+
|
|
|
|
+ <if test="remarks != null and remarks != ''">#{remarks}</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+ <!-- 批量插入处方药品信息 -->
|
|
|
|
+ <insert id="batchAddPrescriptionDrug" parameterType="java.util.List" useGeneratedKeys="false">
|
|
|
|
+ INSERT INTO s_dtp_cfdj_prescription_drug
|
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
|
+ <if test="dataList[0].productName != null and dataList[0].productName != ''">productName,</if>
|
|
|
|
+ <if test="dataList[0].genericName != null and dataList[0].genericName != ''">genericName,</if>
|
|
|
|
+ <if test="dataList[0].prescriptionNumber != null and dataList[0].prescriptionNumber != ''">prescriptionNumber,</if>
|
|
|
|
+ <if test="dataList[0].drugCode != null and dataList[0].drugCode != ''">drugCode,</if>
|
|
|
|
+ <if test="dataList[0].specification != null and dataList[0].specification != ''">specification,</if>
|
|
|
|
+ <if test="dataList[0].usageMethod != null and dataList[0].usageMethod != ''">usageMethod,</if>
|
|
|
|
+ <if test="dataList[0].quantity != null">quantity,</if>
|
|
|
|
+ <if test="dataList[0].frequency != null and dataList[0].frequency != ''">frequency,</if>
|
|
|
|
+ <if test="dataList[0].wordUsage != null and dataList[0].wordUsage != ''">wordUsage,</if>
|
|
|
|
+ <if test="dataList[0].medicationCycle != null and dataList[0].medicationCycle != ''">medicationCycle,</if>
|
|
|
|
+ <if test="dataList[0].mdmCode != null and dataList[0].mdmCode != ''">mdmCode,</if>
|
|
|
|
+ <if test="dataList[0].dosage != null and dataList[0].dosage != ''">dosage,</if>
|
|
|
|
+ <if test="dataList[0].indication != null and dataList[0].indication != ''">indication,</if>
|
|
|
|
+ <if test="dataList[0].sideEffects != null and dataList[0].sideEffects != ''">sideEffects,</if>
|
|
|
|
+ <if test="dataList[0].creator != null and dataList[0].creator != ''">creator,</if>
|
|
|
|
+ <if test="dataList[0].createTime != null">createTime,</if>
|
|
|
|
+ <if test="dataList[0].status != null">status,</if>
|
|
|
|
+ <if test="dataList[0].isFlipItem != null and dataList[0].isFlipItem != ''">isFlipItem,</if>
|
|
|
|
+ <if test="dataList[0].remarks != null and dataList[0].remarks != ''">remarks</if>
|
|
|
|
+ </trim>
|
|
|
|
+ VALUES
|
|
|
|
+ <foreach item="item" index="index" collection="dataList" separator=",">
|
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
|
+ <if test="item.productName != null and item.productName != ''">#{item.productName},</if>
|
|
|
|
+ <if test="item.genericName != null and item.genericName != ''">#{item.genericName},</if>
|
|
|
|
+ <if test="item.prescriptionNumber != null and item.prescriptionNumber != ''">#{item.prescriptionNumber},</if>
|
|
|
|
+ <if test="item.drugCode != null and item.drugCode != ''">#{item.drugCode},</if>
|
|
|
|
+ <if test="item.specification != null and item.specification != ''">#{item.specification},</if>
|
|
|
|
+ <if test="item.usageMethod != null and item.usageMethod != ''">#{item.usageMethod},</if>
|
|
|
|
+ <if test="item.quantity != null">#{item.quantity},</if>
|
|
|
|
+ <if test="item.frequency != null and item.frequency != ''">#{item.frequency},</if>
|
|
|
|
+ <if test="item.wordUsage != null and item.wordUsage != ''">#{item.wordUsage},</if>
|
|
|
|
+ <if test="item.medicationCycle != null and item.medicationCycle != ''">#{item.medicationCycle},</if>
|
|
|
|
+ <if test="item.mdmCode != null and item.mdmCode != ''">#{item.mdmCode},</if>
|
|
|
|
+ <if test="item.dosage != null and item.dosage != ''">#{item.dosage},</if>
|
|
|
|
+ <if test="item.indication != null and item.indication != ''">#{item.indication},</if>
|
|
|
|
+ <if test="item.sideEffects != null and item.sideEffects != ''">#{item.sideEffects},</if>
|
|
|
|
+ <if test="item.creator != null and item.creator != ''">#{item.creator},</if>
|
|
|
|
+ <if test="item.createTime != null">#{item.createTime},</if>
|
|
|
|
+ <if test="item.status != null">#{item.status},</if>
|
|
|
|
+ <if test="item.isFlipItem != null and item.isFlipItem != ''">#{item.isFlipItem},</if>
|
|
|
|
+ <if test="item.remarks != null and item.remarks != ''">#{item.remarks}</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </foreach>
|
|
|
|
+ </insert>
|
|
|
|
+ <!-- 批量修改处方药品信息 -->
|
|
|
|
+ <update id="batchUpdatePrescriptionDrug" parameterType="java.util.List">
|
|
|
|
+ <foreach item="item" index="index" collection="list" separator=";">
|
|
|
|
+ UPDATE s_dtp_cfdj_prescription_drug
|
|
|
|
+ SET
|
|
|
|
+ <trim prefix="" suffixOverrides=",">
|
|
|
|
+ <if test="item.productName != null and item.productName != ''">
|
|
|
|
+ productName = #{item.productName},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.genericName != null and item.genericName != ''">
|
|
|
|
+ genericName = #{item.genericName},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.drugCode != null and item.drugCode != ''">
|
|
|
|
+ drugCode = #{item.drugCode},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.specification != null and item.specification != ''">
|
|
|
|
+ specification = #{item.specification},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.usageMethod != null and item.usageMethod != ''">
|
|
|
|
+ usageMethod = #{item.usageMethod},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.quantity != null">
|
|
|
|
+ quantity = #{item.quantity},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.frequency != null and item.frequency != ''">
|
|
|
|
+ frequency = #{item.frequency},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.wordUsage != null and item.wordUsage != ''">
|
|
|
|
+ wordUsage = #{item.wordUsage},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.medicationCycle != null and item.medicationCycle != ''">
|
|
|
|
+ medicationCycle = #{item.medicationCycle},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.mdmCode != null and item.mdmCode != ''">
|
|
|
|
+ mdmCode = #{item.mdmCode},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.dosage != null and item.dosage != ''">
|
|
|
|
+ dosage = #{item.dosage},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.indication != null and item.indication != ''">
|
|
|
|
+ indication = #{item.indication},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.sideEffects != null and item.sideEffects != ''">
|
|
|
|
+ sideEffects = #{item.sideEffects},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.creator != null and item.creator != ''">
|
|
|
|
+ creator = #{item.creator},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.createTime != null">
|
|
|
|
+ createTime = #{item.createTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.status != null">
|
|
|
|
+ status = #{item.status},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.isFlipItem != null and item.isFlipItem != ''">
|
|
|
|
+ isFlipItem = #{item.isFlipItem},
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ <if test="item.remarks != null and item.remarks != ''">
|
|
|
|
+ remarks = #{item.remarks}
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ WHERE prescriptionNumber = #{item.prescriptionId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <!-- 更新处方药品信息 -->
|
|
|
|
+ <update id="updatePrescriptionDrug" parameterType="pd">
|
|
|
|
+ UPDATE s_dtp_cfdj_prescription_drug SET
|
|
|
|
+ <trim prefix="" suffixOverrides="," prefixOverrides=",">
|
|
|
|
+ <if test="productName != null and productName != ''">
|
|
|
|
+ productName = #{productName},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="genericName != null and genericName != ''">
|
|
|
|
+ genericName = #{genericName},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="prescriptionNumber != null and prescriptionNumber != ''">
|
|
|
|
+ prescriptionNumber = #{prescriptionNumber},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="drugCode != null and drugCode != ''">
|
|
|
|
+ drugCode = #{drugCode},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="specification != null and specification != ''">
|
|
|
|
+ specification = #{specification},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="usageMethod != null and usageMethod != ''">
|
|
|
|
+ usageMethod = #{usageMethod},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="quantity != null">
|
|
|
|
+ quantity = #{quantity},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="frequency != null and frequency != ''">
|
|
|
|
+ frequency = #{frequency},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="wordUsage != null and wordUsage != ''">
|
|
|
|
+ wordUsage = #{wordUsage},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="medicationCycle != null and medicationCycle != ''">
|
|
|
|
+ medicationCycle = #{medicationCycle},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="mdmCode != null and mdmCode != ''">
|
|
|
|
+ mdmCode = #{mdmCode},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dosage != null and dosage != ''">
|
|
|
|
+ dosage = #{dosage},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="indication != null and indication != ''">
|
|
|
|
+ indication = #{indication},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sideEffects != null and sideEffects != ''">
|
|
|
|
+ sideEffects = #{sideEffects},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="creator != null and creator != ''">
|
|
|
|
+ creator = #{creator},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ createTime = #{createTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ status = #{status},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="isFlipItem != null and isFlipItem != ''">
|
|
|
|
+ isFlipItem = #{isFlipItem},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
|
+ remarks = #{remarks}
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <!-- 删除处方药品信息 -->
|
|
|
|
+ <update id="deletePrescriptionDrug" parameterType="pd">
|
|
|
|
+ DELETE FROM s_dtp_cfdj_prescription_drug WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|