Commit 8132ae09132afd31c368ae0e16e41e7b19243dab
1 parent
ed04c24e
代码生成列属性排序查询
Showing
3 changed files
with
3 additions
and
4 deletions
ruoyi-ui/src/views/tool/gen/index.vue
| @@ -80,7 +80,7 @@ | @@ -80,7 +80,7 @@ | ||
| 80 | 80 | ||
| 81 | <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> | 81 | <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> |
| 82 | <el-table-column type="selection" width="55"></el-table-column> | 82 | <el-table-column type="selection" width="55"></el-table-column> |
| 83 | - <el-table-column label="序号" align="center" prop="tableId" width="50px" /> | 83 | + <el-table-column label="序号" align="center" prop="tableId" width="60px" /> |
| 84 | <el-table-column | 84 | <el-table-column |
| 85 | label="表名称" | 85 | label="表名称" |
| 86 | align="center" | 86 | align="center" |
ruoyi/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java
| @@ -119,7 +119,6 @@ public class GenController extends BaseController | @@ -119,7 +119,6 @@ public class GenController extends BaseController | ||
| 119 | @PutMapping | 119 | @PutMapping |
| 120 | public AjaxResult editSave(@Validated @RequestBody GenTable genTable) | 120 | public AjaxResult editSave(@Validated @RequestBody GenTable genTable) |
| 121 | { | 121 | { |
| 122 | - System.out.println(genTable.getParams().size()); | ||
| 123 | genTableService.validateEdit(genTable); | 122 | genTableService.validateEdit(genTable); |
| 124 | genTableService.updateGenTable(genTable); | 123 | genTableService.updateGenTable(genTable); |
| 125 | return AjaxResult.success(); | 124 | return AjaxResult.success(); |
ruoyi/src/main/resources/mybatis/tool/GenTableMapper.xml
| @@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 110 | 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 | 110 | 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 |
| 111 | FROM gen_table t | 111 | FROM gen_table t |
| 112 | LEFT JOIN gen_table_column c ON t.table_id = c.table_id | 112 | LEFT JOIN gen_table_column c ON t.table_id = c.table_id |
| 113 | - where t.table_id = #{tableId} | 113 | + where t.table_id = #{tableId} order by c.sort |
| 114 | </select> | 114 | </select> |
| 115 | 115 | ||
| 116 | <select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult"> | 116 | <select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult"> |
| @@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 118 | 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 | 118 | 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 |
| 119 | FROM gen_table t | 119 | FROM gen_table t |
| 120 | LEFT JOIN gen_table_column c ON t.table_id = c.table_id | 120 | LEFT JOIN gen_table_column c ON t.table_id = c.table_id |
| 121 | - where t.table_name = #{tableName} | 121 | + where t.table_name = #{tableName} order by c.sort |
| 122 | </select> | 122 | </select> |
| 123 | 123 | ||
| 124 | <insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId"> | 124 | <insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId"> |