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
<?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_ExtDataBaseMapper" >
  <resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_ExtDataBase" >
    <id column="DATASOURCEID" property="datasourceid" jdbcType="INTEGER" />
    <result column="RESOURCEID" property="resourceid" jdbcType="INTEGER" />
    <result column="SPACENAME" property="spacename" jdbcType="VARCHAR" />
    <result column="TABLENAME" property="tablename" jdbcType="VARCHAR" />
    <result column="PRIMARYKEY" property="primarykey" jdbcType="VARCHAR" />
    <result column="FIELDCONFIG" property="fieldconfig" jdbcType="LONGNVARCHAR" />
    <result column="TIMESTAMPFIELD" property="timestampfield" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    DATASOURCEID, RESOURCEID, SPACENAME, TABLENAME, PRIMARYKEY, FIELDCONFIG,TIMESTAMPFIELD
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from RES_EXTDATABASE
    where DATASOURCEID = #{datasourceid,jdbcType=INTEGER}
  </select>
 
  <select id="selectBaseLeftSource"  parameterType="java.lang.Integer"
          resultType="com.landtool.lanbase.modules.res.entity.DataBaseLeftDataSource.DataBaseLeftDataSource">
    select RES_EXTDATABASE.datasourceid,resourceid,spacename,tablename,primarykey,
    fieldconfig,databasetype,username,password,serveraddress,databasename,port,tabletype,
    createuserid,createdate,RES_EXTDATABASE.timestampfield
    from RES_EXTDATABASE
    left join RES_EXTDATASOURCE on(RES_EXTDATABASE.DATASOURCEID=RES_EXTDATASOURCE.DATASOURCEID)
    where  RESOURCEID =  #{resourceid}
 
  </select>
 
  <select id="selectByMainInfoId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from RES_EXTDATABASE
    where RESOURCEID = #{resourceid,jdbcType=INTEGER}
  </select>
 
 
 
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from RES_EXTDATABASE
    where RESOURCEID = #{resourceid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataBase" >
    insert into RES_EXTDATABASE (DATASOURCEID, RESOURCEID, SPACENAME,
      TABLENAME, PRIMARYKEY, FIELDCONFIG
      )
    values (#{datasourceid,jdbcType=INTEGER}, #{resourceid,jdbcType=INTEGER}, #{spacename,jdbcType=VARCHAR}, 
      #{tablename,jdbcType=VARCHAR}, #{primarykey,jdbcType=VARCHAR}, #{fieldconfig,jdbcType=LONGNVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataBase" >
    insert into RES_EXTDATABASE
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="datasourceid != null" >
        DATASOURCEID,
      </if>
      <if test="resourceid != null" >
        RESOURCEID,
      </if>
      <if test="spacename != null" >
        SPACENAME,
      </if>
      <if test="tablename != null" >
        TABLENAME,
      </if>
      <if test="primarykey != null" >
        PRIMARYKEY,
      </if>
      <if test="fieldconfig != null" >
        FIELDCONFIG,
      </if>
      <if test="timestampfield != null" >
        TIMESTAMPFIELD,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="datasourceid != null" >
        #{datasourceid,jdbcType=INTEGER},
      </if>
      <if test="resourceid != null" >
        #{resourceid,jdbcType=INTEGER},
      </if>
      <if test="spacename != null" >
        #{spacename,jdbcType=VARCHAR},
      </if>
      <if test="tablename != null" >
        #{tablename,jdbcType=VARCHAR},
      </if>
      <if test="primarykey != null" >
        #{primarykey,jdbcType=VARCHAR},
      </if>
      <if test="fieldconfig != null" >
        #{fieldconfig,jdbcType=LONGNVARCHAR},
      </if>
      <if test="timestampfield != null" >
      #{timestampfield,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataBase" >
    update RES_EXTDATABASE
    <set >
      <if test="resourceid != null" >
        DATASOURCEID = #{datasourceid,jdbcType=INTEGER},
      </if>
      <if test="spacename != null" >
        SPACENAME = #{spacename,jdbcType=VARCHAR},
      </if>
      <if test="tablename != null" >
        TABLENAME = #{tablename,jdbcType=VARCHAR},
      </if>
      <if test="primarykey != null" >
        PRIMARYKEY = #{primarykey,jdbcType=VARCHAR},
      </if>
      <if test="fieldconfig != null" >
        FIELDCONFIG = #{fieldconfig,jdbcType=LONGNVARCHAR},
      </if>
      <if test="timestampfield != null" >
        TIMESTAMPFIELD=#{timestampfield,jdbcType=VARCHAR},
      </if>
    </set>
    where RESOURCEID = #{resourceid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtDataBase" >
    update RES_EXTDATABASE
    set DATASOURCEID = #{datasourceid,jdbcType=INTEGER},
      SPACENAME = #{spacename,jdbcType=VARCHAR},
      TABLENAME = #{tablename,jdbcType=VARCHAR},
      PRIMARYKEY = #{primarykey,jdbcType=VARCHAR},
      TIMESTAMPFIELD=#{timestampfield,jdbcType=VARCHAR},
      FIELDCONFIG = #{fieldconfig,jdbcType=LONGNVARCHAR}
    where RESOURCEID = #{resourceid,jdbcType=INTEGER}
  </update>
</mapper>