com.addplus.server.security.service.mapper.SysMenuElementMapper Maven / Gradle / Ivy
The newest version!
package com.addplus.server.security.service.mapper;
import com.addplus.server.core.model.authority.data.SysMenuElement;
import com.addplus.server.core.model.authority.datatransfer.SysMenuRoleDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SysMenuElementMapper extends BaseMapper {
@Select("")
List getUserFunctionList(@Param("roles") List roles, @Param("type") Integer type);
@Select("SELECT\n" +
" e.id AS id,\n" +
" CONCAT('/',e.method,f.url,e.name) as name \n" +
"FROM\n" +
" sys_menu_element e\n" +
" LEFT JOIN sys_menu_function f ON f.id = e.m_id \n" +
"WHERE\n" +
" f.is_deleted = 0 \n" +
" AND e.is_deleted = 0")
List getMenuElementList();
@Select("SELECT\n" +
" e.id AS id,\n" +
" CONCAT('/',e.method,f.url,e.name) as name\n" +
"FROM\n" +
" sys_menu_element e\n" +
" LEFT JOIN sys_menu_function f ON f.id = e.m_id \n" +
"WHERE\n" +
" f.is_deleted = 0 \n" +
" AND e.is_deleted = 0 \n" +
" AND e.m_id = #{mId}")
List getMenuElementListByfunctionId(@Param("mId") Integer mId);
@Update("")
Integer updateMenuElementDelete(@Param("ids") List mIdList);
@Select("")
List getUserMenuElementList(@Param("roles") List roleList, @Param("mId") Integer mId);
@Select("SELECT\n" +
" me.method AS url,\n" +
" GROUP_CONCAT( DISTINCT ( r.id ) ) AS rId \n" +
"FROM\n" +
" sys_role_menu_function rm\n" +
" LEFT JOIN sys_menu_function mf ON mf.id = rm.m_id \n" +
" AND mf.is_deleted = 0\n" +
" LEFT JOIN sys_role r ON r.id = rm.r_id \n" +
" AND r.is_deleted = 0\n" +
" RIGHT JOIN sys_menu_element me ON me.m_id = mf.id \n" +
" AND me.is_deleted = 0 \n" +
"WHERE\n" +
" rm.is_deleted = 0 \n" +
"GROUP BY\n" +
" me.method")
List getMunuElementGroupMethodRole(Page page);
@Select("SELECT\n" +
" count( 1 ) AS count \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" max( mf.id ) AS mId,\n" +
" me.method AS url,\n" +
" GROUP_CONCAT( DISTINCT ( r.id ) ) AS rId \n" +
" FROM\n" +
" sys_role_menu_function rm\n" +
" LEFT JOIN sys_menu_function mf ON mf.id = rm.m_id \n" +
" AND mf.is_deleted = 0\n" +
" LEFT JOIN sys_role r ON r.id = rm.r_id \n" +
" AND r.is_deleted = 0\n" +
" RIGHT JOIN sys_menu_element me ON me.m_id = mf.id \n" +
" AND me.is_deleted = 0 \n" +
" WHERE\n" +
" rm.is_deleted = 0 \n" +
" GROUP BY\n" +
" me.method \n" +
" ) AS temp")
Integer getMunuElementGroupMethodRoleByCount();
}