<?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="org.dromara.gen.mapper.GenTableColumnMapper">

    <resultMap type="org.dromara.gen.domain.GenTableColumn" id="GenTableColumnResult">
    </resultMap>

    <select id="getTableColumnsAndDescriptions" resultType="org.dromara.gen.domain.GenTableColumn">
        SELECT
            a.attname AS columnName,
            col_description(a.attrelid, a.attnum) AS columnComment
        FROM
            pg_attribute a
                JOIN
            pg_class c ON a.attrelid = c.oid
        WHERE
            c.relname = #{tableName} AND
            a.attnum > 0 AND
            NOT a.attisdropped;
    </select>
</mapper>
