|
@@ -67,48 +67,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="tableComment != null and tableComment != ''">
|
|
|
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
|
|
|
</if>
|
|
|
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
- AND date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
|
|
- </if>
|
|
|
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
- AND date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
|
|
- </if>
|
|
|
+ <!--<if test="params.beginTime != null and params.beginTime != ''"><!– 开始时间检索 –>-->
|
|
|
+ <!--AND date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')-->
|
|
|
+ <!--</if>-->
|
|
|
+ <!--<if test="params.endTime != null and params.endTime != ''"><!– 结束时间检索 –>-->
|
|
|
+ <!--AND date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')-->
|
|
|
+ <!--</if>-->
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
|
|
|
- select table_name, table_comment, create_time, update_time from information_schema.tables
|
|
|
- where table_schema = (select database())
|
|
|
- AND table_name NOT LIKE 'qrtz\_%' AND table_name NOT LIKE 'gen\_%'
|
|
|
- AND table_name NOT IN (select CONVERT(table_name USING utf8) COLLATE utf8_unicode_ci from gen_table)
|
|
|
+ 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
|
|
|
+ and uo.object_type = 'TABLE'
|
|
|
+ AND dt.table_name NOT LIKE 'QRTZ_%' AND dt.table_name NOT LIKE 'GEN_%'
|
|
|
+ AND lower(dt.table_name) NOT IN (select table_name from gen_table)
|
|
|
<if test="tableName != null and tableName != ''">
|
|
|
- AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
|
|
|
+ AND lower(dt.table_name) like lower(concat(concat('%', #{tableName}), '%'))
|
|
|
</if>
|
|
|
<if test="tableComment != null and tableComment != ''">
|
|
|
- AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
|
|
|
- </if>
|
|
|
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
- AND date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
|
|
+ AND lower(dtc.comments) like lower(concat(concat('%', #{tableComment}), '%'))
|
|
|
</if>
|
|
|
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
- AND date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
|
|
- </if>
|
|
|
- order by create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDbTableListByNames" resultMap="GenTableResult">
|
|
|
- select table_name, table_comment, create_time, update_time from information_schema.tables
|
|
|
- where table_name NOT LIKE 'qrtz\_%' and table_name NOT LIKE 'gen\_%' and table_schema = (select database())
|
|
|
- and table_name in
|
|
|
- <foreach collection="array" item="name" open="(" separator="," close=")">
|
|
|
- #{name}
|
|
|
- </foreach>
|
|
|
+ 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
|
|
|
+ and uo.object_type = 'TABLE'
|
|
|
+ AND dt.table_name NOT LIKE 'QRTZ_%' AND dt.table_name NOT LIKE 'GEN_%'
|
|
|
+ AND dt.table_name NOT IN (select table_name from gen_table)
|
|
|
+ and lower(dt.table_name) in
|
|
|
+ <foreach collection="array" item="name" open="(" separator="," close=")">
|
|
|
+ #{name}
|
|
|
+ </foreach>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
|
|
|
- select table_name, table_comment, create_time, update_time from information_schema.tables
|
|
|
- where table_comment <![CDATA[ <> ]]> '' and table_schema = (select database())
|
|
|
- and table_name = #{tableName}
|
|
|
+ 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
|
|
|
+ and uo.object_type = 'TABLE'
|
|
|
+ AND dt.table_name NOT LIKE 'QRTZ_%' AND dt.table_name NOT LIKE 'GEN_%'
|
|
|
+ AND dt.table_name NOT IN (select table_name from gen_table)
|
|
|
+ and lower(dt.table_name) = #{tableName}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
|
|
@@ -120,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
|
|
|
- SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
|
|
|
+ SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
|
|
|
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
|
|
FROM gen_table t
|
|
|
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|