|
@@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<mapper namespace="com.boman.gen.mapper.GenTableMapper">
|
|
|
|
|
|
<resultMap type="GenTable" id="GenTableResult">
|
|
|
- <id property="tableId" column="table_id" />
|
|
|
+ <id property="id" column="id" />
|
|
|
<result property="tableName" column="table_name" />
|
|
|
<result property="tableComment" column="table_comment" />
|
|
|
<result property="subTableName" column="sub_table_name" />
|
|
@@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="GenTableColumn" id="GenTableColumnResult">
|
|
|
- <id property="columnId" column="column_id" />
|
|
|
+ <id property="id" column="c_id" />
|
|
|
<result property="tableId" column="table_id" />
|
|
|
<result property="columnName" column="column_name" />
|
|
|
<result property="columnComment" column="column_comment" />
|
|
@@ -67,15 +67,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectGenTableVo">
|
|
|
- select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options,
|
|
|
+ select id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options,
|
|
|
create_by, create_time, update_by, update_time, remark, is_menu, menu_role, ak_column, dk_column, trigger_create, trigger_retrieve, trigger_update, trigger_delete, trigger_submit, real_table_name, filter_conditions, extended_attributes, table_primary_key from gen_table
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
|
|
|
<include refid="selectGenTableVo"/>
|
|
|
<where>
|
|
|
- <if test="tableId != null and tableId != ''">
|
|
|
- AND table_id = #{tableId}
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ AND id = #{id}
|
|
|
</if>
|
|
|
<if test="tableName != null and tableName != ''">
|
|
|
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
|
|
@@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
create_time,
|
|
|
update_time
|
|
|
FROM
|
|
|
- information_schema. TABLES
|
|
|
+ information_schema.TABLES
|
|
|
WHERE
|
|
|
table_schema = (SELECT DATABASE())
|
|
|
AND table_name NOT LIKE 'qrtz_%'
|
|
@@ -122,30 +122,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectGenTableById" parameterType="Long" 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.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark, t.is_menu, t.menu_role, t.ak_column, t.dk_column, t.trigger_create, t.trigger_retrieve, t.trigger_update, t.trigger_delete, t.trigger_submit, t.real_table_name, t.filter_conditions, t.extended_attributes, t.table_primary_key,
|
|
|
- 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
|
|
|
+ SELECT t.id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, 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, t.is_menu, t.menu_role, t.ak_column, t.dk_column, t.trigger_create, t.trigger_retrieve, t.trigger_update, t.trigger_delete, t.trigger_submit, t.real_table_name, t.filter_conditions, t.extended_attributes, t.table_primary_key,
|
|
|
+ c.id as c_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
|
|
|
- where t.table_id = #{tableId} order by c.sort
|
|
|
+ LEFT JOIN gen_table_column c ON t.id = c.table_id
|
|
|
+ where t.id = #{tableId} order by c.sort
|
|
|
</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.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark, t.is_menu, t.menu_role, t.ak_column, t.dk_column, t.trigger_create, t.trigger_retrieve, t.trigger_update, t.trigger_delete, t.trigger_submit, t.real_table_name, t.filter_conditions, t.extended_attributes, t.table_primary_key,
|
|
|
- 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
|
|
|
+ SELECT t.id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, 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, t.is_menu, t.menu_role, t.ak_column, t.dk_column, t.trigger_create, t.trigger_retrieve, t.trigger_update, t.trigger_delete, t.trigger_submit, t.real_table_name, t.filter_conditions, t.extended_attributes, t.table_primary_key,
|
|
|
+ c.id as c_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
|
|
|
+ LEFT JOIN gen_table_column c ON t.id = c.table_id
|
|
|
where t.table_name = #{tableName} order by c.sort
|
|
|
</select>
|
|
|
|
|
|
<select id="selectGenTableAll" 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.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark, t.is_menu, t.menu_role, t.ak_column, t.dk_column, t.trigger_create, t.trigger_retrieve, t.trigger_update, t.trigger_delete, t.trigger_submit, t.real_table_name, t.filter_conditions, t.extended_attributes, t.table_primary_key,
|
|
|
- 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
|
|
|
+ SELECT t.id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark, t.is_menu, t.menu_role, t.ak_column, t.dk_column, t.trigger_create, t.trigger_retrieve, t.trigger_update, t.trigger_delete, t.trigger_submit, t.real_table_name, t.filter_conditions, t.extended_attributes, t.table_primary_key,
|
|
|
+ c.id as c_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
|
|
|
+ LEFT JOIN gen_table_column c ON t.id = c.table_id
|
|
|
order by c.sort
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
|
|
+ <insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into gen_table (
|
|
|
<if test="tableName != null">table_name,</if>
|
|
|
<if test="tableComment != null and tableComment != ''">table_comment,</if>
|
|
@@ -239,13 +239,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="tablePrimaryKey != null and tablePrimaryKey !=''">table_primary_key = #{tablePrimaryKey},</if>
|
|
|
update_time = sysdate()
|
|
|
</set>
|
|
|
- where table_id = #{tableId}
|
|
|
+ where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteGenTableByIds" parameterType="Long">
|
|
|
- delete from gen_table where table_id in
|
|
|
- <foreach collection="array" item="tableId" open="(" separator="," close=")">
|
|
|
- #{tableId}
|
|
|
+ delete from gen_table where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|