All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.custom-sql.default.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0"?>

<custom-sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListAccountRelFinder.countByCommercePriceListId">
		<![CDATA[
			SELECT
				COUNT(DISTINCT CommercePriceListAccountRel.commercePriceListAccountRelId) AS COUNT_VALUE
			FROM
				CommercePriceListAccountRel
			JOIN
				AccountEntry ON
					CommercePriceListAccountRel.commerceAccountId = AccountEntry.accountEntryId
			JOIN
				CommercePriceList ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			WHERE
				(CommercePriceList.commercePriceListId = ?) AND
				(LOWER(AccountEntry.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListAccountRelFinder.findByCommercePriceListId">
		<![CDATA[
			SELECT
				DISTINCT CommercePriceListAccountRel.*
			FROM
				CommercePriceListAccountRel
			JOIN
				AccountEntry ON
					CommercePriceListAccountRel.commerceAccountId = AccountEntry.accountEntryId
			JOIN
				CommercePriceList ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			WHERE
				(CommercePriceList.commercePriceListId = ?) AND
				(LOWER(AccountEntry.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListChannelRelFinder.countByCommercePriceListId">
		<![CDATA[
			SELECT
				COUNT(DISTINCT CommercePriceListChannelRel.CommercePriceListChannelRelId) AS COUNT_VALUE
			FROM
				CommercePriceListChannelRel
			JOIN
				CommercePriceList ON
					CommercePriceListChannelRel.commercePriceListId = CommercePriceList.commercePriceListId
			JOIN
				CommerceChannel ON
					CommercePriceListChannelRel.commerceChannelId = CommerceChannel.commerceChannelId
			WHERE
				(CommercePriceList.commercePriceListId = ?) AND
				(LOWER(CommerceChannel.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListChannelRelFinder.findByCommercePriceListId">
		<![CDATA[
			SELECT
				DISTINCT CommercePriceListChannelRel.*
			FROM
				CommercePriceListChannelRel
			JOIN
				CommercePriceList ON
					CommercePriceListChannelRel.commercePriceListId = CommercePriceList.commercePriceListId
			JOIN
				CommerceChannel ON
					CommercePriceListChannelRel.commerceChannelId = CommerceChannel.commerceChannelId
			WHERE
				(CommercePriceList.commercePriceListId = ?) AND
				(LOWER(CommerceChannel.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListCommerceAccountGroupRelFinder.countByCommercePriceListId">
		<![CDATA[
			SELECT
				COUNT(DISTINCT CPLCommerceGroupAccountRel.CPLCommerceAccountGroupRelId) AS COUNT_VALUE
			FROM
				CPLCommerceGroupAccountRel
			JOIN
				CommercePriceList ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			JOIN
				AccountGroup ON
					CPLCommerceGroupAccountRel.commerceAccountGroupId = AccountGroup.accountGroupId
			WHERE
				(CommercePriceList.commercePriceListId = ?) AND
				(LOWER(AccountGroup.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListCommerceAccountGroupRelFinder.findByCommercePriceListId">
		<![CDATA[
			SELECT
				DISTINCT CPLCommerceGroupAccountRel.*
			FROM
				CPLCommerceGroupAccountRel
			JOIN
				CommercePriceList ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			JOIN
				AccountGroup ON
					CPLCommerceGroupAccountRel.commerceAccountGroupId = AccountGroup.accountGroupId
			WHERE
				(CommercePriceList.commercePriceListId = ?) AND
				(LOWER(AccountGroup.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.countByCommercePricingClassId">
		<![CDATA[
			SELECT
				COUNT(DISTINCT CommercePriceList.commercePriceListId) AS COUNT_VALUE
			FROM
				CommercePriceList
			INNER JOIN
				CommercePriceModifier ON
					CommercePriceList.commercePriceListId = CommercePriceModifier.commercePriceListId
			INNER JOIN
				CommercePriceModifierRel ON
					CommercePriceModifier.commercePriceModifierId = CommercePriceModifierRel.commercePriceModifierId
			WHERE
				(CommercePriceModifierRel.classNameId = ?) AND
				(CommercePriceModifierRel.classPK = ?) AND
				(LOWER(CommercePriceList.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.countByCPInstanceUuid">
		<![CDATA[
			SELECT
				COUNT(CommercePriceEntry.commercePriceEntryId) AS COUNT_VALUE
			FROM
				CommercePriceEntry
			WHERE
				CommercePriceEntry.CPInstanceUuid = ?
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByExpirationDate">
		<![CDATA[
			SELECT
				CommercePriceList.*
			FROM
				CommercePriceList
			WHERE
				(CommercePriceList.expirationDate < ?) AND
				(CommercePriceList.expirationDate IS NOT NULL) AND
				([$OWNER_USER_ID$] [$OWNER_USER_ID_AND_OR_CONNECTOR$] ([$STATUS$]))
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByCommerceAccountId">
		<![CDATA[
			SELECT
				CommercePriceList.*
			FROM
				CommercePriceListAccountRel
			INNER JOIN
				CommercePriceList ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CommercePriceListChannelRel ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceListChannelRel.commercePriceListId
			WHERE
				(CommercePriceListAccountRel.commerceAccountId = ?) AND
				(CommercePriceListChannelRel.commercePriceListChannelRelId IS NULL) AND
				(CommercePriceList.groupId = ?) AND
				(CommercePriceList.type_ = ?) AND
				(CommercePriceList.status = 0)
			ORDER BY
				CommercePriceList.priority DESC
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByCommercePricingClassId">
		<![CDATA[
			SELECT
				DISTINCT CommercePriceList.*
			FROM
				CommercePriceList
			INNER JOIN
				CommercePriceModifier ON
					CommercePriceList.commercePriceListId = CommercePriceModifier.commercePriceListId
			INNER JOIN
				CommercePriceModifierRel ON
					CommercePriceModifier.commercePriceModifierId = CommercePriceModifierRel.commercePriceModifierId
			WHERE
				(CommercePriceModifierRel.classNameId = ?) AND
				(CommercePriceModifierRel.classPK = ?) AND
				(LOWER(CommercePriceList.name) LIKE ? [$AND_OR_NULL_CHECK$])
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByCPInstanceUuid">
		<![CDATA[
			SELECT
				CommercePriceEntry.*
			FROM
				CommercePriceEntry
			WHERE
				CommercePriceEntry.CPInstanceUuid = ?
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByAccountAndChannelId">
		<![CDATA[
			SELECT
				CommercePriceList.*
			FROM
				CommercePriceListChannelRel
			INNER JOIN
				CommercePriceListAccountRel ON
					CommercePriceListChannelRel.commercePriceListId = CommercePriceListAccountRel.commercePriceListId
			INNER JOIN
				CommercePriceList ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			WHERE
				(CommercePriceListChannelRel.commerceChannelId = ?) AND
				(CommercePriceListAccountRel.commerceAccountId = ?) AND
				(CommercePriceList.groupId = ?) AND
				(CommercePriceList.type_ = ?) AND
				(CommercePriceList.status = 0)
			ORDER BY
				CommercePriceList.priority DESC
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByCommerceAccountGroupIds">
		<![CDATA[
			SELECT
				CommercePriceList.*
			FROM
				CPLCommerceGroupAccountRel
			INNER JOIN
				CommercePriceList ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CommercePriceListChannelRel ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceListChannelRel.commercePriceListId
			WHERE
				(CPLCommerceGroupAccountRel.commerceAccountGroupId IN ([$ACCOUNT_GROUP_IDS$])) AND
				(CommercePriceListChannelRel.commercePriceListChannelRelId IS NULL) AND
				(CommercePriceList.groupId = ?) AND
				(CommercePriceList.type_ = ?) AND
				(CommercePriceList.status = 0)
			ORDER BY
				CommercePriceList.priority DESC
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByAccountGroupsAndChannelId">
		<![CDATA[
			SELECT
				CommercePriceList.*
			FROM
				CommercePriceListChannelRel
			INNER JOIN
				CPLCommerceGroupAccountRel ON
					CommercePriceListChannelRel.commercePriceListId = CPLCommerceGroupAccountRel.commercePriceListId
			INNER JOIN
				CommercePriceList ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			WHERE
				(CommercePriceListChannelRel.commerceChannelId = ?) AND
				(CPLCommerceGroupAccountRel.commerceAccountGroupId IN ([$ACCOUNT_GROUP_IDS$])) AND
				(CommercePriceList.groupId = ?) AND
				(CommercePriceList.type_ = ?) AND
				(CommercePriceList.status = 0)
			ORDER BY
				CommercePriceList.priority DESC
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByCommerceChannelId">
		<![CDATA[
			SELECT
				CommercePriceList.*
			FROM
				CommercePriceListChannelRel
			INNER JOIN
				CommercePriceList ON
					CommercePriceListChannelRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CommercePriceListAccountRel ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CPLCommerceGroupAccountRel ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			WHERE
				(CommercePriceListChannelRel.commerceChannelId = ?) AND
				(CommercePriceListAccountRel.commercePriceListAccountRelId IS NULL) AND
				(CPLCommerceGroupAccountRel.CPLCommerceAccountGroupRelId IS NULL) AND
				(CommercePriceList.groupId = ?) AND
				(CommercePriceList.type_ = ?) AND
				(CommercePriceList.status = 0)
			ORDER BY
				CommercePriceList.priority DESC
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByUnqualified">
		<![CDATA[
			SELECT
				CommercePriceList.*
			FROM
				CommercePriceList
			LEFT JOIN
				CommercePriceListAccountRel ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CommercePriceListChannelRel ON
					CommercePriceListChannelRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CPLCommerceGroupAccountRel ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			WHERE
				(CommercePriceListAccountRel.commercePriceListAccountRelId IS NULL) AND
				(CommercePriceListChannelRel.commercePriceListChannelRelId IS NULL) AND
				(CPLCommerceGroupAccountRel.cPLCommerceAccountGroupRelId IS NULL) AND
				(CommercePriceList.groupId = ?) AND
				(CommercePriceList.type_ = ?) AND
				(CommercePriceList.status = 0)
			ORDER BY
				CommercePriceList.priority DESC,
				CommercePriceList.catalogBasePriceList ASC
		]]>
	</sql>
	<sql id="com.liferay.commerce.price.list.service.persistence.CommercePriceListFinder.findByLowestPrice">
		<![CDATA[
			SELECT
				CommercePriceEntry.*
			FROM
				CommercePriceEntry
			INNER JOIN
				CommercePriceList ON
					CommercePriceList.commercePriceListId = CommercePriceEntry.commercePriceListId
			LEFT JOIN
				CommercePriceListAccountRel ON
					CommercePriceListAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CommercePriceListChannelRel ON
					CommercePriceListChannelRel.commercePriceListId = CommercePriceList.commercePriceListId
			LEFT JOIN
				CPLCommerceGroupAccountRel ON
					CPLCommerceGroupAccountRel.commercePriceListId = CommercePriceList.commercePriceListId
			WHERE
				(CommercePriceEntry.CPInstanceUuid = ?) AND
				(CommercePriceEntry.status = 0) AND
				(CommercePriceList.groupId = ?) AND
				(CommercePriceList.type_ = ?) AND
				(CommercePriceList.status = 0) AND
				(
					(CommercePriceListAccountRel.commerceAccountId = ?) OR
					(CommercePriceListAccountRel.commercePriceListAccountRelId IS NULL)
				) AND
				(
					(CommercePriceListChannelRel.commerceChannelId = ?) OR
					(CommercePriceListChannelRel.commercePriceListChannelRelId IS NULL)
				) AND
				(
					(CPLCommerceGroupAccountRel.commerceAccountGroupId IN ([$ACCOUNT_GROUP_IDS$])) OR
					(CPLCommerceGroupAccountRel.cPLCommerceAccountGroupRelId IS NULL)
				)
			ORDER BY
				CommercePriceEntry.price ASC
		]]>
	</sql>
</custom-sql>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy