package com.autumnframework.common.dao.bomapper;

import com.autumnframework.common.model.po.Resource;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface ResourceMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table af_resource
     *
     * @mbg.generated Sun Oct 29 11:22:33 CST 2017
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table af_resource
     *
     * @mbg.generated Sun Oct 29 11:22:33 CST 2017
     */
    int insert(Resource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table af_resource
     *
     * @mbg.generated Sun Oct 29 11:22:33 CST 2017
     */
    int insertSelective(Resource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table af_resource
     *
     * @mbg.generated Sun Oct 29 11:22:33 CST 2017
     */
    Resource selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table af_resource
     *
     * @mbg.generated Sun Oct 29 11:22:33 CST 2017
     */
    int updateByPrimaryKeySelective(Resource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table af_resource
     *
     * @mbg.generated Sun Oct 29 11:22:33 CST 2017
     */
    int updateByPrimaryKey(Resource record);

    /**
     * 查询所有访问接口信息
     * @return
     */
    List<Resource> selectResourceAllList();
    /**
     * 根据用户Id查询用户访问接口信息
     * @param userId 用户Id
     * @return
     */
    List<Resource> selectResListByUserId(@Param("userId") Integer userId);

    /**
     * 根据id删除资源
     * @param id
     * @param table
     * @return
     */
    int deleteResById(@Param("id") Integer id, @Param("table") String table);
}