select btm.obj_id,
btm.team_code,
btm.team_name,
btm.team_head,
btm.station_code,
bpl.product_line_name station_name,
btm.classes,
btm.start_time,
btm.end_time,
btm.dine_time,
btm.is_flag,
btm.create_by,
btm.create_time,
btm.update_by,
btm.update_time,
btm.machine_code,
bdl.device_name machine_name
from base_team_members btm
left join base_product_line bpl on bpl.product_line_code = btm.station_code
left join base_device_ledger bdl on bdl.device_code = btm.machine_code
insert into base_team_members
team_code,
team_name,
team_head,
station_code,
classes,
start_time,
end_time,
dine_time,
is_flag,
create_by,
create_time,
update_by,
update_time,
machine_code,
#{teamCode},
#{teamName},
#{teamHead},
#{stationCode},
#{classes},
#{startTime},
#{endTime},
#{dineTime},
#{isFlag},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{machineCode},
update base_team_members
team_code = #{teamCode},
team_name = #{teamName},
team_head = #{teamHead},
station_code = #{stationCode},
classes = #{classes},
start_time = #{startTime},
end_time = #{endTime},
dine_time = #{dineTime},
is_flag = #{isFlag},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
machine_code = #{machineCode},
where obj_id = #{objId}
delete
from base_team_members
where obj_id = #{objId}
delete from base_team_members where obj_id in
#{objId}