广州市综治平台后端
xusd
2025-06-07 36306491396230522fa20585c2621a7fc899849a
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
<?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">
 
<!--@title: 代码生成器mybatis接口
@description: 代码生成器mybatis接口
@company: hugeinfo
@author: liyj
@time: 2021-11-05 16:51:48
@version: 1.0.0-->
<mapper namespace="cn.huge.module.buildcode.dao.mapper.BuildCodeMapper">
 
    <resultMap id="reslutMap" type="cn.huge.module.buildcode.domain.bo.UserTabColsBO">
        <result property="tableName" column="tableName"/>
        <result property="tableComments" column="tableComments"/>
        <result property="name" column="name"/>
        <result property="comments" column="comments"/>
        <result property="dataType" column="dataType"/>
    </resultMap>
    <!--自定义查询-->
    <select id="getTabInfo" parameterType="String" resultMap="reslutMap">
        SELECT t1.table_name AS "tableName", t2.comments AS "tableComments", t1.column_name AS "name",
               t1.data_type AS "dataType", t3.comments AS "comments"
        FROM all_tab_columns t1
                 LEFT JOIN all_tab_comments t2 ON t1.table_name = t2.table_name
                 LEFT JOIN user_col_comments t3 ON t1.table_name = t3.table_name AND t1.column_name = t3.column_name
        WHERE t1.table_name = #{tableName}
          AND t1.OWNER = #{tableSchema}
          AND t2.OWNER = #{tableSchema}
          AND t3.OWNER = #{tableSchema}
    </select>
 
</mapper>