SysGeneratorDao.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.kmall.gen.dao.SysGeneratorDao">
  4. <select id="queryList" resultType="map">
  5. select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
  6. where table_schema = (select database())
  7. <if test="tableName != null and tableName.trim() != ''">
  8. and table_name like concat('%', #{tableName}, '%')
  9. </if>
  10. order by create_time desc
  11. <if test="offset != null and limit != null">
  12. limit #{offset}, #{limit}
  13. </if>
  14. </select>
  15. <select id="queryTotal" resultType="int">
  16. select count(*) from information_schema.tables where table_schema = (select database())
  17. <if test="tableName != null and tableName.trim() != ''">
  18. and table_name like concat('%', #{tableName}, '%')
  19. </if>
  20. </select>
  21. <select id="queryTable" resultType="map">
  22. select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
  23. where table_schema = (select database()) and table_name = #{tableName}
  24. </select>
  25. <select id="queryColumns" resultType="map">
  26. select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns
  27. where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position
  28. </select>
  29. </mapper>