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

public interface SysPermissionsMapper extends BaseMapper<SysPermissions> {

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_permissions
	 * @mbg.generated
	 */
	@Insert({ "insert into sys_permissions (id, name, ", "opt_type, data_pattern, ", "data_value, url_pattern, ",
			"url_value, tenant_id)", "values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
			"#{optType,jdbcType=VARCHAR}, #{dataPattern,jdbcType=VARCHAR}, ",
			"#{dataValue,jdbcType=VARCHAR}, #{urlPattern,jdbcType=VARCHAR}, ",
			"#{urlValue,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})" })
	int insert(SysPermissions record);

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_permissions
	 * @mbg.generated
	 */
	@Select({ "select", "id, name, opt_type, data_pattern, data_value, url_pattern, url_value, tenant_id",
			"from sys_permissions", "where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.SysPermissionsMapper.BaseResultMap")
	SysPermissions selectByPrimaryKey(Long id);

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_permissions
	 * @mbg.generated
	 */
	@Update({ "update sys_permissions", "set name = #{name,jdbcType=VARCHAR},",
			"opt_type = #{optType,jdbcType=VARCHAR},", "data_pattern = #{dataPattern,jdbcType=VARCHAR},",
			"data_value = #{dataValue,jdbcType=VARCHAR},", "url_pattern = #{urlPattern,jdbcType=VARCHAR},",
			"url_value = #{urlValue,jdbcType=VARCHAR},", "tenant_id = #{tenantId,jdbcType=BIGINT}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(SysPermissions record);
}