xuhy
2025-08-30 0e1238faa0537377afc9f6edfae7e99d8f438fb3
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
@@ -4,7 +4,7 @@
      "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysMenuMapper">
   <resultMap type="SysMenu" id="SysMenuResult">
   <resultMap type="com.ruoyi.common.core.domain.entity.SysMenu" id="SysMenuResult">
      <id     property="menuId"         column="menu_id"        />
      <result property="menuName"       column="menu_name"      />
      <result property="parentName"     column="parent_name"    />
@@ -34,7 +34,7 @@
      from sys_menu
    </sql>
    
    <select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
    <select id="selectMenuList" parameterType="com.ruoyi.common.core.domain.entity.SysMenu" resultMap="SysMenuResult">
      <include refid="selectMenuVo"/>
      <where>
         <if test="menuName != null and menuName != ''">
@@ -57,7 +57,7 @@
      order by m.parent_id, m.order_num
   </select>
   
   <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
   <select id="selectMenuListByUserId" parameterType="com.ruoyi.common.core.domain.entity.SysMenu" resultMap="SysMenuResult">
      select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms,
                      m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time, m.role_type
      from sys_menu m
@@ -132,7 +132,7 @@
       select count(1) from sys_menu where parent_id = #{menuId}  
   </select>
   
   <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
   <select id="checkMenuNameUnique" parameterType="com.ruoyi.common.core.domain.entity.SysMenu" resultMap="SysMenuResult">
      <include refid="selectMenuVo"/>
      where menu_name=#{menuName} and parent_id = #{parentId} limit 1
   </select>
@@ -189,7 +189,7 @@
      from sys_menu
   </select>
    <update id="updateMenu" parameterType="SysMenu">
    <update id="updateMenu" parameterType="com.ruoyi.common.core.domain.entity.SysMenu">
      update sys_menu
      <set>
         <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
@@ -212,7 +212,7 @@
      where menu_id = #{menuId}
   </update>
   <insert id="insertMenu" parameterType="SysMenu">
   <insert id="insertMenu" parameterType="com.ruoyi.common.core.domain.entity.SysMenu" useGeneratedKeys="true" keyProperty="menuId">
      insert into sys_menu(
      <if test="menuId != null and menuId != 0">menu_id,</if>
      <if test="parentId != null and parentId != 0">parent_id,</if>
@@ -230,6 +230,7 @@
      <if test="icon != null and icon != ''">icon,</if>
      <if test="remark != null and remark != ''">remark,</if>
      <if test="createBy != null and createBy != ''">create_by,</if>
      <if test="roleType != null">role_type,</if>
      create_time
      )values(
      <if test="menuId != null and menuId != 0">#{menuId},</if>
@@ -248,6 +249,7 @@
      <if test="icon != null and icon != ''">#{icon},</if>
      <if test="remark != null and remark != ''">#{remark},</if>
      <if test="createBy != null and createBy != ''">#{createBy},</if>
      <if test="roleType != null">#{roleType},</if>
      sysdate()
      )
   </insert>