@ -17,13 +17,13 @@ public interface AgencyDataSyncSQL {
@SQL("SELECT PICPATH FROM ASK_AFFIX_INFO where HOSTNAME='AgencyData'")
StringgetIsCustomerVerify();
@SQL(value="SELECT distinct a.grpcontno , a.grpname, '', c.SocialInsuNo, e.MOBILEPHONE1,b.postaladdress, a.CValiDate,(select max(t.enddate) from lcpol t where t.grpcontno = a.grpcontno), nvl((select sum(t.amnt) from lcpol t where t.grpcontno = a.grpcontno ),0),'1', nvl((select sum(t.sumactupaymoney) from ljapayperson t where t.grpcontno = a.grpcontno and t.paytype = 'ZC'),0), (select t.name from lacom t where t.agentcom = a.agentcom) ,'泰和人寿保险股份有限公司','100', nvl(a.Amnt,0), nvl(a.Prem,0), (case when a.payintv=0 then '趸交' when a.payintv=-1 then '不定期交费'else '期交' end),a.polapplydate , (select riskname from lmriskapp t ,lcgrppol p where t.riskcode =p.riskcode and p.grpcontno = a.grpcontno and t.subriskflag = 'M' limit 1),'2' FROM lcgrpcont a, lcgrpappnt b, LCGrpContactInfo e , ldgrp c where 1=1 and a.appntno = c.customerno and a.grpcontno = b.grpcontno and e.CustomerNo =b.CustomerNo and b.customerno = e.customerno and exists (SELECT 1 FROM lcgrppol c , lmriskapp h WHERE a.grpcontno = c.grpcontno and c.RISKCODE = h.RISKCODE and h.RiskPeriod in ('S', 'M') ) and exists(select 1 from lacom t,lcagentcominfo t1 where t.AgentCom = t1.AgentCom and t1.PolicyNo = a.GrpContNo and (t.name like '%长安%' or t.name like '%新疆安泰保险经纪%'or t.name like '%山东保险%')) and a.SignDate = '?DealDate?' ")
@SQL(value="SELECT distinct a.grpcontno , a.grpname, '', c.SocialInsuNo, e.MOBILEPHONE1,b.postaladdress, a.CValiDate,(select max(t.enddate) from lcpol t where t.grpcontno = a.grpcontno), nvl((select sum(t.amnt) from lcpol t where t.grpcontno = a.grpcontno ),0),'1', nvl((select sum(t.sumactupaymoney) from ljapayperson t where t.grpcontno = a.grpcontno and t.paytype = 'ZC'),0), (select t.name from lacom t where t.agentcom = a.agentcom) ,'富泽人寿保险股份有限公司','100', nvl(a.Amnt,0), nvl(a.Prem,0), (case when a.payintv=0 then '趸交' when a.payintv=-1 then '不定期交费'else '期交' end),a.polapplydate , (select riskname from lmriskapp t ,lcgrppol p where t.riskcode =p.riskcode and p.grpcontno = a.grpcontno and t.subriskflag = 'M' limit 1),'2' FROM lcgrpcont a, lcgrpappnt b, LCGrpContactInfo e , ldgrp c where 1=1 and a.appntno = c.customerno and a.grpcontno = b.grpcontno and e.CustomerNo =b.CustomerNo and b.customerno = e.customerno and exists (SELECT 1 FROM lcgrppol c , lmriskapp h WHERE a.grpcontno = c.grpcontno and c.RISKCODE = h.RISKCODE and h.RiskPeriod in ('S', 'M') ) and exists(select 1 from lacom t,lcagentcominfo t1 where t.AgentCom = t1.AgentCom and t1.PolicyNo = a.GrpContNo and (t.name like '%长安%' or t.name like '%新疆安泰保险经纪%'or t.name like '%山东保险%')) and a.SignDate = '?DealDate?' ")
@SQL(value="SELECT (select (case when risktype='A' then '意外险' when risktype='H' then '健康险类' when risktype='L' then '人寿险类' end) from lmriskapp t where t.riskcode = a.riskcode), (select riskname from lmriskapp t where t.riskcode = a.riskcode), nvl((select sum(t.amnt) from lcpol t where t.grpcontno = a.grpcontno and t.grppolno = a.grppolno ),0), nvl((select sum(t.sumactupaymoney) from ljapayperson t where t.grpcontno = a.grpcontno and t.grppolno = a.grppolno and t.paytype = 'ZC'),0), (select count(distinct insuredno) from lcinsured t where t.grpcontno = a.grpcontno), '' FROM lcgrppol a WHERE a.grpcontno = '?grpcontno?' ")
@SQL(value="SELECT distinct a.grpcontno ,a.grpname, '', c.SocialInsuNo, e.MOBILEPHONE1,b.postaladdress, a.cvalidate,(select max(t.enddate) from lcpol t where t.grpcontno = a.grpcontno), nvl((select sum(t.amnt) from lcpol t where t.grpcontno = a.grpcontno ),0),'1',nvl((select sum(t.sumactupaymoney) from ljapayperson t where t.grpcontno = a.grpcontno and t.paytype = 'ZC'),0), (select t.name from lacom t where t.agentcom = a.agentcom) ,'泰和人寿保险股份有限公司','100', nvl(a.Amnt,0), nvl(a.Prem,0), (case when a.payintv=0 then '趸交' when a.payintv=-1 then '不定期交费'else '期交' end),a.polapplydate , (select riskname from lmriskapp t ,lcgrppol p where t.riskcode =p.riskcode and p.grpcontno = a.grpcontno and t.subriskflag = 'M' limit 1),'2', p.EDORNO FROM lcgrpcont a, lcgrpappnt b, LCGrpContactInfo e , ldgrp c,lpgrpedoritem p where 1=1 and p.grpcontno = a.grpcontno and a.appntno = c.customerno and a.grpcontno = b.grpcontno and e.CustomerNo =b.CustomerNo and b.customerno = e.customerno and exists (SELECT 1 FROM lcgrppol c , lmriskapp h WHERE a.grpcontno = c.grpcontno and c.RISKCODE = h.RISKCODE and h.RiskPeriod in ('S', 'M') ) and exists(select 1 from lacom t,lcagentcominfo t1 where t.AgentCom = t1.AgentCom and t1.PolicyNo = a.GrpContNo and (t.name like '%长安%' or t.name like '%新疆安泰保险经纪%'or t.name like '%山东保险%')) and p.edorstate = '0' and p.makedate = '?DealDate?' ")
@SQL(value="SELECT distinct a.grpcontno ,a.grpname, '', c.SocialInsuNo, e.MOBILEPHONE1,b.postaladdress, a.cvalidate,(select max(t.enddate) from lcpol t where t.grpcontno = a.grpcontno), nvl((select sum(t.amnt) from lcpol t where t.grpcontno = a.grpcontno ),0),'1',nvl((select sum(t.sumactupaymoney) from ljapayperson t where t.grpcontno = a.grpcontno and t.paytype = 'ZC'),0), (select t.name from lacom t where t.agentcom = a.agentcom) ,'富泽人寿保险股份有限公司','100', nvl(a.Amnt,0), nvl(a.Prem,0), (case when a.payintv=0 then '趸交' when a.payintv=-1 then '不定期交费'else '期交' end),a.polapplydate , (select riskname from lmriskapp t ,lcgrppol p where t.riskcode =p.riskcode and p.grpcontno = a.grpcontno and t.subriskflag = 'M' limit 1),'2', p.EDORNO FROM lcgrpcont a, lcgrpappnt b, LCGrpContactInfo e , ldgrp c,lpgrpedoritem p where 1=1 and p.grpcontno = a.grpcontno and a.appntno = c.customerno and a.grpcontno = b.grpcontno and e.CustomerNo =b.CustomerNo and b.customerno = e.customerno and exists (SELECT 1 FROM lcgrppol c , lmriskapp h WHERE a.grpcontno = c.grpcontno and c.RISKCODE = h.RISKCODE and h.RiskPeriod in ('S', 'M') ) and exists(select 1 from lacom t,lcagentcominfo t1 where t.AgentCom = t1.AgentCom and t1.PolicyNo = a.GrpContNo and (t.name like '%长安%' or t.name like '%新疆安泰保险经纪%'or t.name like '%山东保险%')) and p.edorstate = '0' and p.makedate = '?DealDate?' ")
@SQL(value="SELECT (select (case when risktype='A' then '意外险' when risktype='H' then '健康险类' when risktype='L' then '人寿险类' end) from lmriskapp t where t.riskcode = a.riskcode), (select riskname from lmriskapp t where t.riskcode = a.riskcode), nvl((select sum(t.amnt) from lcpol t where t.grpcontno = a.grpcontno and t.grppolno = a.grppolno ),0), nvl((select sum(t.sumactupaymoney) from ljapayperson t where t.grpcontno = a.grpcontno and t.grppolno = a.grppolno and t.paytype = 'ZC'),0), (select count(distinct insuredno) from lcinsured t where t.grpcontno = a.grpcontno), '' FROM lcgrppol a WHERE a.grpcontno = '?grpcontno?' ")