package com.yuanchu.mom.mapper; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Repository; import java.util.Map; @Mapper @Repository public interface AuthMapper { @Insert("insert menu value (#{method}, #{remark}, #{type}, now())") int insertPower(String method, String remark, String type); @Delete("delete from menu") int deletePower(); @Select("select COALESCE(count(*), 0) from power p left join user u on u.role_id = p.role_id where u.id = #{userId} and p.menu_method = #{method}") Integer isPower(Integer userId, String method); @Select("select look from power p left join user u on u.role_id = p.role_id where u.id = #{userId} and p.menu_method = #{method}") Integer countPower(Integer userId, String method); }