Subversion Repositories SmartDukaan

Rev

Rev 5160 | Rev 5798 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5160 Rev 5539
Line 182... Line 182...
182
    <connection>transactionDC_Prod</connection>
182
    <connection>transactionDC_Prod</connection>
183
    <sql>SELECT SQL_NO_CACHE o.id &apos;order_id&apos;, o.customer_id, o.customer_pincode, 
183
    <sql>SELECT SQL_NO_CACHE o.id &apos;order_id&apos;, o.customer_id, o.customer_pincode, 
184
o.status &apos;order_status&apos;, o.total_amount, 
184
o.status &apos;order_status&apos;, o.total_amount, 
185
datediff(o.created_timestamp, &apos;20101231&apos;) as date_id, hour(o.created_timestamp) as order_hour,
185
datediff(o.created_timestamp, &apos;20101231&apos;) as date_id, hour(o.created_timestamp) as order_hour,
186
o.transaction_id, l.item_id, l.quantity,
186
o.transaction_id, l.item_id, l.quantity,
187
case when unit_price&lt;2000 then 0 when unit_price &lt; 5000 then 1 when unit_price &lt; 10000 then 2 when unit_price &lt; 15000 then 3 when unit_price &lt;20000 then 4 when unit_price &lt; 50000 then 5 else 6 end as price_range,
187
case when unit_price&lt;250 then 0 when unit_price&lt;500 then 1 when unit_price&lt;1000 then 2 when unit_price&lt;2000 then 3 when unit_price &lt; 5000 then 4 when unit_price &lt; 10000 then 5 when unit_price &lt; 15000 then 6 when unit_price &lt;20000 then 7 when unit_price &lt; 50000 then 8 else 9 end as price_range,
188
l.transfer_price, p.gatewayId, 
188
l.transfer_price, p.gatewayId, 
189
case when pa.value is null then case when p.gatewayId = 1 then 2099 when p.gatewayId = 2 then 1099 else null end else pa.value end &apos;payment_method&apos;,
189
case when pa.value is null then case when p.gatewayId = 1 then 2099 when p.gatewayId = 2 then 1099 else null end else pa.value end &apos;payment_method&apos;,
190
upper(trim(t.coupon_code)) as coupon_code, 
190
upper(trim(t.coupon_code)) as coupon_code, 
191
case when t.session_source is null then &apos;Unknown&apos; when t.session_source like &apos;DIRECT%&apos; then &apos;Direct&apos; when t.session_source like &apos;ORGANIC%&apos; then &apos;Organic&apos; when t.session_source like &apos;PAID%&apos; then &apos;Paid&apos; else &apos;Referer&apos; end as session_source_type,
191
case when t.session_source is null then &apos;Unknown&apos; when t.session_source like &apos;DIRECT%&apos; then &apos;Direct&apos; when t.session_source like &apos;ORGANIC%&apos; then &apos;Organic&apos; when t.session_source like &apos;PAID%&apos; then &apos;Paid&apos; else &apos;Referer&apos; end as session_source_type,
192
SUBSTRING_INDEX(REPLACE(REPLACE(SUBSTR(session_source, LOCATE(&apos;http:&#47;&#47;&apos;, LCASE(session_source)), LENGTH(session_source)), &apos;http:&#47;&#47;&apos;, &apos;&apos;), &apos;www.&apos;, &apos;&apos;), &apos;&#47;&apos;, 1) as session_source_url,
192
SUBSTRING_INDEX(REPLACE(REPLACE(SUBSTR(session_source, LOCATE(&apos;http:&#47;&#47;&apos;, LCASE(session_source)), LENGTH(session_source)), &apos;http:&#47;&#47;&apos;, &apos;&apos;), &apos;www.&apos;, &apos;&apos;), &apos;&#47;&apos;, 1) as session_source_url,