<?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="cn.fateverse.admin.mapper.BackMenuMapper">

    <select id="selectAll" resultType="cn.fateverse.admin.entity.Menu">
        select * from sys_menu
    </select>

    <insert id="insert" useGeneratedKeys="true" keyColumn="menu_id" keyProperty="menuId">
        insert into sys_menu_back1
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="menuId != null">menu_id,</if>
            <if test="menuName != null and menuName != ''">menu_name,</if>
            <if test="parentId != null">parent_id,</if>
            <if test="orderNum != null">order_num,</if>
            <if test="path != null">`path`,</if>
            <if test="pathParams != null and pathParams != ''">path_params,</if>
            <if test="component != null and component != ''">component,</if>
            <if test="isFrame != null and isFrame != ''">is_frame,</if>
            <if test="isCache != null and isCache != ''">is_cache,</if>
            <if test="menuType != null and menuType != ''">menu_type,</if>
            <if test="state != null and state != ''">state,</if>
            <if test="visible != null and visible != ''">`visible`,</if>
            <if test="perms != null and perms != ''">perms,</if>
            <if test="icon != null and icon != ''">icon,</if>
            <if test="createBy != null and createBy != ''">create_by,</if>
            <if test="createTime != null">create_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="menuId != null">#{menuId},</if>
            <if test="menuName != null and menuName != ''">#{menuName},</if>
            <if test="parentId != null">#{parentId},</if>
            <if test="orderNum != null">#{orderNum},</if>
            <if test="path != null">#{path},</if>
            <if test="pathParams != null and pathParams != ''">#{pathParams},</if>
            <if test="component != null and component != ''">#{component},</if>
            <if test="isFrame != null and isFrame != ''">#{isFrame},</if>
            <if test="isCache != null and isCache != ''">#{isCache},</if>
            <if test="menuType != null and menuType != ''">#{menuType},</if>
            <if test="state != null and state != ''">#{state},</if>
            <if test="visible != null and visible != ''">#{visible},</if>
            <if test="perms != null and perms != ''">#{perms},</if>
            <if test="icon != null and icon != ''">#{icon},</if>
            <if test="createBy != null and createBy != ''">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
        </trim>
    </insert>

</mapper>