alter view vBluesealProductList as
SELECT
  concat(`p`.`id`, '-', `pv`.`id`)         AS `codice`,
  `p`.`id`                                 AS `id`,
  `p`.`productVariantId`                   AS `productVariantId`,
  concat(`p`.`itemno`, ' # ', `pv`.`name`) AS `cpf`,
  `s`.`name`                               AS `shop`,
  `p`.`externalId`                         AS `externalId`,
  `pb`.`name`                              AS `brand`,
  `ps`.`name`                              AS `status`,
  `p`.`creationDate`                       AS `creationDate`,
  `s`.`id`                                 AS `shopId`,
  `pc`.`slug`                              AS `slug`
FROM (((((((`Product` `p`
  JOIN `ProductVariant` `pv`) JOIN `ProductBrand` `pb`) JOIN `ProductStatus` `ps`) JOIN `ShopHasProduct` `sp`) JOIN
  `Shop` `s`) JOIN `ProductCategory` `pc`) JOIN `ProductHasProductCategory` `ppc`)
WHERE ((`p`.`productVariantId` = `pv`.`id`) AND (`p`.`productBrandId` = `pb`.`id`) AND
       (((`p`.`id` = `sp`.`productId`) AND (`p`.`productVariantId` = `sp`.`productVariantId`)) OR
        (isnull(`sp`.`productId`) AND isnull(`sp`.`productVariantId`))) AND (`sp`.`shopId` = `s`.`id`) AND
       (`ps`.id = `p`.productStatusId) AND (`pc`.`id` = `ppc`.`productCategoryId`) AND
       (((`p`.`id` = `ppc`.`productId`) AND (`p`.`productVariantId` = `ppc`.`productVariantId`)) OR
        (isnull(`ppc`.`productId`) AND isnull(`ppc`.`productVariantId`))));

