package cn.qinys.platform.upms.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.qinys.platform.entity.upms.UpmsMenuPermissionBase;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 租户权限表(UpmsMenuPermission)表数据库访问层
 *
 * @author makejava
 * @since 2024-02-28 11:43:45
 */
@Repository
@Mapper
public interface UpmsMenuPermissionBaseMapper extends BaseMapper<UpmsMenuPermissionBase> {
    /**
     * 删除权限码
     *
     * @param menuId
     */
    @Delete("DELETE FROM upms_menu_permission_base WHERE menu_id = #{menuId}")
    void deleteByMenuId(@Param("menuId") Integer menuId);


    /**
     * 所有权限码
     * @return
     */
    @Select("SELECT permission_code FROM upms_menu_permission_base ORDER BY id Asc")
    List<String> selectAllPermissionCodes();

}

