---
# System prepended metadata

title: Pixid pb de perf API CustomerEarning

---

# Pixid pb de perf API CustomerEarning

```
SELECT 
    [Extent1].[ID] AS [ID], 
    [Extent1].[CALCULATION_PERIOD] AS [CALCULATION_PERIOD], 
    [Extent1].[TRIGGER_EARNING] AS [TRIGGER_EARNING], 
    [Extent1].[LOWER_BOUND] AS [LOWER_BOUND], 
    [Extent1].[UPPER_BOUND] AS [UPPER_BOUND], 
    [Extent1].[THRESHOLD] AS [THRESHOLD], 
    [Extent1].[TYPE] AS [TYPE], 
    [Extent1].[TRIGGERED_QUANTITY] AS [TRIGGERED_QUANTITY], 
    [Extent1].[CUSTOMER_TEXT] AS [CUSTOMER_TEXT], 
    [Extent1].[EARNING_TEXT] AS [EARNING_TEXT], 
    [Extent1].[BU_CODE] AS [BU_CODE], 
    [Extent1].[BRANCH_CODE] AS [BRANCH_CODE], 
    [Extent1].[CUST_FUNC_ID] AS [CUST_FUNC_ID], 
    [Extent1].[SIRET] AS [SIRET], 
    [Extent1].[EARNING_NUM] AS [EARNING_NUM], 
    [Extent1].[EFFECTIVE_DATE] AS [EFFECTIVE_DATE], 
    [Extent1].[IS_DELETED] AS [IS_DELETED], 
    [Extent1].[LAST_MODIFICATION_DATE] AS [LAST_MODIFICATION_DATE]
    FROM [dbo].[CUSTOMER_PARAM_EARNING] AS [Extent1]
    WHERE ([Extent1].[BU_CODE] = @p__linq__0) AND (0 = [Extent1].[IS_DELETED]) AND (([Extent1].[CUST_FUNC_ID] = @p__linq__1) OR (( NOT (([Extent1].[EARNING_NUM] = @p__linq__2) AND (0 = (CASE WHEN (@p__linq__2 IS NULL) THEN cast(1 as bit) ELSE cast(0 as bit) END)))) AND ([Extent1].[EARNING_NUM] < '500') AND (([Extent1].[BRANCH_CODE] IS NULL) OR ((LEN([Extent1].[BRANCH_CODE])) = 0)) AND ([Extent1].[CUST_FUNC_ID] IS NULL) AND (([Extent1].[SIRET] IS NULL) OR ((LEN([Extent1].[SIRET])) = 0))))
```
Merci Victor

Requête avec valeurs dans paramètres
```
SELECT 
    [Extent1].[ID] AS [ID], 
    [Extent1].[CALCULATION_PERIOD] AS [CALCULATION_PERIOD], 
    [Extent1].[TRIGGER_EARNING] AS [TRIGGER_EARNING], 
    [Extent1].[LOWER_BOUND] AS [LOWER_BOUND], 
    [Extent1].[UPPER_BOUND] AS [UPPER_BOUND], 
    [Extent1].[THRESHOLD] AS [THRESHOLD], 
    [Extent1].[TYPE] AS [TYPE], 
    [Extent1].[TRIGGERED_QUANTITY] AS [TRIGGERED_QUANTITY], 
    [Extent1].[CUSTOMER_TEXT] AS [CUSTOMER_TEXT], 
    [Extent1].[EARNING_TEXT] AS [EARNING_TEXT], 
    [Extent1].[BU_CODE] AS [BU_CODE], 
    [Extent1].[BRANCH_CODE] AS [BRANCH_CODE], 
    [Extent1].[CUST_FUNC_ID] AS [CUST_FUNC_ID], 
    [Extent1].[SIRET] AS [SIRET], 
    [Extent1].[EARNING_NUM] AS [EARNING_NUM], 
    [Extent1].[EFFECTIVE_DATE] AS [EFFECTIVE_DATE], 
    [Extent1].[IS_DELETED] AS [IS_DELETED], 
    [Extent1].[LAST_MODIFICATION_DATE] AS [LAST_MODIFICATION_DATE]
    FROM [dbo].[CUSTOMER_PARAM_EARNING] AS [Extent1]
    WHERE ([Extent1].[BU_CODE] = '01') AND (0 = [Extent1].[IS_DELETED]) AND (([Extent1].[CUST_FUNC_ID] = '5813877') 
	OR (( NOT (([Extent1].[EARNING_NUM] = '324') 
		AND (0 = (CASE WHEN (324 IS NULL) THEN cast(1 as bit) ELSE cast(0 as bit) END)))) 
		AND ([Extent1].[EARNING_NUM] < '500') AND (([Extent1].[BRANCH_CODE] IS NULL) 
	OR ((LEN([Extent1].[BRANCH_CODE])) = 0)) AND ([Extent1].[CUST_FUNC_ID] IS NULL) 
		AND (([Extent1].[SIRET] IS NULL) OR ((LEN([Extent1].[SIRET])) = 0))))
```