SELECT
COUNT(DISTINCT product0_.id) AS col_0_0_
FROM
Product product0_
LEFT OUTER JOIN product_parament_value paramenter1_
ON product0_.id = paramenter1_.product_Id
LEFT OUTER JOIN ProductTempletParamenterValue producttem2_
ON paramenter1_.value_Id = producttem2_.id
WHERE product0_.logicDelTag <> '1'
AND (
'ff80808149fa75de0149fabcab4403d4' IN
(SELECT
categorys3_.element
FROM
Product_categorys categorys3_
WHERE product0_.id = categorys3_.Product_id)
OR 'ff80808149fa75de0149fabd1baf03d9' IN
(SELECT
categorys4_.element
FROM
Product_categorys categorys4_
WHERE product0_.id = categorys4_.Product_id)
OR 'ff80808149fa75de0149fabd730703dd' IN
(SELECT
categorys5_.element
FROM
Product_categorys categorys5_
WHERE product0_.id = categorys5_.Product_id)
OR 'ff80808149fa75de0149fabdd79103e2' IN
(SELECT
categorys6_.element
FROM
Product_categorys categorys6_
WHERE product0_.id = categorys6_.Product_id)
OR 'ff80808149fa75de0149fabdfd6603e6' IN
(SELECT
categorys7_.element
FROM
Product_categorys categorys7_
WHERE product0_.id = categorys7_.Product_id)
OR 'ff80808149fa75de0149fabe27cb03ea' IN
(SELECT
categorys8_.element
FROM
Product_categorys categorys8_
WHERE product0_.id = categorys8_.Product_id)
OR 'ff80808149fa75de0149fabe5e1b03ee' IN
(SELECT
categorys9_.element
FROM
Product_categorys categorys9_
WHERE product0_.id = categorys9_.Product_id)
OR 'ff80808149fa75de0149fabf2e1e03f7' IN
(SELECT
categorys10_.element
FROM
Product_categorys categorys10_
WHERE product0_.id = categorys10_.Product_id)
OR 'ff80808149fa75de0149fabf603603fb' IN
(SELECT
categorys11_.element
FROM
Product_categorys categorys11_
WHERE product0_.id = categorys11_.Product_id)
OR 'ff80808149fa75de0149fabf87c703ff' IN
(SELECT
categorys12_.element
FROM
Product_categorys categorys12_
WHERE product0_.id = categorys12_.Product_id)
OR 'ff80808149fa75de0149fabfb2d70403' IN
(SELECT
categorys13_.element
FROM
Product_categorys categorys13_
WHERE product0_.id = categorys13_.Product_id)
OR 'ff80808149fa75de0149fac063670407' IN
(SELECT
categorys14_.element
FROM
Product_categorys categorys14_
WHERE product0_.id = categorys14_.Product_id)
OR 'ff80808149fa75de0149fac098f1040b' IN
(SELECT
categorys15_.element
FROM
Product_categorys categorys15_
WHERE product0_.id = categorys15_.Product_id)
OR 'ff80808149fa75de0149fac0eb78040f' IN
(SELECT
categorys16_.element
FROM
Product_categorys categorys16_
WHERE product0_.id = categorys16_.Product_id)
OR 'ff80808149fa75de0149fac113e70413' IN
(SELECT
categorys17_.element
FROM
Product_categorys categorys17_
WHERE product0_.id = categorys17_.Product_id)
OR 'ff80808149fa75de0149ff8ac29d1d90' IN
(SELECT
categorys18_.element
FROM
Product_categorys categorys18_
WHERE product0_.id = categorys18_.Product_id)
OR 'ff80808149fa75de0149fac16ffc0417' IN
(SELECT
categorys19_.element
FROM
Product_categorys categorys19_
WHERE product0_.id = categorys19_.Product_id)
OR 'ff80808149fa75de0149fac19bcc041c' IN
(SELECT
categorys20_.element
FROM
Product_categorys categorys20_
WHERE product0_.id = categorys20_.Product_id)
OR 'ff80808149fa75de0149fac1c5e30420' IN
(SELECT
categorys21_.element
FROM
Product_categorys categorys21_
WHERE product0_.id = categorys21_.Product_id)
OR 'ff80808149fa75de0149fac1ea520424' IN
(SELECT
categorys22_.element
FROM
Product_categorys categorys22_
WHERE product0_.id = categorys22_.Product_id)
OR 'ff80808149fa75de0149fac20c470428' IN
(SELECT
categorys23_.element
FROM
Product_categorys categorys23_
WHERE product0_.id = categorys23_.Product_id)
OR 'ff80808149fa75de0149fac3cabf042c' IN
(SELECT
categorys24_.element
FROM
Product_categorys categorys24_
WHERE product0_.id = categorys24_.Product_id)
OR 'ff80808149fa75de0149fac3ef050430' IN
(SELECT
categorys25_.element
FROM
Product_categorys categorys25_
WHERE product0_.id = categorys25_.Product_id)
OR 'ff80808149fa75de0149fac416d60434' IN
(SELECT
categorys26_.element
FROM
Product_categorys categorys26_
WHERE product0_.id = categorys26_.Product_id)
)
------解决思路----------------------
SELECT COUNT(DISTINCT product0_.id) AS col_0_0_
FROM Product product0_
LEFT OUTER JOIN product_parament_value paramenter1_ ON product0_.id = paramenter1_.product_Id
LEFT OUTER JOIN ProductTempletParamenterValue producttem2_ ON paramenter1_.value_Id = producttem2_.id
WHERE product0_.logicDelTag <> '1'
AND exists(select 1 from Product_categorys as categorys3_
where product0_.id = categorys3_.Product_id
and categorys3_.element in('ff80808149fa75de0149fabcab4403d4',
,'ff80808149fa75de0149fabd1baf03d9'
,'ff80808149fa75de0149fabd730703dd'
,'ff80808149fa75de0149fabdd79103e2'
,'ff80808149fa75de0149fabdfd6603e6'
,'ff80808149fa75de0149fabe27cb03ea'
,'ff80808149fa75de0149fabe5e1b03ee'
,'ff80808149fa75de0149fabf2e1e03f7'))
------解决思路----------------------
查询中,请把or逻辑转换为and逻辑