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 COMPANY_ID = #{companyId}
and MODEL_ID = #{modelId}
and MODEL_NAME like concat('%', #{modelName}, '%')
and CONTEXT = #{context}
and START_TIME = #{startTime}
and MODEL_VERSION = #{modelVersion}
and CREATE_TIME = #{createTime}
where ID = #{id}
insert into MODEL_HISTORY 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, #{id}, #{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}
delete from MODEL_HISTORY where ID = #{id}
delete from MODEL_HISTORY where ID in #{id}