select
a.id,
a.medicine_id,
a.quantity,
a.usage,
a.age_weight,
a.production_date,
a.expiring_date,
a.purchase_date,
a.purchase_price,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.code,
a.state,
a.left_count,
a.used_count,
a.purchase_address,
a.unit,
a.total_price,
hmb."name" as medicine_name,
a.package_unit,
a.total_count
from
health_medicine_stock_in a
left join health_medicine_basic hmb on
hmb.id = a.medicine_id
insert into health_medicine_stock_in
id,
medicine_id,
quantity,
production_date,
expiring_date,
purchase_date,
purchase_price,
create_by,
create_time,
update_by,
update_time,
del_flag,
remark,
code,
state,
left_count,
used_count,
purchase_address,
total_price,
usage,
age_weight,
unit,
package_unit,
total_count,
#{id},
#{medicineId},
#{quantity},
#{productionDate},
#{expiringDate},
#{purchaseDate},
#{purchasePrice},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{delFlag},
#{remark},
#{code},
#{state},
#{leftCount},
#{usedCount},
#{purchaseAddress},
#{totalPrice},
#{usage},
#{ageWeight},
#{unit},
#{packageUnit},
#{packageUnit},
update health_medicine_stock_in
medicine_id = #{medicineId},
quantity = #{quantity},
production_date = #{productionDate},
expiring_date = #{expiringDate},
purchase_date = #{purchaseDate},
purchase_price = #{purchasePrice},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
del_flag = #{delFlag},
remark = #{remark},
code = #{code},
state = #{state},
left_count = #{leftCount},
used_count = #{usedCount},
purchase_address = #{purchaseAddress},
total_price = #{totalPrice},
usage = #{usage},
age_weight = #{ageWeight},
unit = #{unit},
package_unit = #{packageUnit},
total_count = #{packageUnit},
where id = #{id}
delete from health_medicine_stock_in where id = #{id}
delete from health_medicine_stock_in where id in
#{id}
update health_medicine_stock_in set del_flag='1' where id = #{id}
update health_medicine_stock_in set del_flag='1' where id in
#{id}