blob: fcc7dc98704fbe71686709e84a5abd1c076511ef [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.eventmesh.dashboard.console.mapper.log;
import org.apache.eventmesh.dashboard.console.entity.log.LogEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* operate operationLog mapper
**/
@Mapper
public interface OprLogMapper {
@Select({
"<script>",
" SELECT * FROM operation_log",
" <where>",
" <if test='targetType!=null'>",
" target_type=#{operationType}",
" </if>",
" <if test='operationUser!=null'>",
" AND operation_user=#{operationUser}",
" </if>",
" <if test='clusterId!=null'>",
" AND cluster_id=#{clusterId} ",
" </if>",
" AND is_delete=0",
" </where>",
"</script>"})
List<LogEntity> getLogList(LogEntity logEntity);
@Insert("INSERT INTO operation_log ( cluster_id, operation_type,target_Type, content,operation_user,result)"
+ "VALUE (#{clusterId},#{operationType},#{targetType},#{content},#{operationUser},#{result})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
Long addLog(LogEntity logEntity);
@Update("UPDATE operation_log SET status=#{status} ,result=#{resultContent} WHERE id=#{id}")
Integer updateLog(LogEntity logEntity);
}