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
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
<?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.Res_ExtDataSourceMapper" >
  <resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_ExtDataSource" >
    <id column="DATASOURCEID" property="datasourceid" jdbcType="INTEGER" />
    <!-- modified by qufangxu VARCHAR -> VARCHAR -->
    <result column="DATABASETYPE" property="databasetype" jdbcType="VARCHAR" />
    <result column="USERNAME" property="username" jdbcType="VARCHAR" />
    <result column="PASSWORD" property="password" jdbcType="VARCHAR" />
    <result column="SERVERADDRESS" property="serveraddress" jdbcType="VARCHAR" />
    <result column="DATABASENAME" property="databasename" jdbcType="VARCHAR" />
    <result column="PORT" property="port" jdbcType="VARCHAR" />
    <result column="CREATEUSERID" property="createuserid" jdbcType="VARCHAR" />
    <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
    <result column="DATABASEALIAS" property="databasealias" jdbcType="VARCHAR" />
    <result column="TABLETYPE" property="tabletype" jdbcType="INTEGER" />
    <result column="FEATURE" property="feature" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    DATASOURCEID, DATABASETYPE, USERNAME, PASSWORD, SERVERADDRESS, DATABASENAME, PORT, TABLETYPE,FEATURE,
    CREATEUSERID, CREATEDATE,DATABASEALIAS
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from RES_EXTDATASOURCE
    where DATASOURCEID = #{datasourceid,jdbcType=INTEGER}
 
  </select>
 
  <select id="selectAll" resultMap="BaseResultMap" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataSource">
    select
      <include refid="Base_Column_List" />
    from RES_EXTDATASOURCE
    <where>
      <if test="databasename!=null and databasename != '' ">
        and DATABASENAME like '%' || #{ databasename} || '%'
      </if>
      <if test="databasetype!=null and databasetype != '' ">
        and DATABASETYPE=#{databasetype}
      </if>
      <if test="createuserid!=null and createuserid != '' ">
        and CREATEUSERID=#{createuserid}
      </if>
    </where>
    order by CREATEDATE DESC
  </select>
 
  <select id="selectlist" resultType="java.lang.Integer" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataSource" >
    select COUNT(*) from RES_EXTDATASOURCE
    <where>
      <if test="databasename!=null and databasename != '' ">
        and  DATABASENAME=#{databasename}
      </if>
      <if test="databasetype!=null and databasetype != '' ">
        and  DATABASETYPE=#{databasetype}
      </if>
    </where>
  </select>
 
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from RES_EXTDATASOURCE
    where DATASOURCEID = #{datasourceid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataSource" >
    <selectKey keyProperty="datasourceid" resultType="java.lang.Integer" order="BEFORE">
      select NEXTVAL('RES_EXTDATASOURCE_INS_SEQ') from dual
    </selectKey>
    insert into RES_EXTDATASOURCE (DATASOURCEID , DATABASETYPE, USERNAME,
      PASSWORD, SERVERADDRESS, DATABASENAME, TABLETYPE,FEATURE,
      PORT, CREATEUSERID, CREATEDATE, DATABASEALIAS
      )
    values ( #{datasourceid,jdbcType=INTEGER},#{databasetype}, #{username},
      #{password}, #{serveraddress}, #{databasename},#{tabletype},#{feature,jdbcType=VARCHAR},
      #{port}, #{createuserid}, #{createdate}, #{databasealias}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataSource" >
    <selectKey keyProperty="datasourceid" resultType="java.lang.Integer" order="BEFORE">
      select NEXTVAL('RES_EXTDATASOURCE_INS_SEQ') from dual
    </selectKey>
    insert into RES_EXTDATASOURCE
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="datasourceid != null" >
        DATASOURCEID,
      </if>
      <if test="databasetype != null" >
        DATABASETYPE,
      </if>
      <if test="username != null" >
        USERNAME,
      </if>
      <if test="password != null" >
        PASSWORD,
      </if>
      <if test="serveraddress != null" >
        SERVERADDRESS,
      </if>
      <if test="databasename != null" >
        DATABASENAME,
      </if>
      <if test="port != null" >
        PORT,
      </if>
      <if test="createuserid != null" >
        CREATEUSERID,
      </if>
      <if test="createdate != null" >
        CREATEDATE,
      </if>
      <if test="databasealias != null" >
        DATABASEALIAS,
      </if>
      <if test="tabletype != null" >
        TABLETYPE,
      </if>
      <if test="feature != null" >
        FEATURE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="datasourceid != null" >
        #{datasourceid,jdbcType=VARCHAR},
      </if>
      <if test="databasetype != null" >
        #{databasetype,jdbcType=VARCHAR},
      </if>
      <if test="username != null" >
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="password != null" >
        #{password,jdbcType=VARCHAR},
      </if>
      <if test="serveraddress != null" >
        #{serveraddress,jdbcType=VARCHAR},
      </if>
      <if test="databasename != null" >
        #{databasename,jdbcType=VARCHAR},
      </if>
      <if test="port != null" >
        #{port,jdbcType=VARCHAR},
      </if>
      <if test="createuserid != null" >
        #{createuserid,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null" >
        #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="databasealias != null" >
        #{databasealias,jdbcType=VARCHAR},
      </if>
      <if test="tabletype != null" >
        #{tabletype,jdbcType=INTEGER},
      </if>
      <if test="feature != null" >
        #{feature,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataSource" >
    update RES_EXTDATASOURCE
    <set >
      <if test="databasetype != null" >
        DATABASETYPE = #{databasetype,jdbcType=VARCHAR},
      </if>
      <if test="username != null" >
        USERNAME = #{username,jdbcType=VARCHAR},
      </if>
      <if test="password != null" >
        PASSWORD = #{password,jdbcType=VARCHAR},
      </if>
      <if test="serveraddress != null" >
        SERVERADDRESS = #{serveraddress,jdbcType=VARCHAR},
      </if>
      <if test="databasename != null" >
        DATABASENAME = #{databasename,jdbcType=VARCHAR},
      </if>
      <if test="port != null" >
        PORT = #{port,jdbcType=VARCHAR},
      </if>
      <if test="createuserid != null" >
        CREATEUSERID = #{createuserid,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null" >
        CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="databasealias != null" >
        DATABASEALIAS = #{databasealias,jdbcType=VARCHAR},
      </if>
      <if test="tabletype != null" >
        TABLETYPE = #{tabletype,jdbcType=INTEGER},
      </if>
      <if test="feature != null" >
        FEATURE = #{feature,jdbcType=VARCHAR},
      </if>
    </set>
    where DATASOURCEID = #{datasourceid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataSource" >
    update RES_EXTDATASOURCE
    set DATABASETYPE = #{databasetype,jdbcType=VARCHAR},
      USERNAME = #{username,jdbcType=VARCHAR},
      PASSWORD = #{password,jdbcType=VARCHAR},
      SERVERADDRESS = #{serveraddress,jdbcType=VARCHAR},
      DATABASENAME = #{databasename,jdbcType=VARCHAR},
      PORT = #{port,jdbcType=VARCHAR},
      CREATEUSERID = #{createuserid,jdbcType=VARCHAR},
      CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
      TABLETYPE = #{tabletype,jdbcType=INTEGER},
      FEATURE = #{feature,jdbcType=VARCHAR},
      DATABASEALIAS = #{databasealias,jdbcType=VARCHAR}
    where DATASOURCEID = #{datasourceid,jdbcType=INTEGER}
  </update>
</mapper>