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

public interface CommonInstanceMapper   extends BaseMapper<CommonInstance>  {

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_instance
	 * @mbg.generated
	 */
	@Insert({ "insert into common_instance (id, name, ", "host, port, username, ", "password, is_drds, ",
			"user_id, com_id, remark, ", "tenant_id)", "values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
			"#{host,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, ",
			"#{password,jdbcType=VARCHAR}, #{isDrds,jdbcType=VARCHAR}, ",
			"#{userId,jdbcType=VARCHAR}, #{comId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, ",
			"#{tenantId,jdbcType=BIGINT})" })
	int insert(CommonInstance record);

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

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

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

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table common_instance
	 * @mbg.generated
	 */
	@Update({ "update common_instance", "set name = #{name,jdbcType=VARCHAR},", "host = #{host,jdbcType=VARCHAR},",
			"port = #{port,jdbcType=INTEGER},", "username = #{username,jdbcType=VARCHAR},",
			"password = #{password,jdbcType=VARCHAR},", "is_drds = #{isDrds,jdbcType=VARCHAR},",
			"user_id = #{userId,jdbcType=VARCHAR},", "com_id = #{comId,jdbcType=VARCHAR},",
			"remark = #{remark,jdbcType=VARCHAR},", "tenant_id = #{tenantId,jdbcType=BIGINT}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(CommonInstance record);
}