ROLEMapper.java 1.3 KB
package com.tianbo.warehouse.dao;

import com.tianbo.warehouse.model.ROLE;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ROLEMapper {
    int deleteByPrimaryKey(Integer roleId);

    int insert(ROLE record);

    int insertSelective(ROLE record);

    ROLE selectByPrimaryKey(Integer roleId);

    List<ROLE> findRolesByUserId(Integer userId);

    List<ROLE> selectByParentId(Integer roleId);

    /**
     * 查询最顶层企业信息
     * @param roleId 组织机构ID
     * @return
     */
    List<ROLE> selectTopByChildID(Integer roleId);

    List<ROLE> findAll(@Param("roleName") String roleName,
                       @Param("type") String type);

    /**
     * 为findAll的sql优化版本
     * @param roleName
     * @param type
     * @return
     */
    List<ROLE> findAllWithChildAndTree(@Param("roleName") String roleName,
                                       @Param("type") String type);

    List<ROLE> findAllWithOutTree(@Param("roleName") String roleName,
                       @Param("type") String type);


    List<ROLE> orgSelectWithRootNoTree(ROLE record);

    int updateByPrimaryKeySelective(ROLE record);

    int updateByPrimaryKey(ROLE record);

    int updateTokenById(@Param("roleId") Integer roleId,
                        @Param("token") String token);
}