kaiyu
2021-04-16 6ebf2b2a84b903f3600238dd084b3ae9ee4d6d3b
screen-manage/src/main/resources/mapper/ManageMenuMapper.xml
@@ -68,7 +68,7 @@
            <if test="icon != null">
                icon,
            </if>
            <if test="parent_id != null">
            <if test="parentId != null">
                parent_id,
            </if>
            <if test="order != null">
@@ -85,8 +85,8 @@
            <if test="icon != null">
                #{icon},
            </if>
            <if test="parent_id != null">
                #{parent_id},
            <if test="parentId != null">
                #{parentId},
            </if>
            <if test="order != null">
                #{order},
@@ -124,6 +124,7 @@
        <include refid="Base_Column_List"></include>
        from manage_menu mm
        where mm.is_delete = 0
        ORDER BY parent_id ASC,`order` ASC
        limit #{start},#{number}
    </select>
@@ -143,4 +144,38 @@
        limit #{start},#{number}
    </select>
    <select id="getManageMenuByRoleId" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        FROM manage_menu mm
        JOIN manage_role_menu mrm
        ON mm.id = mrm.menu_id AND mrm.is_delete = 0
        JOIN manage_role mr
        ON mr.id = mrm.role_id and mr.id = #{roleId}
        WHERE mm.is_delete = 0
    </select>
    <select id="getManageMenuByCondition" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from manage_menu mm
        where mm.is_delete = 0
        <if test="name != null">
            and mm.name = #{name}
        </if>
        <if test="url != null">
            and mm.url = #{url}
        </if>
        <if test="icon != null">
            and mm.icon = #{icon}
        </if>
        <if test="parent_id != null">
            and mm.parent_id = #{parent_id}
        </if>
        <if test="order != null">
            and mm.order = #{order}
        </if>
        limit #{start},#{number}
    </select>
</mapper>