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

import java.util.List;

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;

import net.wicp.tams.app.duckula.controller.bean.models.CommonCheckpoint;
import net.wicp.tams.app.duckula.controller.bean.models.CommonCheckpointExample;

public interface CommonCheckpointMapper extends BaseMapper<CommonCheckpoint> {

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_checkpoint
	 * @mbg.generated
	 */
	@Insert({ "insert into common_checkpoint (id, name, ", "checkpoint_type, host, ", "port, default_db, ",
			"username, password, ", "user_id, com_id, remark, ", "tenant_id, create_by, ", "create_time, update_by, ",
			"update_time)", "values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
			"#{checkpointType,jdbcType=VARCHAR}, #{host,jdbcType=VARCHAR}, ",
			"#{port,jdbcType=INTEGER}, #{defaultDb,jdbcType=VARCHAR}, ",
			"#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, ",
			"#{userId,jdbcType=VARCHAR}, #{comId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, ",
			"#{tenantId,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR}, ",
			"#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, ", "#{updateTime,jdbcType=TIMESTAMP})" })
	int insert(CommonCheckpoint record);

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_checkpoint
	 * @mbg.generated
	 */
	@Select({ "select", "id, name, checkpoint_type, host, port, default_db, username, password, user_id, ",
			"com_id, remark, tenant_id, create_by, create_time, update_by, update_time", "from common_checkpoint",
			"where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.CommonCheckpointMapper.BaseResultMap")
	CommonCheckpoint selectByPrimaryKey(Long id);

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_checkpoint
	 * @mbg.generated
	 */
	@Update({ "update common_checkpoint", "set name = #{name,jdbcType=VARCHAR},",
			"checkpoint_type = #{checkpointType,jdbcType=VARCHAR},", "host = #{host,jdbcType=VARCHAR},",
			"port = #{port,jdbcType=INTEGER},", "default_db = #{defaultDb,jdbcType=VARCHAR},",
			"username = #{username,jdbcType=VARCHAR},", "password = #{password,jdbcType=VARCHAR},",
			"user_id = #{userId,jdbcType=VARCHAR},", "com_id = #{comId,jdbcType=VARCHAR},",
			"remark = #{remark,jdbcType=VARCHAR},", "tenant_id = #{tenantId,jdbcType=BIGINT},",
			"create_by = #{createBy,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
			"update_by = #{updateBy,jdbcType=VARCHAR},", "update_time = #{updateTime,jdbcType=TIMESTAMP}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(CommonCheckpoint record);
}