forked from gzzfw/backEnd/gz-dyh

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
<?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"/>
        <result property="dataScale" column="dataScale"/>
    </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",
            c.comments AS "comments"
        FROM
            user_tab_columns t1
                JOIN
            user_tab_comments t2
            ON
                t1.table_name = t2.table_name
                LEFT JOIN
            user_col_comments c
            ON
                t1.table_name = c.table_name AND t1.column_name = c.column_name
        WHERE
            t1.table_name = #{tableName}
    </select>
 
</mapper>