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.CommonDeploy;
import net.wicp.tams.app.duckula.controller.bean.models.CommonDeployExample;

public interface CommonDeployMapper extends BaseMapper<CommonDeploy> {

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_deploy
	 * @mbg.generated
	 */
	@Insert({ "insert into common_deploy (id, name, ", "deploy, env, namespace, ", "url, token, user_id, ",
			"host, port, pwd_duckula, ", "hostsconfig, is_init, ", "docker_login, is_default, ", "version_id, remark, ",
			"tenant_id, config)", "values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
			"#{deploy,jdbcType=VARCHAR}, #{env,jdbcType=VARCHAR}, #{namespace,jdbcType=VARCHAR}, ",
			"#{url,jdbcType=VARCHAR}, #{token,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ",
			"#{host,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER}, #{pwdDuckula,jdbcType=VARCHAR}, ",
			"#{hostsconfig,jdbcType=VARCHAR}, #{isInit,jdbcType=VARCHAR}, ",
			"#{dockerLogin,jdbcType=VARCHAR}, #{isDefault,jdbcType=VARCHAR}, ",
			"#{versionId,jdbcType=BIGINT}, #{remark,jdbcType=VARCHAR}, ",
			"#{tenantId,jdbcType=BIGINT}, #{config,jdbcType=LONGVARCHAR})" })
	int insert(CommonDeploy record);

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_deploy
	 * @mbg.generated
	 */
	List<CommonDeploy> selectByExampleWithBLOBs(CommonDeployExample example);

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_deploy
	 * @mbg.generated
	 */
	@Select({ "select", "id, name, deploy, env, namespace, url, token, user_id, host, port, pwd_duckula, ",
			"hostsconfig, is_init, docker_login, is_default, version_id, remark, tenant_id, ", "config",
			"from common_deploy", "where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.CommonDeployMapper.ResultMapWithBLOBs")
	CommonDeploy selectByPrimaryKey(Long id);

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_deploy
	 * @mbg.generated
	 */
	int updateByExampleWithBLOBs(@Param("record") CommonDeploy record, @Param("example") CommonDeployExample example);

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_deploy
	 * @mbg.generated
	 */
	@Update({ "update common_deploy", "set name = #{name,jdbcType=VARCHAR},", "deploy = #{deploy,jdbcType=VARCHAR},",
			"env = #{env,jdbcType=VARCHAR},", "namespace = #{namespace,jdbcType=VARCHAR},",
			"url = #{url,jdbcType=VARCHAR},", "token = #{token,jdbcType=VARCHAR},",
			"user_id = #{userId,jdbcType=BIGINT},", "host = #{host,jdbcType=VARCHAR},",
			"port = #{port,jdbcType=INTEGER},", "pwd_duckula = #{pwdDuckula,jdbcType=VARCHAR},",
			"hostsconfig = #{hostsconfig,jdbcType=VARCHAR},", "is_init = #{isInit,jdbcType=VARCHAR},",
			"docker_login = #{dockerLogin,jdbcType=VARCHAR},", "is_default = #{isDefault,jdbcType=VARCHAR},",
			"version_id = #{versionId,jdbcType=BIGINT},", "remark = #{remark,jdbcType=VARCHAR},",
			"tenant_id = #{tenantId,jdbcType=BIGINT},", "config = #{config,jdbcType=LONGVARCHAR}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKeyWithBLOBs(CommonDeploy record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_deploy
	 * @mbg.generated
	 */
	@Update({ "update common_deploy", "set name = #{name,jdbcType=VARCHAR},", "deploy = #{deploy,jdbcType=VARCHAR},",
			"env = #{env,jdbcType=VARCHAR},", "namespace = #{namespace,jdbcType=VARCHAR},",
			"url = #{url,jdbcType=VARCHAR},", "token = #{token,jdbcType=VARCHAR},",
			"user_id = #{userId,jdbcType=BIGINT},", "host = #{host,jdbcType=VARCHAR},",
			"port = #{port,jdbcType=INTEGER},", "pwd_duckula = #{pwdDuckula,jdbcType=VARCHAR},",
			"hostsconfig = #{hostsconfig,jdbcType=VARCHAR},", "is_init = #{isInit,jdbcType=VARCHAR},",
			"docker_login = #{dockerLogin,jdbcType=VARCHAR},", "is_default = #{isDefault,jdbcType=VARCHAR},",
			"version_id = #{versionId,jdbcType=BIGINT},", "remark = #{remark,jdbcType=VARCHAR},",
			"tenant_id = #{tenantId,jdbcType=BIGINT}", "where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(CommonDeploy record);
}