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
insert into healthcare_os_prescription_details
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,
#{patientDiagnosisId},
#{singular},
#{medicineId},
#{medicineName},
#{specification},
#{usageValue},
#{dosageValue},
#{frequency},
#{eatingTime},
#{eatingDays},
#{splitUnit},
#{totalQuantity},
CAST(ROUND(#{unitPrice}, 2) AS DECIMAL(10, 2)),
CAST(ROUND(#{totalPrice}, 2) AS DECIMAL(10, 2)),
#{isSplit},
#{unitQuantity},
#{packageUnit},
#{remarks},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{batch},
#{expiryDate},
update healthcare_os_prescription_details
patient_diagnosis_id = #{patientDiagnosisId},
singular = #{singular},
medicine_id = #{medicineId},
medicine_name = #{medicineName},
specification = #{specification},
usage_value = #{usageValue},
dosage_value = #{dosageValue},
frequency = #{frequency},
eating_time = #{eatingTime},
eating_days = #{eatingDays},
split_unit = #{splitUnit},
total_quantity = #{totalQuantity},
unit_price = #{unitPrice},
total_price = #{totalPrice},
is_split = #{isSplit},
unit_quantity = #{unitQuantity},
package_unit = #{packageUnit},
remarks = #{remarks},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
batch = #{batch},
expiry_date = #{expiryDate},
where id = #{id}
delete from healthcare_os_prescription_details where id = #{id}
delete from healthcare_os_prescription_details where
and patient_diagnosis_id = #{patientDiagnosisId}
and singular = #{singular}
and medicine_id = #{medicineId}
and medicine_name = #{medicineName}
and specification = #{specification}
and usage_value = #{usageValue}
and dosage_value = #{dosageValue}
and frequency = #{frequency}
and eating_time = #{eatingTime}
and eating_days = #{eatingDays}
and split_unit = #{splitUnit}
and total_quantity = #{totalQuantity}
and unit_price = #{unitPrice}
and total_price = #{totalPrice}
and is_split = #{isSplit}
and unit_qantity = #{unitQuantity}
and package_unit = #{packageUnit}
and remarks = #{remarks}
and batch = #{batch}
and expiry_date = #{expiryDate}
delete from healthcare_os_prescription_details where id in
#{id}