// 删除数据
function sqlGenDelete() {
    const findData = TABLE_STRUCT.find(item => item.column_name == COLUMN_KEY) || {}
    const parName = findData?.field_name || underscoreToCamel(COLUMN_KEY)
    const ids = payload.get().query[parName + '[]']
    const tempParams = []
    for (var i = 0; i < ids.length; i++) {
        tempParams.push('?')
    }
    stmt = `UPDATE ${TABLE_NAME} SET delete_time = NOW() WHERE ${COLUMN_KEY} IN (${tempParams.join(',')})`
    if (TABLE_INFO.before_hook) {
        result = runtime.call(TABLE_INFO.before_hook)
    }

    // let sql = `DELETE FROM ${TABLE_NAME} WHERE ${COLUMN_KEY} IN (${tempParams.join(',')})`
    SQL_STMTS.push(stmt)
    result = SQL.exec(
        DB_NAME,
        stmt, ...ids
    )

    if (TABLE_INFO.after_hook) {
        runtime.call(TABLE_INFO.after_hook)
    }

    if (result) {
        return okMsg(result)
    }

    return errMsg(507, '参数错误')
}