yangys
2024-09-03 52ff3bda72646a532c3297e4843bc4d5aee8b949
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
<?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.qianwen.mdc.mapper.MenuMapper">
  <resultMap id="BaseResultMap" type="com.qianwen.mdc.domain.Menu">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="label" jdbcType="VARCHAR" property="label" />
    <result column="use_role" jdbcType="VARCHAR" property="useRole" />
    <result column="params" jdbcType="VARCHAR" property="params" />
    <result column="link_type" jdbcType="INTEGER" property="linkType" />
    <result column="url" jdbcType="VARCHAR" property="url" />
    <result column="parent_id" jdbcType="INTEGER" property="parentId" />
    <result column="order_num" jdbcType="INTEGER" property="orderNum" />
    <result column="op_flag" jdbcType="VARCHAR" property="opFlag" />
    
  </resultMap>
 
 
    <select id="list" resultMap="BaseResultMap">
      SELECT id,label,use_role,params,link_type,url,params,parent_id,op_flag
      FROM menu
      <where>
           <if test="parentId != null">
               
           and parent_id=#{parentId}
         </if>
         <if test="parentId == null">
               
           and parent_id is null
         </if>
      </where>
      order by order_num
     </select>
</mapper>