|
@@ -24,7 +24,7 @@ class ${moduleName} {
|
|
|
|
|
|
static def saveItems(params) {
|
|
|
long rowEffect = 0
|
|
|
- def primary_key = DbConv.asString(params.primary_key)
|
|
|
+ def primaryKey = DbConv.asString(params.primaryKey)
|
|
|
|
|
|
// 获取 queryDsl 针对某张表的 insert/update/remove 的操作对象
|
|
|
def insert = queryDsl.insert(${camelName(tableName)}) // insert 操作对象
|
|
@@ -37,10 +37,10 @@ class ${moduleName} {
|
|
|
|
|
|
for (def row : params.removeRecords) {
|
|
|
// 提取 removeRecords 全部删除的数据
|
|
|
- if (row._origin[primary_key] != null) {
|
|
|
+ if (row._origin[primaryKey] != null) {
|
|
|
// 构建删除条件,添加到 "批量执行(addBatch)" 的缓存中
|
|
|
remove.where(
|
|
|
- ${camelName(tableName)}.${camelName(primary_key)}.eq(DbConv.asString(row._origin[primary_key]))
|
|
|
+ ${camelName(tableName)}.${camelName(primaryKey)}.eq(DbConv.asString(row._origin[primaryKey]))
|
|
|
).addBatch()
|
|
|
d++ // 计数
|
|
|
}
|
|
@@ -101,7 +101,7 @@ class ${moduleName} {
|
|
|
</#if>
|
|
|
.where(
|
|
|
// row._origin.xxx 就是修改前 xxx 属性的值
|
|
|
- ${camelName(tableName)}.${camelName(primary_key)}.eq(DbConv.asString(row._origin[primary_key]))
|
|
|
+ ${camelName(tableName)}.${camelName(primaryKey)}.eq(DbConv.asString(row._origin[primaryKey]))
|
|
|
).addBatch()
|
|
|
u++ // 计数
|
|
|
}
|