|
|
@@ -25,7 +25,7 @@
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
<result property="remark" column="remark"/>
|
|
|
- <!-- <collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult"/>-->
|
|
|
+ <collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="GenTableColumn" id="GenTableColumnResult">
|
|
|
@@ -144,27 +144,37 @@
|
|
|
and table_name = #{tableName}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectById" parameterType="Long" resultMap="GenTableResult">
|
|
|
+ <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.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
|
|
|
- where t.table_id = #{tableId}
|
|
|
+ LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
|
|
+ where t.table_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.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
|
|
|
- where t.table_name = #{tableName}
|
|
|
+ LEFT JOIN gen_table_column c ON t.table_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.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
|
|
|
+ order by c.sort
|
|
|
</select>
|
|
|
|
|
|
<insert id="insert" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId" keyColumn="table_id">
|