删除
$vs.util.checkInput($form, '参数不能为空!')
$vs.util.checkInput($form.PRIMARY_KEY, '主键不能为空!')
$vs.util.checkInput($form.OPTIMISTIC_LOCK, '乐观锁不能为空!')
#set($now = $vs.date.getDbDate())
#if ($vs.util.isNull($now))
#set($now = $vs.date.getDbDate())
#end
#set($where = $vs.util.newMap())
#set($where.PRIMARY_KEY = $form.PRIMARY_KEY)
#set($where.OPTIMISTIC_LOCK = $form.OPTIMISTIC_LOCK)
#set($one = $vs.dbTools.selectOne($strTableName, $where))
$vs.util.checkInput($one, '数据已变更,请刷新重试!')
#set($list = $vs.util.newList())
#if(!$list.contains($one.STATE))
$vs.exception.throwException('不可删除!')
#end
#set($i = $vs.dbTools.delete($strTableName, $where))
#if ($i != 1)
$vs.exception.throwException('数据已变更,请刷新重试!')
#end