package net.wicp.tams.app.duckula.controller.dao;

import java.util.List;

import net.wicp.tams.app.duckula.controller.bean.models.CommonDeploy;
import net.wicp.tams.app.duckula.controller.bean.models.CommonDump;
import net.wicp.tams.app.duckula.controller.bean.models.CommonDumpExample;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

public interface CommonDumpMapper extends BaseMapper<CommonDump> {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	long countByExample(CommonDumpExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	int deleteByExample(CommonDumpExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	@Delete({ "delete from common_dump", "where id = #{id,jdbcType=BIGINT}" })
	int deleteByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	@Insert({ "insert into common_dump (id, name, ", "rule, version_id, ", "deploy_id, user_id, ",
			"middleware_id, instance_id, ", "attr_config, tenant_id)",
			"values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
			"#{rule,jdbcType=VARCHAR}, #{versionId,jdbcType=BIGINT}, ",
			"#{deployId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
			"#{middlewareId,jdbcType=BIGINT}, #{instanceId,jdbcType=BIGINT}, ",
			"#{attrConfig,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})" })
	int insert(CommonDump record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	int insertSelective(CommonDump record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	List<CommonDump> selectByExample(CommonDumpExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	@Select({ "select", "id, name, rule, version_id, deploy_id, user_id, middleware_id, instance_id, ",
			"attr_config, tenant_id", "from common_dump", "where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.CommonDumpMapper.BaseResultMap")
	CommonDump selectByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	int updateByExampleSelective(@Param("record") CommonDump record, @Param("example") CommonDumpExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	int updateByExample(@Param("record") CommonDump record, @Param("example") CommonDumpExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	int updateByPrimaryKeySelective(CommonDump record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_dump
	 * @mbg.generated
	 */
	@Update({ "update common_dump", "set name = #{name,jdbcType=VARCHAR},", "rule = #{rule,jdbcType=VARCHAR},",
			"version_id = #{versionId,jdbcType=BIGINT},", "deploy_id = #{deployId,jdbcType=BIGINT},",
			"user_id = #{userId,jdbcType=BIGINT},", "middleware_id = #{middlewareId,jdbcType=BIGINT},",
			"instance_id = #{instanceId,jdbcType=BIGINT},", "attr_config = #{attrConfig,jdbcType=VARCHAR},",
			"tenant_id = #{tenantId,jdbcType=BIGINT}", "where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(CommonDump record);
}