ZzglMenuMapper.xml 9.62 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
<?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.timer.api.dao.zzgl.ZzglMenuMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.zzgl.ZzglMenu" >
                <result column="menu_id" property="menuId" />
                <result column="menu_name" property="menuName" />
                <result column="parent_id" property="parentId" />
                <result column="order_num" property="orderNum" />
                <result column="path" property="path" />
                <result column="component" property="component" />
                <result column="is_frame" property="isFrame" />
                <result column="menu_type" property="menuType" />
                <result column="visible" property="visible" />
                <result column="perms" property="perms" />
                <result column="icon" property="icon" />
                <result column="create_by" property="createBy" />
                <result column="create_time" property="createTime" />
                <result column="update_by" property="updateBy" />
                <result column="update_time" property="updateTime" />
                <result column="remark" property="remark" />
    </resultMap>

    <sql id="Base_Column_List">
                menu_id,
                menu_name,
                parent_id,
                order_num,
                path,
                component,
                is_frame,
                menu_type,
                visible,
                perms,
                icon,
                create_by,
                create_time,
                update_by,
                update_time,
                remark
    </sql>
    
    <sql id="Base_Column_List_A">
                a.menu_id,
                a.menu_name,
                a.parent_id,
                a.order_num,
                a.path,
                a.component,
                a.is_frame,
                a.menu_type,
                a.visible,
                a.perms,
                a.icon,
                a.create_by,
                a.create_time,
                a.update_by,
                a.update_time,
                a.remark
    </sql>
    
    <sql id="Base_Column_List_Alias">
                menu_id ZzglMenu_menu_id,
                menu_name ZzglMenu_menu_name,
                parent_id ZzglMenu_parent_id,
                order_num ZzglMenu_order_num,
                path ZzglMenu_path,
                component ZzglMenu_component,
                is_frame ZzglMenu_is_frame,
                menu_type ZzglMenu_menu_type,
                visible ZzglMenu_visible,
                perms ZzglMenu_perms,
                icon ZzglMenu_icon,
                create_by ZzglMenu_create_by,
                create_time ZzglMenu_create_time,
                update_by ZzglMenu_update_by,
                update_time ZzglMenu_update_time,
                remark ZzglMenu_remark
    </sql>
    
    <select id="selectMenuByPostId" resultMap="BaseResultMap">
        SELECT a.menu_id
        FROM zzgl_menu a
        LEFT JOIN zzgl_post_menu b ON a.menu_id = b.menu_id
        WHERE b.bmgw_id = #{id}
    </select>
    
    <select id="queryList" resultMap="BaseResultMap" parameterType="cn.timer.api.dto.zzgl.ZzglMenuQueryDto">
        SELECT <include refid="Base_Column_List" />
        FROM zzgl_menu
        <where>
        	<if test ="null != obj.menuName and '' != obj.menuName">
            	and menu_name like CONCAT('%',#{obj.menuName},'%')
            </if>
            <if test ="null != obj.visible  and '' != obj.visible">
            	and visible = #{obj.visible},
            </if>
        </where>
    </select>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.zzgl.ZzglMenu">
        INSERT INTO zzgl_menu
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != menuId'>
                        menu_id,
                        </if>
                        <if test ='null != menuName'>
                        menu_name,
                        </if>
                        <if test ='null != parentId'>
                        parent_id,
                        </if>
                        <if test ='null != orderNum'>
                        order_num,
                        </if>
                        <if test ='null != path'>
                        path,
                        </if>
                        <if test ='null != component'>
                        component,
                        </if>
                        <if test ='null != isFrame'>
                        is_frame,
                        </if>
                        <if test ='null != menuType'>
                        menu_type,
                        </if>
                        <if test ='null != visible'>
                        visible,
                        </if>
                        <if test ='null != perms'>
                        perms,
                        </if>
                        <if test ='null != icon'>
                        icon,
                        </if>
                        <if test ='null != createBy'>
                        create_by,
                        </if>
                        <if test ='null != createTime'>
                        create_time,
                        </if>
                        <if test ='null != updateBy'>
                        update_by,
                        </if>
                        <if test ='null != updateTime'>
                        update_time,
                        </if>
                        <if test ='null != remark'>
                        remark
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != menuId'>
                        #{menuId},
                        </if>
                        <if test ='null != menuName'>
                        #{menuName},
                        </if>
                        <if test ='null != parentId'>
                        #{parentId},
                        </if>
                        <if test ='null != orderNum'>
                        #{orderNum},
                        </if>
                        <if test ='null != path'>
                        #{path},
                        </if>
                        <if test ='null != component'>
                        #{component},
                        </if>
                        <if test ='null != isFrame'>
                        #{isFrame},
                        </if>
                        <if test ='null != menuType'>
                        #{menuType},
                        </if>
                        <if test ='null != visible'>
                        #{visible},
                        </if>
                        <if test ='null != perms'>
                        #{perms},
                        </if>
                        <if test ='null != icon'>
                        #{icon},
                        </if>
                        <if test ='null != createBy'>
                        #{createBy},
                        </if>
                        <if test ='null != createTime'>
                        #{createTime},
                        </if>
                        <if test ='null != updateBy'>
                        #{updateBy},
                        </if>
                        <if test ='null != updateTime'>
                        #{updateTime},
                        </if>
                        <if test ='null != remark'>
                        #{remark}
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM zzgl_menu
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.zzgl.ZzglMenu">
        UPDATE zzgl_menu
        <set>
                    <if test ='null != menuId'>menu_id = #{menuId},</if>
                    <if test ='null != menuName'>menu_name = #{menuName},</if>
                    <if test ='null != parentId'>parent_id = #{parentId},</if>
                    <if test ='null != orderNum'>order_num = #{orderNum},</if>
                    <if test ='null != path'>path = #{path},</if>
                    <if test ='null != component'>component = #{component},</if>
                    <if test ='null != isFrame'>is_frame = #{isFrame},</if>
                    <if test ='null != menuType'>menu_type = #{menuType},</if>
                    <if test ='null != visible'>visible = #{visible},</if>
                    <if test ='null != perms'>perms = #{perms},</if>
                    <if test ='null != icon'>icon = #{icon},</if>
                    <if test ='null != createBy'>create_by = #{createBy},</if>
                    <if test ='null != createTime'>create_time = #{createTime},</if>
                    <if test ='null != updateBy'>update_by = #{updateBy},</if>
                    <if test ='null != updateTime'>update_time = #{updateTime},</if>
                    <if test ='null != remark'>remark = #{remark}</if>
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM zzgl_menu
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM zzgl_menu
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM zzgl_menu
    </select>

	 -->

</mapper>