You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
1.1 KiB

<?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.zdxt.table.mapper.TableMapper" >
<!--查询表名和注释-->
<select id="selectTableList" resultType="java.util.Map" parameterType="java.lang.String" >
select table_name as tableName,table_comment as comments from information_schema.tables where table_schema=#{dataSourceName}
<if test="tableName!=null and tableName!='' ">
and table_name like concat('%',#{tableName},'%')
</if>
<if test="tableComment!=null and tableComment!='' ">
and table_comment like concat('%',#{tableComment},'%')
</if>
</select>
<!--查询表名和注释-->
<select id="selecByTableName" parameterType="java.lang.String" resultType="java.util.Map">
SELECT
COLUMN_NAME as columnName ,
DATA_TYPE as dataType,
COLUMN_COMMENT as columnComment
FROM
information_schema. COLUMNS
WHERE
table_name = #{tableName}
</select>
</mapper>