first commit
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
<?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.qiaoba.module.generator.mapper.GeneratorTableColumnMapper">
|
||||
|
||||
<resultMap type="com.qiaoba.module.generator.entity.vo.TableColumnVo" id="DbTableColumnVoResult">
|
||||
<result property="columnName" column="column_name"/>
|
||||
<result property="columnComment" column="column_comment"/>
|
||||
<result property="columnType" column="column_type"/>
|
||||
<result property="isRequired" column="is_required"/>
|
||||
<result property="isPk" column="is_pk"/>
|
||||
<result property="sort" column="sort"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectListByTableName" resultMap="DbTableColumnVoResult">
|
||||
select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else null end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, column_type
|
||||
from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName})
|
||||
order by ordinal_position
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qiaoba.module.generator.mapper.TableMapper">
|
||||
<mapper namespace="com.qiaoba.module.generator.mapper.GeneratorTableMapper">
|
||||
|
||||
<resultMap type="com.qiaoba.module.generator.entity.vo.DbTableVo" id="DbTableVoResult">
|
||||
<result property="tableName" column="table_name"/>
|
||||
@ -27,7 +27,8 @@
|
||||
</if>
|
||||
|
||||
<if test="dto.dbType=='Oracle'.toString()">
|
||||
select lower(dt.table_name) as table_name, dtc.comments as table_comment, uo.created as create_time, uo.last_ddl_time as update_time
|
||||
select lower(dt.table_name) as table_name, dtc.comments as table_comment, uo.created as create_time,
|
||||
uo.last_ddl_time as update_time
|
||||
from user_tables dt, user_tab_comments dtc, user_objects uo
|
||||
where dt.table_name = dtc.table_name
|
||||
and dt.table_name = uo.object_name
|
||||
@ -68,4 +69,5 @@
|
||||
order by create_time desc
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user