oracle 从一张表的数据复制到另一张表中 mapper.xml

时间:2022-04-19 22:17:32

例如:

<insert id="insertBatchcardDeviceLog" useGeneratedKeys="false">
insert into tf_ord_batchcard_device_log
(device_seq,
device_code,
device_state,
update_date,
occupy_order_id,
occupy_date,
log_date,
oper_staff_id)
select device_seq,
device_code,
device_state,
update_date,
occupy_order_id,
occupy_date,
sysdate,
'system'
from tf_ord_batchcard_device
where device_code =#{device_code}
</insert>

就是从tf_ord_batchcard_device查出来插入到tf_ord_batchcard_device_log表中、注意两个表的类型一样要对应。