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

public interface SysRoleAssignMapper extends BaseMapper<SysRoleAssign> {

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_role_assign
	 * @mbg.generated
	 */
	@Delete({ "delete from sys_role_assign", "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_assign
	 * @mbg.generated
	 */
	@Insert({ "insert into sys_role_assign (id, role_id, ", "assign_type, assign_value, ", "tenant_id)",
			"values (#{id,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, ",
			"#{assignType,jdbcType=VARCHAR}, #{assignValue,jdbcType=BIGINT}, ", "#{tenantId,jdbcType=BIGINT})" })
	int insert(SysRoleAssign record);

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

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

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

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_role_assign
	 * @mbg.generated
	 */
	@Update({ "update sys_role_assign", "set role_id = #{roleId,jdbcType=BIGINT},",
			"assign_type = #{assignType,jdbcType=VARCHAR},", "assign_value = #{assignValue,jdbcType=BIGINT},",
			"tenant_id = #{tenantId,jdbcType=BIGINT}", "where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(SysRoleAssign record);
}