This commit is contained in:
seb
2026-07-14 23:30:16 +02:00
parent 245fb047d7
commit 262fa63f1b
109 changed files with 21566 additions and 367 deletions

View File

@@ -43,23 +43,32 @@ static const char* DELETED_ENTITY_COUNT_SQL =
"SELECT COUNT(*) AS cnt FROM Pos.vDeletedEntity "
"WHERE CONVERT(BIGINT, vDeletedEntity.bLastChanged) > ?";
static const char* MAX_ORDER_ID_SQL =
"SELECT ISNULL(MAX(kPosAuftrag), 0) AS cnt FROM Pos.tAuftragMapping "
"WHERE kShopSubShop = ?";
inline int64_t get_category_count(int64_t root_cat, int k_shop, int64_t cursor) {
return get_pool().execute_scalar(CATEGORY_COUNT_SQL,
{{ParamType::BigInt,"",root_cat},{ParamType::BigInt,"",k_shop},
{ParamType::BigInt,"",k_shop},{ParamType::BigInt,"",cursor}});
{{ParamType::BigInt,"",root_cat},{ParamType::Int,"",k_shop},
{ParamType::Int,"",k_shop},{ParamType::BigInt,"",cursor}});
}
inline int64_t get_product_count(int64_t root_cat, int k_shop, int64_t cursor) {
return get_pool().execute_scalar(PRODUCT_COUNT_SQL,
{{ParamType::BigInt,"",root_cat},{ParamType::BigInt,"",k_shop},
{ParamType::BigInt,"",k_shop},{ParamType::BigInt,"",cursor},
{ParamType::BigInt,"",k_shop},{ParamType::BigInt,"",cursor}});
{{ParamType::BigInt,"",root_cat},{ParamType::Int,"",k_shop},
{ParamType::Int,"",k_shop},{ParamType::BigInt,"",cursor},
{ParamType::Int,"",k_shop},{ParamType::BigInt,"",cursor}});
}
inline int64_t get_composite_count(int k_shop, int64_t cursor) {
return get_pool().execute_scalar(COMPOSITE_PRODUCT_COUNT_SQL,
{{ParamType::BigInt,"",k_shop},{ParamType::BigInt,"",k_shop},
{{ParamType::Int,"",k_shop},{ParamType::Int,"",k_shop},
{ParamType::BigInt,"",cursor}});
}
inline int64_t get_deleted_count(int64_t cursor) {
return get_pool().execute_scalar(DELETED_ENTITY_COUNT_SQL,
{{ParamType::BigInt,"",cursor}});
}
inline int64_t get_max_order_id_count(int k_shop_subshop) {
if (k_shop_subshop <= 0) return 0;
return get_pool().execute_scalar(MAX_ORDER_ID_SQL,
{{ParamType::Int,"",k_shop_subshop}});
}