select id, company_id, model_id, model_name, "CONTEXT", start_time, model_version, valid_flag, del_flag, create_by, creator_id, create_time, update_by, updator_id, update_time, remark from model_history
and model_id = #{modelId}
and model_name like concat('%', #{modelName}, '%')
and "CONTEXT" = #{context}
and start_time = #{startTime}
and model_version = #{modelVersion}
and valid_flag = #{validFlag}
and del_flag = #{delFlag}
and creator_id = #{creatorId}
and updator_id = #{updatorId}
order by create_time desc
where id = #{id}
where model_id = #{modelId}
insert into model_history company_id, model_id, model_name, "CONTEXT", start_time, model_version, valid_flag, del_flag, create_by, creator_id, create_time, update_by, updator_id, update_time, remark, #{companyId}, #{modelId}, #{modelName}, #{context}, #{startTime}, #{modelVersion}, #{validFlag}, #{delFlag}, #{createBy}, #{creatorId}, #{createTime}, #{updateBy}, #{updatorId}, #{updateTime}, #{remark},
update model_history company_id = #{companyId}, model_id = #{modelId}, model_name = #{modelName}, "CONTEXT" = #{context}, start_time = #{startTime}, model_version = #{modelVersion}, valid_flag = #{validFlag}, del_flag = #{delFlag}, create_by = #{createBy}, creator_id = #{creatorId}, create_time = #{createTime}, update_by = #{updateBy}, updator_id = #{updatorId}, update_time = #{updateTime}, remark = #{remark}, where id = #{id}
update model_history set del_flag = 1 where id = #{id}
update model_history set del_flag = 1 where id in #{id}