[步骤]

SELECT * from sys_autopublishdata where StrategyId in (
59286,
59287,
59288,
59289,
59290,
59291,
59292,
59293,
59294,
59295,
59296,
59297,
59298,
59299,
59300,
59301,
59303,
59304,
59305,
58750,
59377)
策略ID:58750 指定了248个SKU,只执行了90条 找出其中符合条件的在建指定策略
【策略ID: 59377 无数据执行 指定 系统SKU: 10688829 1402102 15458238 3453784 4079638 4525185 7615635 8405029 9612151 】

[结果]
策略58570:找出其中符合条件的在建指定策略
其它策略,找出执行不出数据的原因
[期望]







本次验证策略 59377,
第一步 查询接口过滤后,只剩下3个符合条件的,查询SQL如下:
SELECT
`m`.`CustomerId` AS `CustomerId`,
`m`.`Sku` AS `Sku`,
`m`.`CustomSku` AS `CustomSku`,
`m`.`IsVariant` AS `IsVariant`,
`m`.`IsMainVariant` AS `IsMainVariant`,
`m`.`ParentId` AS `ParentId`,
`m`.`Id` AS `Id`,
`m`.`LogisticsAttribute` AS `LogisticsAttribute`,
`m`.`FinalJudgmentStatus` AS `FinalJudgmentStatus`,
`m`.`FinalJudgmentTime` AS `FinalJudgmentTime`,
`m`.`AccurateKeywords` AS `AccurateKeywords`,
`m`.`BrandId` AS `BrandId`,
`m`.`BrandName` AS `BrandName`,
`m`.`CartonPcsNum` AS `CartonPcsNum`,
`m`.`CategoryId` AS `CategoryId`,
`m`.`CategoryIds` AS `CategoryIds`,
`m`.`FirstCategoryId` AS `FirstCategoryId`,
`m`.`Color` AS `Color`,
`m`.`DeclarationCode` AS `DeclarationCode`,
`m`.`DeclarationLocalName` AS `DeclarationLocalName`,
`m`.`DeclarationName` AS `DeclarationName`,
`m`.`DeclarationPrice` AS `DeclarationPrice`,
`m`.`DevelopmentType` AS `DevelopmentType`,
`m`.`EditStatus` AS `EditStatus`,
`m`.`GrossWeight` AS `GrossWeight`,
`m`.`GroupSkuId` AS `GroupSkuId`,
`m`.`Height` AS `Height`,
`m`.`IsDelete` AS `IsDelete`,
`m`.`IsGroup` AS `IsGroup`,
`m`.`RiskInfringement` AS `RiskInfringement`,
`m`.`Length` AS `Length`,
`m`.`Material` AS `Material`,
`m`.`MaxPurchasePrice` AS `MaxPurchasePrice`,
`m`.`MinPurchasePrice` AS `MinPurchasePrice`,
`m`.`Name` AS `Name`,
`m`.`NameEn` AS `NameEn`,
`m`.`NetWeight` AS `NetWeight`,
`m`.`PackageHeight` AS `PackageHeight`,
`m`.`PackageLength` AS `PackageLength`,
`m`.`PackageWeight` AS `PackageWeight`,
`m`.`PackageWidth` AS `PackageWidth`,
`m`.`PurchasePrice` AS `PurchasePrice`,
`m`.`StrongPlug` AS `StrongPlug`,
`m`.`StrongPlugItem` AS `StrongPlugItem`,
`m`.`Size` AS `Size`,
`m`.`ShoeTightness` AS `ShoeTightness`,
`m`.`StartBatch` AS `StartBatch`,
`m`.`State` AS `State`,
`m`.`SuitableforGender` AS `SuitableforGender`,
`m`.`SupplyPrice` AS `SupplyPrice`,
`m`.`Type` AS `Type`,
`m`.`Width` AS `Width`
FROM
(
SELECT
`m`.`CustomerId` AS `CustomerId`,
`m`.`Sku` AS `Sku`,
`m`.`CustomSku` AS `CustomSku`,
`m`.`IsVariant` AS `IsVariant`,
`m`.`IsMainVariant` AS `IsMainVariant`,
`m`.`ParentId` AS `ParentId`,
`m`.`Id` AS `Id`,
`m`.`LogisticsAttribute` AS `LogisticsAttribute`,
`m`.`FinalJudgmentStatus` AS `FinalJudgmentStatus`,
`m`.`FinalJudgmentTime` AS `FinalJudgmentTime`,
`m`.`AccurateKeywords` AS `AccurateKeywords`,
`m`.`BrandId` AS `BrandId`,
`m`.`BrandName` AS `BrandName`,
`m`.`CartonPcsNum` AS `CartonPcsNum`,
`m`.`CategoryId` AS `CategoryId`,
`m`.`CategoryIds` AS `CategoryIds`,
`m`.`FirstCategoryId` AS `FirstCategoryId`,
`m`.`Color` AS `Color`,
`m`.`DeclarationCode` AS `DeclarationCode`,
`m`.`DeclarationLocalName` AS `DeclarationLocalName`,
`m`.`DeclarationName` AS `DeclarationName`,
`m`.`DeclarationPrice` AS `DeclarationPrice`,
`m`.`DevelopmentType` AS `DevelopmentType`,
`m`.`EditStatus` AS `EditStatus`,
`m`.`GrossWeight` AS `GrossWeight`,
`m`.`GroupSkuId` AS `GroupSkuId`,
`m`.`Height` AS `Height`,
`m`.`IsDelete` AS `IsDelete`,
`m`.`IsGroup` AS `IsGroup`,
`m`.`RiskInfringement` AS `RiskInfringement`,
`m`.`Length` AS `Length`,
`m`.`Material` AS `Material`,
`m`.`MaxPurchasePrice` AS `MaxPurchasePrice`,
`m`.`MinPurchasePrice` AS `MinPurchasePrice`,
`m`.`Name` AS `Name`,
`m`.`NameEn` AS `NameEn`,
`m`.`NetWeight` AS `NetWeight`,
`m`.`PackageHeight` AS `PackageHeight`,
`m`.`PackageLength` AS `PackageLength`,
`m`.`PackageWeight` AS `PackageWeight`,
`m`.`PackageWidth` AS `PackageWidth`,
`m`.`PurchasePrice` AS `PurchasePrice`,
`m`.`StrongPlug` AS `StrongPlug`,
`m`.`StrongPlugItem` AS `StrongPlugItem`,
`m`.`Size` AS `Size`,
`m`.`ShoeTightness` AS `ShoeTightness`,
`m`.`StartBatch` AS `StartBatch`,
`m`.`State` AS `State`,
`m`.`SuitableforGender` AS `SuitableforGender`,
`m`.`SupplyPrice` AS `SupplyPrice`,
`m`.`Type` AS `Type`,
`m`.`Width` AS `Width`
FROM
(
SELECT
`m`.`CustomerId` AS `CustomerId`,
`m`.`Sku` AS `Sku`,
`m`.`CustomSku` AS `CustomSku`,
`m`.`IsVariant` AS `IsVariant`,
`m`.`IsMainVariant` AS `IsMainVariant`,
`m`.`ParentId` AS `ParentId`,
`m`.`Id` AS `Id`,
`m`.`LogisticsAttribute` AS `LogisticsAttribute`,
`m`.`FinalJudgmentStatus` AS `FinalJudgmentStatus`,
`m`.`FinalJudgmentTime` AS `FinalJudgmentTime`,
`m`.`AccurateKeywords` AS `AccurateKeywords`,
`m`.`BrandId` AS `BrandId`,
`m`.`BrandName` AS `BrandName`,
`m`.`CartonPcsNum` AS `CartonPcsNum`,
`m`.`CategoryId` AS `CategoryId`,
`m`.`CategoryIds` AS `CategoryIds`,
`m`.`FirstCategoryId` AS `FirstCategoryId`,
`m`.`Color` AS `Color`,
`m`.`DeclarationCode` AS `DeclarationCode`,
`m`.`DeclarationLocalName` AS `DeclarationLocalName`,
`m`.`DeclarationName` AS `DeclarationName`,
`m`.`DeclarationPrice` AS `DeclarationPrice`,
`m`.`DevelopmentType` AS `DevelopmentType`,
`m`.`EditStatus` AS `EditStatus`,
`m`.`GrossWeight` AS `GrossWeight`,
`m`.`GroupSkuId` AS `GroupSkuId`,
`m`.`Height` AS `Height`,
`m`.`IsDelete` AS `IsDelete`,
`m`.`IsGroup` AS `IsGroup`,
`m`.`RiskInfringement` AS `RiskInfringement`,
`m`.`Length` AS `Length`,
`m`.`Material` AS `Material`,
`m`.`MaxPurchasePrice` AS `MaxPurchasePrice`,
`m`.`MinPurchasePrice` AS `MinPurchasePrice`,
`m`.`Name` AS `Name`,
`m`.`NameEn` AS `NameEn`,
`m`.`NetWeight` AS `NetWeight`,
`m`.`PackageHeight` AS `PackageHeight`,
`m`.`PackageLength` AS `PackageLength`,
`m`.`PackageWeight` AS `PackageWeight`,
`m`.`PackageWidth` AS `PackageWidth`,
`m`.`PurchasePrice` AS `PurchasePrice`,
`m`.`StrongPlug` AS `StrongPlug`,
`m`.`StrongPlugItem` AS `StrongPlugItem`,
`m`.`Size` AS `Size`,
`m`.`ShoeTightness` AS `ShoeTightness`,
`m`.`StartBatch` AS `StartBatch`,
`m`.`State` AS `State`,
`m`.`SuitableforGender` AS `SuitableforGender`,
`m`.`SupplyPrice` AS `SupplyPrice`,
`m`.`Type` AS `Type`,
`m`.`Width` AS `Width`
FROM
(
SELECT
`CustomerId`,
`Sku`,
`CustomSku`,
`IsVariant`,
`IsMainVariant`,
`ParentId`,
`Name`,
`NameEn`,
`BrandId`,
`BrandName`,
`Material`,
`FirstCategoryId`,
`CategoryId`,
`CategoryIds`,
`State`,
`StartBatch`,
`RiskInfringement`,
`Type`,
`LogisticsAttribute`,
`StrongPlug`,
`StrongPlugItem`,
`PurchasePrice`,
`MinPurchasePrice`,
`MaxPurchasePrice`,
`SupplyPrice`,
`Color`,
`Size`,
`PackageWeight`,
`GrossWeight`,
`NetWeight`,
`Length`,
`Width`,
`Height`,
`PackageLength`,
`PackageWidth`,
`PackageHeight`,
`DevelopmentType`,
`FinalJudgmentTime`,
`EditStatus`,
`DeclarationPrice`,
`AccurateKeywords`,
`FinalJudgmentStatus`,
`DeclarationName`,
`DeclarationCode`,
`SuitableforGender`,
`ShoeTightness`,
`CartonPcsNum`,
`IsGroup`,
`GroupSkuId`,
`DeclarationLocalName`,
`IsDelete`,
`RealSku`,
`LastModifierId`,
`LastModifier`,
`LastModificationTime`,
`CreatorId`,
`Creator`,
`CreationTime`,
`Id`
FROM
P_Product FORCE INDEX ( idx_finaljudgmenttime )
) m
LEFT JOIN (
SELECT
`CustomerId` AS `CustomerId`,
`Sku` AS `Sku`
FROM
`Ap_AutoPublish_AliExpress_AllSku`
WHERE
((((
`CustomerId` = 1
)
AND ( `MarketId` = 57 ))
AND ( `StrategyId` = 59377 ))
AND ( `OrderSourceId` = 12607 ))
) s ON ((
`m`.`CustomerId` = `s`.`CustomerId`
)
AND ( `m`.`Sku` = `s`.`Sku` ))
WHERE
((((((((((((((((((
NOT ( `m`.`IsDelete` = 1 )
AND ( IFNULL( CAST( `m`.`IsGroup` AS SIGNED ), FALSE ) <> TRUE ))
AND ( `m`.`Id` > 0 ))
AND ((
`m`.`CustomerId` = 1
)
AND ( `m`.`FinalJudgmentStatus` = 1 )))
AND ( `s`.`Sku` IS NULL ))
AND ( `m`.`IsMainVariant` = 1 )
)
AND NOT ( `m`.`IsVariant` = 1 )
)
AND (
`m`.`State` IN ( 0, 1, 4 ))
)
AND (( CASE WHEN ( `m`.`State` = 1 ) THEN `m`.`StartBatch` ELSE 1 END ) >= 1 ))
AND (( CASE WHEN ( `m`.`State` = 1 ) THEN `m`.`StartBatch` ELSE 2000 END ) <= 2000 ))
AND (
`m`.`RiskInfringement` IN ( 1 ))
)
AND ( `m`.`PackageLength` <= 60 ))
AND ( `m`.`PackageWidth` <= 60 ))
AND ( `m`.`PackageHeight` <= 60 ))
AND ((( `m`.`PackageLength` + `m`.`PackageWidth` ) + `m`.`PackageHeight` ) <= 90 ))
AND ((
CASE
WHEN ( `m`.`PackageWeight` = 0 ) THEN
`m`.`GrossWeight` ELSE `m`.`PackageWeight`
END
) <=(
10 * 1000
)))
AND ((
CASE
WHEN ((( `m`.`PackageLength` * `m`.`PackageWidth` ) * `m`.`PackageHeight` ) = 0 ) THEN
((( `m`.`Length` * `m`.`Width` ) * `m`.`Height` ) / 8000 ) ELSE ((( `m`.`PackageLength` * `m`.`PackageWidth` ) * `m`.`PackageHeight` ) / 8000 )
END
) <= 2
))
AND (((
CASE
WHEN ((( `m`.`PackageLength` * `m`.`PackageWidth` ) * `m`.`PackageHeight` ) = 0 ) THEN
((( `m`.`Length` * `m`.`Width` ) * `m`.`Height` ) / 8000 ) ELSE ((( `m`.`PackageLength` * `m`.`PackageWidth` ) * `m`.`PackageHeight` ) / 8000 )
END
) /(
CASE
WHEN ( `m`.`PackageWeight` = 0 ) THEN
`m`.`GrossWeight` ELSE `m`.`PackageWeight`
END
)) <= 2
))
AND (
NOT EXISTS (
SELECT
*
FROM
`P_Product_ProhibitionSaleMarket`
WHERE
((((
`CustomerId` = `m`.`CustomerId`
)
AND ( `MarketId` = 57 ))
AND ( `Sku` = `m`.`Sku` ))
AND ( `SiteCodes` IS NULL OR `SiteCodes` = '' ))
)))
) m
INNER JOIN ( SELECT CustomerId, Sku FROM Ap_AutoPublish_Strategy_Source_Sku WHERE CustomerId = 1 AND StrategyId = 59377 LIMIT 0, 20000 ) u ON ((
`m`.`CustomerId` = `u`.`CustomerId`
)
AND ( `m`.`Sku` = `u`.`Sku` ))
) m
INNER JOIN (
SELECT
`CustomerId`,
`ProductId`,
`MarketId`,
`SiteCode`,
`IsVariant`,
`Sku`,
`CustomSku`,
`FirstCategoryId`,
`CategoryId`,
`CategoryIds`,
`CollectionCategoryIds`,
`CollectionCategoryNames`,
`Title`,
`ShortTitle`,
`Tags`,
`Brand`,
`Dangerous`,
`Condition`,
`Material`,
`FinalJudgmentStatus`,
`DaysToShip`,
`LastModifierId`,
`LastModifier`,
`LastModificationTime`,
`CreatorId`,
`Creator`,
`CreationTime`,
`Id`
FROM
`P_Market_Product`
WHERE
((
`CustomerId` = 1
)
AND ( `MarketId` = 57 ))
AND NOT ( `CategoryId` IS NULL OR `CategoryId` = '' )
AND ( `SiteCode` = 'RU' )
) u ON ((
`m`.`CustomerId` = `u`.`CustomerId`
)
AND ( `m`.`Sku` = `u`.`Sku` ))
结果如下: