From 15b729dc1a0323aae7b8d829d49a9d1d66c81ca9 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 24 Jul 2012 07:50:20 +0000 Subject: [PATCH] issue #0001280 : Traitement des valeurs d'avisCs --- config/Sphinx/Dev/ciblage.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/Sphinx/Dev/ciblage.conf b/config/Sphinx/Dev/ciblage.conf index 73587f7..234061f 100644 --- a/config/Sphinx/Dev/ciblage.conf +++ b/config/Sphinx/Dev/ciblage.conf @@ -25,7 +25,7 @@ source ciblage IF(teff_etab IS NULL,99,teff_etab), \ IF(web='',0,1) AS web, \ IF(mail='',0,1) AS mail, \ - IF(adrDom='',0,1) AS adrDom, \ + IF(adrDom>0,1,0) AS adrDom, \ actifEco, \ presentRcs, \ procolHisto, \ @@ -68,9 +68,13 @@ source ciblage CASE zru WHEN '' THEN 0 WHEN 'NSP' THEN 0 ELSE 1 END as zru, \ CASE cucs WHEN '' THEN 0 WHEN 'NSP' THEN 0 ELSE 1 END as cucs, \ IF(zrr=1,1,0) as zrr, \ - IF(zafr=1,1,0) as zafr \ + IF(zafr=1,1,0) as zafr, \ + CASE avisCs WHEN 0 THEN 1 WHEN 10 THEN 2 WHEN 15 THEN 3 WHEN 23 THEN 4 WHEN 29 THEN 4 WHEN 39 THEN 4 WHEN 43 THEN 4 WHEN 21 THEN 5 WHEN 26 THEN 5 WHEN 28 THEN 5 WHEN 31 THEN 6 WHEN 50 THEN 6 WHEN 24 THEN 7 ELSE 0 END as avisCs \ FROM etablissements_act WHERE siren>100; +SELECT CASE avisCs WHEN 0 THEN 1 WHEN 10 THEN 2 WHEN 15 THEN 3 WHEN 23 THEN 4 WHEN 29 THEN 4 WHEN 39 THEN 4 WHEN 43 THEN 4 WHEN 21 THEN 5 WHEN 26 THEN 5 WHEN 28 THEN 5 WHEN 31 THEN 6 WHEN 50 THEN 6 WHEN 24 THEN 7 ELSE 0 END as avisCs FROM etablissements_act WHERE id=23514139 +5907540 + sql_field_string = siren sql_field_string = nic sql_attr_uint = siege