自增id问题
This commit is contained in:
@@ -41,7 +41,6 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService
|
||||
@Override
|
||||
public int insertGenTableColumn(GenTableColumn genTableColumn)
|
||||
{
|
||||
genTableColumn.setColumnId(IdUtil.getSnowflakeNextId());
|
||||
return genTableColumnMapper.insertGenTableColumn(genTableColumn);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,6 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
{
|
||||
String tableName = table.getTableName();
|
||||
GenUtils.initTable(table, operName);
|
||||
table.setTableId(IdUtil.getSnowflake().nextId());
|
||||
int row = genTableMapper.insertGenTable(table);
|
||||
if (row > 0)
|
||||
{
|
||||
@@ -187,7 +186,6 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
for (GenTableColumn column : genTableColumns)
|
||||
{
|
||||
GenUtils.initColumnField(column, table);
|
||||
column.setColumnId(IdUtil.getSnowflake().nextId());
|
||||
genTableColumnMapper.insertGenTableColumn(column);
|
||||
}
|
||||
}
|
||||
@@ -334,7 +332,6 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
}
|
||||
else
|
||||
{
|
||||
column.setColumnId(IdUtil.getSnowflakeNextId());
|
||||
genTableColumnMapper.insertGenTableColumn(column);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
c.column_id
|
||||
</select>
|
||||
|
||||
<insert id="insertGenTableColumn" parameterType="GenTableColumn" >
|
||||
<insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
|
||||
insert into gen_table_column (
|
||||
<if test="columnId != null ">column_id,</if>
|
||||
<if test="tableId != null and tableId != ''">table_id,</if>
|
||||
|
||||
@@ -140,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by c.sort
|
||||
</select>
|
||||
|
||||
<insert id="insertGenTable" parameterType="GenTable" >
|
||||
<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId" >
|
||||
insert into gen_table (
|
||||
<if test="tableId != null">table_id,</if>
|
||||
<if test="tableName != null">table_name,</if>
|
||||
|
||||
Reference in New Issue
Block a user