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

import java.util.List;
import net.wicp.tams.app.duckula.controller.bean.models.SysTenant;
import net.wicp.tams.app.duckula.controller.bean.models.SysTenantExample;
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 SysTenantMapper extends BaseMapper<SysTenant> {

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_tenant
	 * @mbg.generated
	 */
	@Insert({ "insert into sys_tenant (id, code, ", "name, create_name, ", "status, status_time, ", "operate_reason)",
			"values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, ",
			"#{name,jdbcType=VARCHAR}, #{createName,jdbcType=VARCHAR}, ",
			"#{status,jdbcType=VARCHAR}, #{statusTime,jdbcType=TIMESTAMP}, ", "#{operateReason,jdbcType=VARCHAR})" })
	int insert(SysTenant record);

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_tenant
	 * @mbg.generated
	 */
	@Select({ "select", "id, code, name, create_name, status, status_time, operate_reason", "from sys_tenant",
			"where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.SysTenantMapper.BaseResultMap")
	SysTenant selectByPrimaryKey(Long id);

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_tenant
	 * @mbg.generated
	 */
	@Update({ "update sys_tenant", "set code = #{code,jdbcType=VARCHAR},", "name = #{name,jdbcType=VARCHAR},",
			"create_name = #{createName,jdbcType=VARCHAR},", "status = #{status,jdbcType=VARCHAR},",
			"status_time = #{statusTime,jdbcType=TIMESTAMP},", "operate_reason = #{operateReason,jdbcType=VARCHAR}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(SysTenant record);
}