SELECT p.codePrestataire,p.libelle,l.libelle,p.telephoneFixe,p.telephonePortable,p.longitude,p.latitude,actif,
p.nomResponsable,p.adresseGeo
FROM prestataire p
INNER JOIN localite l ON (l.codeLocalite=p.codeLocalite)
WHERE  
-- l.libelle LIKE "%ANYAMA%" -- AND p.adresseGeo!='' 
-- AND
 p.latitude IS NULL 
-- AND p.adresseGeo NOT like "ADJAME%"
AND p.codePrestataire IN (SELECT codePrestataire FROM detailreseausoins)  -- CHAMPS
AND p.codeTypePrestataire='OPT' AND p.codePays="CI" -- and latitude=(NULL)  --  AND p.conventionne=1
-- AND p.codePrestataire="CE0104"




UPDATE prestataire p
INNER JOIN localite l ON (l.codeLocalite=p.codeLocalite)
SET p.adresseGeo=CONCAT("TREICHVILLE,",p.adresseGeo)
WHERE  l.libelle="TREICHVILLE" AND p.adresseGeo!='' 
AND p.adresseGeo NOT LIKE "TREICHVILLE%"
AND p.codePrestataire IN (SELECT codePrestataire FROM detailreseausoins)  -- CHAMPS
AND p.codeTypePrestataire='CSO' AND p.codePays="CI" -- and latitude=(NULL)  --  AND p.conventionne=1
-- AND p.codePrestataire="CE0104"


SELECT * FROM limiteadherent
WHERE exercieReference=2021

 

	UPDATE `limiteadherent` SET 
		`consommationAdherent` = fn_cumulfacture_adherent(`codeSociete`,`idAdherent`) WHERE exercieReference=exercieReference;
		
		
		
		SELECT fn_cumulfacture_adherent_rp("vitalis","212","2022");
		
	
	UPDATE limiteadherent l 
	INNER JOIN adherent a ON(a.id=l.idAdherent)
	SET l.consommationAdherent = fn_cumulfacture_adherent_rp("vitalis",l.idAdherent,"2021") 
	WHERE exercieReference=2011 ;
	
	
	
		
		UPDATE `limiteadherent` SET 
		`consommationAdherent` = fn_cumulfacture_adherent_rp("vitalis","212","2022") WHERE idAdherent="212" AND exercieReference=2022 ;
	
	/*UPDATE `limitebeneficiaire` SET 
		`consommationBeneficiaire` = fn_cumulfacture_beneficiaire("vitalis","211","2022")WHERE idAdherent="211";*/