selectOneForUpdate
#function selectOneForUpdate($strTableName, $form, $options, $tipMsg)
#if ($vs.util.isString($options))
#set($options = $vs.util.fromJson($options))
#end
#if ($vs.util.isString($tipMsg))
#set($tipMsg = '数据已变更,请刷新重试!')
#end
#set($where = $vs.util.newMap())
#if ($vs.util.isList($options))
#foreach ($key in $options)
$where.put($key, $form.get(key))
#end
#end
#if ($vs.util.isMap($options))
#foreach ($key in $vs.util.getMapKeys($options))
$where.put($options.get($key), $form.get(key))
#end
#end
#set($one = $vs.dbTools.selectOne($strTableName, $where))
$vs.util.checkInput($one, $tipMsg)
#set($result = $vs.util.newMap())
$result.put('where', $where)
$result.put('one', $one)
return $result
#end
selectOneForSimpleUpdate
#function selectOneForSimpleUpdate($strTableName, $form, $primaryKey, $optimisticLock)
#set($primaryKeyVar = $form.get($primaryKey))
#set($optimisticLockVar = $form.get($optimisticLock))
$vs.util.checkInput($primaryKeyVar, '主键不能为空!')
$vs.util.checkInput($optimisticLockVar, '乐观锁不能为空!')
#set($where = $vs.util.newMap())
$where.put($primaryKey, $primaryKeyVar)
$where.put($optimisticLock, $optimisticLockVar)
#set($one = $vs.dbTools.selectOne($strTableName, $where))
$vs.util.checkInput($one, '数据已变更,请刷新重试!')
#set($result = $vs.util.newMap())
$result.put('where', $where)
$result.put('one', $one)
return $result
#end