mappers.GenSimpleTableMapper.xml Maven / Gradle / Ivy
<?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.lframework.gen.mappers.GenSimpleTableMapper"> <resultMap id="SimpleTableDto" type="com.lframework.gen.dto.simpledb.SimpleTableDto"> <id column="id" property="id"/> <result column="table_schema" property="tableSchema"/> <result column="table_name" property="tableName"/> <result column="engine" property="engine"/> <result column="table_collation" property="tableCollation"/> <result column="table_comment" property="tableComment"/> <result column="convert_type" property="convertType"/> </resultMap> <sql id="SimpleTableDto_sql"> SELECT id, table_name, engine, table_collation, table_comment, convert_type FROM gen_simple_table </sql> <select id="getByDataObjId" resultMap="SimpleTableDto"> <include refid="SimpleTableDto_sql"/> WHERE id = #{id} </select> <select id="get" resultMap="SimpleTableDto"> select TABLE_SCHEMA AS table_schema, TABLE_NAME AS table_name, ENGINE AS engine, TABLE_COLLATION AS table_collation, TABLE_COMMENT AS table_comment FROM information_schema.tables WHERE TABLE_SCHEMA = #{tableSchema} AND TABLE_NAME = #{tableName} </select> </mapper>