2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
<?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.landtool.lanbase.modules.res.dao.RoleResCatalogMapper" >
  <resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Role_ResCatalog" >
    <id column="ID" property="id" jdbcType="INTEGER" />
    <result column="ROLEID" property="roleid" jdbcType="INTEGER" />
    <result column="CATALOGID" property="catalogid" jdbcType="INTEGER" />
    <result column="CREATETIME" property="createtime" jdbcType="TIMESTAMP" />
    <result column="STATUS" property="status" jdbcType="INTEGER" />
    <result column="ADDUSERID" property="adduserid" jdbcType="INTEGER" />
  </resultMap>
  
    <select id="queryRoleResCatalogRel" resultType="com.landtool.lanbase.modules.res.entity.Role_ResCatalog" parameterType="com.landtool.lanbase.modules.res.entity.Role_ResCatalog">
        SELECT
            ID,
            ROLEID,
            CATALOGID,
            CREATETIME,
            STATUS,
            ADDUSERID
        FROM
        ROLE_CATALOGID_REL
        WHERE 1=1
        <if test="roleid!=null and roleid!=''">
            and ROLEID=#{roleid}
        </if>
        <if test="status!=null and status!=''">
            and STATUS=#{status}
        </if>
    </select>
    
 <insert id="insertRoleResCatalogRel" parameterType="com.landtool.lanbase.modules.res.entity.Role_ResCatalog" >
 <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
            select NEXTVAL('ROLE_CATALOGID_REL_INS_SEQ') from dual
        </selectKey>
    insert into ROLE_CATALOGID_REL
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="roleid != null" >
        ROLEID,
      </if>
      <if test="id != null" >
        ID,
      </if>
      <if test="catalogid != null" >
        CATALOGID,
      </if>
      <if test="adduserid != null" >
        ADDUSERID,
      </if>
      <if test="status != null" >
        STATUS,
      </if>
      <if test="createtime != null" >
        CREATETIME,
      </if>
     
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="roleid != null" >
        #{roleid},
      </if>
      <if test="id != null" >
        #{id},
      </if>
      <if test="catalogid != null" >
        #{catalogid},
      </if>
      <if test="adduserid != null" >
        #{adduserid},
      </if>
      <if test="status != null" >
        #{status},
      </if>
    <if test="createtime != null" >
        #{createtime,jdbcType=TIMESTAMP},
      </if>
     
    </trim>
  </insert>
  
  <update id="updateRoleResCatalogRel" parameterType="com.landtool.lanbase.modules.res.entity.Role_ResCatalog" >
    update ROLE_CATALOGID_REL
    <set >
    <if test="roleid != null" >
        #{roleid,jdbcType=INTEGER},
      </if>
      <if test="catalogid != null" >
        #{catalogid,jdbcType=INTEGER},
      </if>
      <if test="adduserid != null" >
        #{adduserid,jdbcType=INTEGER},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
    <if test="createtime != null" >
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where ID = #{id,jdbcType=INTEGER}
  </update>
</mapper>