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

import java.util.List;

import net.wicp.tams.app.duckula.controller.bean.models.SysResource;
import net.wicp.tams.app.duckula.controller.bean.models.SysRoleRes;
import net.wicp.tams.app.duckula.controller.bean.models.SysRoleResExample;
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 SysRoleResMapper extends BaseMapper<SysRoleRes>{

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_role_res
	 * @mbg.generated
	 */
	@Insert({ "insert into sys_role_res (id, role_id, ", "res_id, auth_code, tenant_id)",
			"values (#{id,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, ",
			"#{resId,jdbcType=BIGINT}, #{authCode,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT})" })
	int insert(SysRoleRes record);

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_role_res
	 * @mbg.generated
	 */
	@Select({ "select", "id, role_id, res_id, auth_code, tenant_id", "from sys_role_res",
			"where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.SysRoleResMapper.BaseResultMap")
	SysRoleRes selectByPrimaryKey(Long id);

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_role_res
	 * @mbg.generated
	 */
	@Update({ "update sys_role_res", "set role_id = #{roleId,jdbcType=BIGINT},", "res_id = #{resId,jdbcType=BIGINT},",
			"auth_code = #{authCode,jdbcType=BIGINT},", "tenant_id = #{tenantId,jdbcType=BIGINT}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(SysRoleRes record);
}