<!--<?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.backendsys.mapper.System.SysMenuMapper">-->

<!--    <sql id="includeMenu">-->
<!--        id,-->
<!--        id menu_id,-->
<!--        parent_id,-->
<!--        title,-->
<!--        title_en,-->
<!--        path,-->
<!--        component,-->
<!--        meta,-->
<!--        COALESCE(icon, '') icon,-->
<!--        COALESCE(permission, '') permission,-->
<!--        sort,-->
<!--        status-->
<!--    </sql>-->

<!--    <resultMap id="resultMapMenu" type="java.util.LinkedHashMap">-->
<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
<!--        <result property="menu_id" column="menu_id" javaType="java.lang.Long"/>-->
<!--        <result property="parent_id" column="parent_id" javaType="java.lang.Long"/>-->
<!--        <result property="title" column="title" />-->
<!--        <result property="title_en" column="title_en" />-->
<!--        <result property="path" column="path" />-->
<!--        <result property="component" column="component" />-->
<!--        <result property="meta" column="meta" />-->
<!--        <result property="icon" column="icon" />-->
<!--        <result property="permission" column="permission" />-->
<!--        <result property="sort" column="sort" />-->
<!--        <result property="status" column="status" javaType="java.lang.Integer"/>-->
<!--    </resultMap>-->

<!--    &lt;!&ndash; 查询 列表 &ndash;&gt;-->
<!--    <select id="queryMenuList" resultMap="resultMapMenu">-->
<!--        SELECT <include refid="includeMenu" />-->
<!--        FROM sys_menu-->
<!--        <where>-->
<!--            <if test="status != null and status != ''">-->
<!--                AND status = #{status}-->
<!--            </if>-->
<!--        </where>-->
<!--        ORDER BY sort ASC-->
<!--    </select>-->

<!--    &lt;!&ndash; 查询 详情 &ndash;&gt;-->
<!--    <select id="queryMenuDetail" resultMap="resultMapMenu">-->
<!--        SELECT <include refid="includeMenu" />-->
<!--        FROM sys_menu-->
<!--        WHERE id = #{menu_id}-->
<!--    </select>-->

<!--    &lt;!&ndash; 创建 &ndash;&gt;-->
<!--    <insert id="insertMenu" parameterType="com.backendsys.entity.System.SysMenuDTO" useGeneratedKeys="true" keyProperty="id">-->
<!--        INSERT INTO sys_menu (title, title_en, path, component, meta-->
<!--            <if test="parent_id != null">, parent_id</if>-->
<!--            <if test="icon != null">, icon</if>-->
<!--            <if test="permission != null">, permission</if>-->
<!--            <if test="sort != null">, sort</if>-->
<!--            <if test="status != null">, status</if>-->
<!--        ) VALUES (#{title}, #{title_en}, #{path}, #{component}, #{meta}-->
<!--            <if test="icon != null">, #{icon}</if>-->
<!--            <if test="permission != null">, #{permission}</if>-->
<!--            <if test="sort != null">, #{sort}</if>-->
<!--            <if test="status != null">, #{status}</if>-->
<!--        )-->
<!--    </insert>-->

<!--    &lt;!&ndash; 编辑 &ndash;&gt;-->
<!--    <update id="updateMenu" parameterType="com.backendsys.entity.System.SysMenuDTO">-->
<!--        UPDATE sys_menu SET-->
<!--        <trim suffixOverrides="," suffix=" ">-->
<!--            <if test="title != null and title != ''">title = #{title},</if>-->
<!--            <if test="title_en != null and title_en != ''">title_en = #{title_en},</if>-->
<!--            <if test="parent_id != null and parent_id != ''">parent_id = #{parent_id},</if>-->
<!--            <if test="path != null and path != ''">path = #{path},</if>-->
<!--            <if test="component != null and component != ''">component = #{component},</if>-->
<!--            <if test="meta != null and meta != ''">meta = #{meta},</if>-->
<!--            <if test="icon != null and icon != ''">icon = #{icon},</if>-->
<!--            <if test="permission != null and permission != ''">permission = #{permission},</if>-->
<!--            <if test="sort != null">sort = #{sort},</if>-->
<!--            <if test="status != null">status = #{status},</if>-->
<!--        </trim>-->
<!--        WHERE id = #{menu_id}-->
<!--    </update>-->

<!--    &lt;!&ndash; 删除 &ndash;&gt;-->
<!--    <delete id="deleteMenu" parameterType="java.lang.Long">-->
<!--        DELETE FROM sys_menu WHERE id = #{menu_id};-->
<!--    </delete>-->

<!--</mapper>-->