<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.devplatform.admin.modules.sys.dao.SysRoleMenuDao">

  <select id="queryMenuIdList" resultType="java.lang.String">
    SELECT su.menu_id
    FROM sys_role_menu su
    LEFT JOIN sys_menu sm ON su.menu_id = sm.menu_id
    WHERE sm.type = 2
    AND su.role_id = #{roleId}
    <if test="stationId != null and stationId != ''">
      AND su.station_id = #{stationId}
    </if>
  </select>

  <delete id="deleteBatch">
    delete from sys_role_menu where role_id in
    <foreach close=")" collection="array" item="roleId" open="(" separator=",">
      #{roleId}
    </foreach>
  </delete>

</mapper>