@ -29,14 +29,14 @@ public interface LCInsuredInfoSQL {
@SQL(value="update LCInsuredInfo a set a.InsuredBirthday=@{0}@{1} where a.batchno='?tBatchNo?' and a.flag='?tFlag?' and a.InsuredBirthday is not null ",
@SQL(value="update LCInsuredInfo a set a.InsuredBirthday=@{0}@{1} where a.batchno='?tBatchNo?' and a.flag='?tFlag?' and a.InsuredBirthday is not null ",
@ -47,7 +47,7 @@ public interface CheckInsuredInfoListSQL {
@SQL(value="update LCInsuredInfo a set a.reason=concat(a.reason,'?tReason?' ) where (select case when char_length(a.InsuredIDNo)=18 then substr(a.InsuredIDNo, 7, 8) else (concat('?tYear?',substr(a.InsuredIDNo, 7, 6))) end from dual)"+
@SQL(value="update LCInsuredInfo a set a.reason=concat(a.reason,'?tReason?' ) where (select case when char_length(a.InsuredIDNo)=18 then substr(a.InsuredIDNo, 7, 8) else (concat('?tYear?',substr(a.InsuredIDNo, 7, 6))) end from dual)"+
" <> @{0}@{1} and a.idtypecode='?tIDTypeCode?' and a.InsuredBirthday is not null and a.batchno='?tBatchNo?' and a.flag='?tFlag?' ",
" <> @{0}@{1} and a.idtypecode='?tIDTypeCode?' and a.InsuredBirthday is not null and a.batchno='?tBatchNo?' and a.flag='?tFlag?' ",
@ -65,7 +65,7 @@ public interface LBPOInsuredBnfListSQL {
@SQL(value="update lbpoinsuredbnflist set reason=concat(reason,'?reason?') "+
@SQL(value="update lbpoinsuredbnflist set reason=concat(reason,'?reason?') "+
"where (months_between('?CurrentDate?',birthday)<?minAge? or months_between('?CurrentDate?',birthday)>?maxAge?) "+
"where (EXTRACT(YEAR FROM AGE('?CurrentDate?'::DATE, birthday)) * 12+ EXTRACT(MONTH FROM AGE('?CurrentDate?'::DATE, birthday))+ EXTRACT(DAY FROM AGE('?CurrentDate?'::DATE, birthday)) / 31.0<?minAge? or EXTRACT(YEAR FROM AGE('?CurrentDate?'::DATE, birthday)) * 12+ EXTRACT(MONTH FROM AGE('?CurrentDate?'::DATE, birthday))+ EXTRACT(DAY FROM AGE('?CurrentDate?'::DATE, birthday)) / 31.0>?maxAge?) "+
"and batchno='"+"?mBatchNo?"+"' and state='?State?' ")
"and batchno='"+"?mBatchNo?"+"' and state='?State?' ")
@ -95,7 +95,7 @@ public interface LBPOInsuredBnfListSQL {
@SQL(value=" update lbpoinsuredbnflist a set a.reason=concat(ifnull(a.reason,''),'?mReason?' ) "+
@SQL(value=" update lbpoinsuredbnflist a set a.reason=concat(ifnull(a.reason,''),'?mReason?' ) "+
" where a.BatchNo='"+"?mBatchNo?"+"' and a.state='?mState?' and a.IDType = '0' and (a.Birthday is not null and a.Birthday != '') "+
" where a.BatchNo='"+"?mBatchNo?"+"' and a.state='?mState?' and a.IDType = '0' and (a.Birthday is not null and a.Birthday != '') "+
" and months_between(a.IDStartDate,a.Birthday)<12*46 and (a.IsLongValidName = '是' or a.IsLongValid = '1') ")
" and (EXTRACT(YEAR FROM AGE(a.IDStartDate, a.Birthday)) * 12 + EXTRACT(MONTH FROM AGE(a.IDStartDate, a.Birthday)))<12*46 and (a.IsLongValidName = '是' or a.IsLongValid = '1') ")
@ -176,7 +176,7 @@ public interface LBPOInsuredListSQL {
@SQL(value=" update lbpoinsuredlist a set a.reason=concat(ifnull(a.reason,''),'?mReason?' ) "+
@SQL(value=" update lbpoinsuredlist a set a.reason=concat(ifnull(a.reason,''),'?mReason?' ) "+
" where a.BatchNo='"+"?mBatchNo?"+"' and a.state='?mState?' and a.IDType = '0' and (a.Birthday is not null and a.Birthday != '') "+
" where a.BatchNo='"+"?mBatchNo?"+"' and a.state='?mState?' and a.IDType = '0' and (a.Birthday is not null and a.Birthday != '') "+
" and months_between(a.IDStartDate,a.Birthday)<12*46 and (a.IsLongValidName = '是' or a.IsLongValid = '1') ")
" and EXTRACT(YEAR FROM AGE(a.IDStartDate, a.Birthday)) * 12+ EXTRACT(MONTH FROM AGE(a.IDStartDate, a.Birthday))<12*46 and (a.IsLongValidName = '是' or a.IsLongValid = '1') ")
@SQL(value="select a.insuredno, a.contno, a.RelationToMainInsured, a.name, (select d1.codename from ldcode d1 where d1.codetype = 'sex' and code = a.sex) codename1, a.birthday, a.insuredappage, (select d2.codename from ldcode d2 where d2.codetype = 'idtype' and d2.code = a.idtype) codename2, a.idno, (select d3.codename from ldcode d3 where d3.codetype = 'occuptype' and d3.code = a.OccupationType) codename3,a.plancode ,a.OccupationCode,(select OccupationName from LDOccupation ldo where ldo.OccupationCode = a.OccupationCode) codename4,(select CodeName from ldcode ld where ld.CodeType = 'haveflag' and ld.code=a.SocialInsuFlag), (case when (select 1 from lcgrpcont l1 where l1.GrpContNo = a.GrpContNo and l1.State <10) then (select sum(c.prem) from lcpol c where c.grpcontno=a.grpcontno and c.contno=a.contno and c.insuredno=a.insuredno) else (select SumPrem from v_grpinsuredsumprem where insuredno= a.insuredno and ContNo = a.ContNo) end) ,a.InsureCode, a.maincustomerno, a.insuredtype,'是',if((select IsVerify from ldperson l where l.CustomerNo = a.InsuredNo limit 1)='1','公安实名认证','保险机构自主认证'), if(DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(a.Birthday)), '%Y')+0 > 60 ,'是','否') AS age,(select (case when b.State = 30 then '满期终止' when b.EndDate < CURRENT_DATE and b.State < 30 then '满期终止' when 40<=b.State and b.State <50 then '退保终止' when 50<=b.State and b.State < 60 then '理赔终止' else (select codename from ldcode where codetype='contstate' and code=b.state) end) from lccont b where b.ContNo = a.ContNo) as state from LCInsured a where 1=1 and a.InsuredType != '3' @{0} @{1} @{2} @{3} @{4} @{5} @{6} order by a.sequenceno,a.contno,a.insuredno",clauses={
@SQL(value="select a.insuredno, a.contno, a.RelationToMainInsured, a.name, (select d1.codename from ldcode d1 where d1.codetype = 'sex' and code = a.sex) codename1, a.birthday, a.insuredappage, (select d2.codename from ldcode d2 where d2.codetype = 'idtype' and d2.code = a.idtype) codename2, a.idno, (select d3.codename from ldcode d3 where d3.codetype = 'occuptype' and d3.code = a.OccupationType) codename3,a.plancode ,a.OccupationCode,(select OccupationName from LDOccupation ldo where ldo.OccupationCode = a.OccupationCode) codename4,(select CodeName from ldcode ld where ld.CodeType = 'haveflag' and ld.code=a.SocialInsuFlag), (case when (select 1 from lcgrpcont l1 where l1.GrpContNo = a.GrpContNo and l1.State <10) then (select sum(c.prem) from lcpol c where c.grpcontno=a.grpcontno and c.contno=a.contno and c.insuredno=a.insuredno) else (select SumPrem from v_grpinsuredsumprem where insuredno= a.insuredno and ContNo = a.ContNo) end) ,a.InsureCode, a.maincustomerno, a.insuredtype,'是',if((select IsVerify from ldperson l where l.CustomerNo = a.InsuredNo limit 1)='1','公安实名认证','保险机构自主认证'), if(EXTRACT(YEAR FROM age(CURRENT_DATE, a.Birthday)) > 60 ,'是','否') AS age,(select (case when b.State = 30 then '满期终止' when b.EndDate < CURRENT_DATE and b.State < 30 then '满期终止' when 40<=b.State and b.State <50 then '退保终止' when 50<=b.State and b.State < 60 then '理赔终止' else (select codename from ldcode where codetype='contstate' and code=b.state) end) from lccont b where b.ContNo = a.ContNo) as state from LCInsured a where 1=1 and a.InsuredType != '3' @{0} @{1} @{2} @{3} @{4} @{5} @{6} order by a.sequenceno,a.contno,a.insuredno",clauses={
@Clause(key=0,clause="and a.grpcontno like concat('#{para0}','%')",expression="#{para0} != empty"),
@Clause(key=0,clause="and a.grpcontno like concat('#{para0}','%')",expression="#{para0} != empty"),
@Clause(key=2,clause="and a.name like concat('#{para2}','%')",expression="#{para2} != empty"),
@Clause(key=2,clause="and a.name like concat('#{para2}','%')",expression="#{para2} != empty"),
@ -52,7 +52,7 @@ public interface LCInsuredInfoSql {
SSRSLCInsuredInfo6(@Param("para0")Stringpara0);
SSRSLCInsuredInfo6(@Param("para0")Stringpara0);
//#查询新增加的被保人信息
//#查询新增加的被保人信息
@SQL(value="select a.insuredno, a.contno, a.RelationToMainInsured, a.name, (select d1.codename from ldcode d1 where d1.codetype = 'sex' and code = a.sex) codename1, a.birthday, a.insuredappage, (select d2.codename from ldcode d2 where d2.codetype = 'idtype' and d2.code = a.idtype) codename2, a.idno, (select d3.codename from ldcode d3 where d3.codetype = 'occuptype' and d3.code = a.OccupationType) codename3,a.plancode ,a.OccupationCode,(select OccupationName from LDOccupation ldo where ldo.OccupationCode = a.OccupationCode) codename4,(select CodeName from ldcode ld where ld.CodeType = 'haveflag' and ld.code=a.SocialInsuFlag), (select sum(c.prem) from lcpol c where c.grpcontno=a.grpcontno and c.contno=a.contno and c.insuredno=a.insuredno) ,a.InsureCode, a.maincustomerno, a.insuredtype,'是',if((select IsVerify from ldperson l where l.CustomerNo = a.InsuredNo limit 1)='1','公安实名认证','保险机构自主认证'), if(DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(a.Birthday)), '%Y')+0 > 60 ,'是','否') AS age,(select (case when b.State = 30 then '满期终止' when b.EndDate < CURRENT_DATE and b.State < 30 then '满期终止' when 40<=b.State and b.State <50 then '退保终止' when 50<=b.State and b.State < 60 then '理赔终止' else (select codename from ldcode where codetype='contstate' and code=b.state) end) from lccont b where b.ContNo = a.ContNo) as state from LOBInsured a where 1=1 and a.InsuredType != '3' @{0} @{1} @{2} @{3} @{4} @{5} @{6} order by a.sequenceno,a.contno,a.insuredno",clauses={
@SQL(value="select a.insuredno, a.contno, a.RelationToMainInsured, a.name, (select d1.codename from ldcode d1 where d1.codetype = 'sex' and code = a.sex) codename1, a.birthday, a.insuredappage, (select d2.codename from ldcode d2 where d2.codetype = 'idtype' and d2.code = a.idtype) codename2, a.idno, (select d3.codename from ldcode d3 where d3.codetype = 'occuptype' and d3.code = a.OccupationType) codename3,a.plancode ,a.OccupationCode,(select OccupationName from LDOccupation ldo where ldo.OccupationCode = a.OccupationCode) codename4,(select CodeName from ldcode ld where ld.CodeType = 'haveflag' and ld.code=a.SocialInsuFlag), (select sum(c.prem) from lcpol c where c.grpcontno=a.grpcontno and c.contno=a.contno and c.insuredno=a.insuredno) ,a.InsureCode, a.maincustomerno, a.insuredtype,'是',if((select IsVerify from ldperson l where l.CustomerNo = a.InsuredNo limit 1)='1','公安实名认证','保险机构自主认证'), if(EXTRACT(YEAR FROM age(CURRENT_DATE, a.Birthday)) > 60 ,'是','否') AS age,(select (case when b.State = 30 then '满期终止' when b.EndDate < CURRENT_DATE and b.State < 30 then '满期终止' when 40<=b.State and b.State <50 then '退保终止' when 50<=b.State and b.State < 60 then '理赔终止' else (select codename from ldcode where codetype='contstate' and code=b.state) end) from lccont b where b.ContNo = a.ContNo) as state from LOBInsured a where 1=1 and a.InsuredType != '3' @{0} @{1} @{2} @{3} @{4} @{5} @{6} order by a.sequenceno,a.contno,a.insuredno",clauses={
@Clause(key=0,clause="and a.grpcontno like concat('#{para0}','%')",expression="#{para0} != empty"),
@Clause(key=0,clause="and a.grpcontno like concat('#{para0}','%')",expression="#{para0} != empty"),
@ -63,19 +63,26 @@ public interface CalInsuredStdPremBLSQL {
anda.GrpPropNo=lc.GrpPropNo
anda.GrpPropNo=lc.GrpPropNo
groupby
groupby
d.contplancode,
d.contplancode,
d.riskcode,
d.riskcode,
d.dutycode,
d.dutycode,
b.insuredappage,
b.insuredappage,
b.sex,
b.sex,
b.occupationtype,
b.occupationtype,
d.amnt,
d.amnt,
e.exceptpremtype,
e.exceptpremtype,
e.finalvalue,
e.finalvalue,
a.relationtomain,
a.relationtomain,
e.relashareflag,
e.relashareflag,
b.Substandard,
b.substandard,
b.SocialInsuFlag,
b.socialinsuflag,
b.ServerArea
b.serverarea,
lp.insuperiod,
lp.insuperiodflag,
lp.premcaltype,
lp.calparam,
e.policyno,
e.plancode,
lc.quotno
orderby
orderby
a.relationtomain,
a.relationtomain,
e.relashareflag,
e.relashareflag,
@ -225,13 +232,13 @@ public interface CalInsuredStdPremBLSQL {
@SQL("delete from lcduty where contno in(select d.contno from lbpoinsuredlist d,lcduty b where d.batchno='?mBatchNo?' and d.state='?tState?' and b.contno=d.ContNo and b.StandPrem=0 and b.dutycode not in ('231300','231301','231302','231303','231304','231305','231306'))")
@SQL("delete from lcduty where contno in(select d.contno from lbpoinsuredlist d,lcduty b where d.batchno='?mBatchNo?' and d.state='?tState?' and b.contno=d.ContNo and b.StandPrem=0 and b.dutycode not in ('231300','231301','231302','231303','231304','231305','231306'))")
@ -692,7 +692,7 @@ public interface CheckInsuredListSQL {
"and batchno='"+"?mBatchNo?"+"' and state='?state?'",
"and batchno='"+"?mBatchNo?"+"' and state='?state?'",
clauses={
clauses={
@Clause(key=0,dbType=SysConst.DBTYPE_ORACLE,clause=" and (select case when char_length(idno)=18 then substr(idno, 7, 8) else (concat('19',substr(idno, 7, 6))) end from dual) <> to_char(to_date(birthday,'yyyy-mm-dd'), 'yyyyMMdd') "),
@Clause(key=0,dbType=SysConst.DBTYPE_ORACLE,clause=" and (select case when char_length(idno)=18 then substr(idno, 7, 8) else (concat('19',substr(idno, 7, 6))) end from dual) <> to_char(to_date(birthday,'yyyy-mm-dd'), 'yyyyMMdd') "),
@Clause(key=1,dbType=SysConst.DBTYPE_MYSQL,clause=" and (select case when char_length(idno)=18 then substr(idno, 7, 8) else (concat('19',substr(idno, 7, 6))) end from dual) <> date_Format(str_to_date(birthday,'%Y-%m-%d'), '%Y%m%d') "),
@Clause(key=1,dbType=SysConst.DBTYPE_MYSQL,clause=" and (select case when char_length(idno)=18 then substr(idno, 7, 8) else (concat('19',substr(idno, 7, 6))) end from dual) <> TO_CHAR(TO_DATE(birthday, 'YYYY-MM-DD'), 'YYYYMMDD') "),
"select '?mGrpPropNo?',a.contno,a.insuredno,'?mGrpPropNo?',(select AppntNo from lcgrpcont l where l.GrpContNo = '?mGrpPropNo?'),'?tManageCom?',a.relationtomain,'0',a.serialno,a.insuredname,a.gender,a.birthday,a.idtype,a.idno,a.islongvalid,case when (a.IDStartDate is not null and a.IDStartDate!='') then a.IDStartDate else null end,case when (a.idenddate is not null and a.idenddate!='') then a.idenddate else null end, floor(months_between('?mCurrentDate?',a.birthday)/12),a.seniority,a.joincompdate,a.workidno,a.position,"+
"select '?mGrpPropNo?',a.contno,a.insuredno,'?mGrpPropNo?',(select AppntNo from lcgrpcont l where l.GrpContNo = '?mGrpPropNo?'),'?tManageCom?',a.relationtomain,'0',a.serialno,a.insuredname,a.gender,a.birthday,a.idtype,a.idno,a.islongvalid,case when (a.IDStartDate is not null and a.IDStartDate!='') then a.IDStartDate else null end,case when (a.idenddate is not null and a.idenddate!='') then a.idenddate else null end, floor((EXTRACT(YEAR FROM AGE(('?mCurrentDate?'::DATE), a.birthday)) * 12+ EXTRACT(MONTH FROM AGE(('?mCurrentDate?'::DATE), a.birthday))) / 12),a.seniority,a.joincompdate,a.workidno,a.position,"+
"(case when (a.salary is not null and a.salary!='') then a.salary else '0' end),(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), "+
"(case when (a.salary is not null and a.salary!='') then a.salary else '0' end),(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), "+
"'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?',a.PoliticalSecuCoopFlag ,a.IndividualBusOperFlag ,a.DisabledPersonFlag from lbpoinsuredlist a,lccontplan b where b.grpcontno = a.grppropno "+
"'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?',a.PoliticalSecuCoopFlag ,a.IndividualBusOperFlag ,a.DisabledPersonFlag from lbpoinsuredlist a,lccontplan b where b.grpcontno = a.grppropno "+
@ -35,7 +35,7 @@ public interface CreateInsuredDataSQL {
"select '?mGrpPropNo?',a.contno,a.insuredno,'?mGrpPropNo?',(select AppntNo from lcgrpcont l where l.GrpContNo = '?mGrpPropNo?'),'?tManageCom?',a.relationtomain,'0',a.serialno,a.insuredname,a.gender,a.birthday,a.idtype,a.idno,a.islongvalid,case when (a.IDStartDate is not null and a.IDStartDate!='') then a.IDStartDate else null end,case when (a.idenddate is not null and a.idenddate!='') then a.idenddate else null end, floor(months_between(ifnull(gc.CValiDate,sysdate()),a.birthday)/12),a.seniority,a.joincompdate,a.workidno,a.position,"+
"select '?mGrpPropNo?',a.contno,a.insuredno,'?mGrpPropNo?',(select AppntNo from lcgrpcont l where l.GrpContNo = '?mGrpPropNo?'),'?tManageCom?',a.relationtomain,'0',a.serialno,a.insuredname,a.gender,a.birthday,a.idtype,a.idno,a.islongvalid,case when (a.IDStartDate is not null and a.IDStartDate!='') then a.IDStartDate else null end,case when (a.idenddate is not null and a.idenddate!='') then a.idenddate else null end, floor((EXTRACT(YEAR FROM AGE(COALESCE(gc.CValiDate, CURRENT_DATE), a.birthday)) * 12+ EXTRACT(MONTH FROM AGE(COALESCE(gc.CValiDate, CURRENT_DATE), a.birthday))+ EXTRACT(DAY FROM AGE(COALESCE(gc.CValiDate, CURRENT_DATE), a.birthday)) / 31.0) / 12),a.seniority,a.joincompdate,a.workidno,a.position,"+
"(case when (a.salary is not null and a.salary!='') then a.salary else '0' end),(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), "+
"(case when (a.salary is not null and a.salary!='') then a.salary else '0' end),(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), "+
"'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?',a.PoliticalSecuCoopFlag ,a.IndividualBusOperFlag ,a.DisabledPersonFlag from lbpoinsuredlist a,lccontplan b,(select serialno from lbpoinsuredlist where batchno = '?mBatchNo?' and state = '?tState?' order by serialno limit ?tStartRow?,?tEndRow? ) tmp ,lcgrpcont gc where b.grpcontno = a.grppropno and a.serialno=tmp.serialno "+
"'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?',a.PoliticalSecuCoopFlag ,a.IndividualBusOperFlag ,a.DisabledPersonFlag from lbpoinsuredlist a,lccontplan b,(select serialno from lbpoinsuredlist where batchno = '?mBatchNo?' and state = '?tState?' order by serialno limit ?tStartRow?,?tEndRow? ) tmp ,lcgrpcont gc where b.grpcontno = a.grppropno and a.serialno=tmp.serialno "+
@ -111,13 +111,72 @@ public interface CreateInsuredDataSQL {
" ROW_NUMBER() OVER (PARTITION BY t.contno, t.insuredno, t.bnforder ORDER BY t.serialno) AS bnfno,\n"+
" t.relationtoinsured,\n"+
" t.bnflot,\n"+
" t.bnfname AS name,\n"+
" t.gender AS sex,\n"+
" t.birthday,\n"+
" t.idtype,\n"+
" t.idno,\n"+
" t.NativePlace,\n"+
" t.IDStartDate,\n"+
" t.islongvalid,\n"+
" t.IDEndDate,\n"+
" t.Mobile,\n"+
" t.Province,\n"+
" t.City,\n"+
" t.County AS District,\n"+
" t.Address AS PostalAddress,'?mManageCom?','?mComCode?','?mOperator?', "+
"'?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?' from ( "
"'?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?' from ( "
+"@{0} @{1}",
+"@{0} @{1}",
clauses={@Clause(key=0,dbType=SysConst.DBTYPE_ORACLE,clause="select b.contno,b.insuredno,a.bnforder,a.relationtoinsured,a.bnflot,a.bnfname, a.gender, a.birthday, a.idtype, a.idno,a.bnftype,a.NativePlace,a.IDStartDate,a.islongvalida.IDEndDate,a.Mobile,a.Province,a.City,a.County ,a.Address, row_number() over(partition by b.contno,b.insuredno,a.bnforder order by a.serialno) as bnfno "+
clauses={@Clause(key=0,dbType=SysConst.DBTYPE_ORACLE,clause="select b.contno,b.insuredno,a.bnforder,a.relationtoinsured,a.bnflot,a.bnfname, a.gender, a.birthday, a.idtype, a.idno,a.bnftype,a.NativePlace,a.IDStartDate,a.islongvalida.IDEndDate,a.Mobile,a.Province,a.City,a.County ,a.Address, row_number() over(partition by b.contno,b.insuredno,a.bnforder order by a.serialno) as bnfno "+
"from lbpoinsuredbnflist a,lbpoinsuredlist b where b.batchno=a.batchno and b.insuredid=a.insuredid and a.batchno='?mBatchNo?' and a.state='?tState?' and b.serialno in(select t.serialno from "+
"from lbpoinsuredbnflist a,lbpoinsuredlist b where b.batchno=a.batchno and b.insuredid=a.insuredid and a.batchno='?mBatchNo?' and a.state='?tState?' and b.serialno in(select t.serialno from "+
"(select serialno,rownum rn from lbpoinsuredlist where batchno='?mBatchNo?' and state='1') t where t.rn>?tStartRow? and t.rn<=?tEndRow?))"),
"(select serialno,rownum rn from lbpoinsuredlist where batchno='?mBatchNo?' and state='1') t where t.rn>?tStartRow? and t.rn<=?tEndRow?))"),
@Clause(key=1,dbType=SysConst.DBTYPE_MYSQL,clause="SELECT result.contno, result.insuredno,result.CustomerNo, result.bnforder, result.relationtoinsured, result.bnflot, result.bnfname, result.gender, result.birthday, result.idtype, result.idno,result.bnftype,result.NativePlace,result.IDStartDate,result.islongvalid,result.IDEndDate,result.Mobile,result.Province,result.City,result.County ,result.Address, rnum bnfno FROM ( SELECT main.contno, main.insuredno,main.CustomerNo, main.bnforder, main.relationtoinsured, main.bnflot, main.bnfname, main.gender, main.birthday, main.idtype, main.idno,main.bnftype,main.NativePlace,main.IDStartDate,main.islongvalid,main.IDEndDate,main.Mobile,main.Province,main.City,main.County ,main.Address,IF ((@xcontno = main.contno or (@xcontno is null and main.contno is null)) and (@xinsuredno = main.insuredno or (@xinsuredno is null and main.insuredno is null)) and (@xbnforder = main.bnforder or (@xbnforder is null and main.bnforder is null)), @xrownum :=@xrownum + 1 ,@xrownum := 1) rnum, @xcontno := main.contno ,@xinsuredno := main.insuredno ,@xbnforder := main.bnforder FROM ( SELECT b.contno, b.insuredno,a.CustomerNo , a.bnforder, a.relationtoinsured, a.bnflot, a.bnfname, a.gender, a.birthday, a.idtype, a.idno,a.bnftype,a.NativePlace,a.IDStartDate,a.islongvalid,a.IDEndDate,a.Mobile,a.Province,a.City,a.County ,a.Address FROM lbpoinsuredbnflist a, lbpoinsuredlist b WHERE b.batchno = a.batchno AND b.insuredid = a.insuredid AND a.batchno = '?mBatchNo?' AND a.state = '?tState?' AND b.serialno IN ( SELECT t.serialno FROM ( SELECT serialno, (@xrownum :=@xrownum + 1) AS rn FROM lbpoinsuredlist k,(select @xrownum := 0) r WHERE k.batchno = '?mBatchNo?' AND k.state = '?tState?') t WHERE t.rn >'?tStartRow?' AND t.rn <='?tEndRow?') order by b.contno,b.insuredno,a.bnforder,a.serialno) main, ( SELECT @xcontno := NULL ,@xinsuredno := NULL ,@xbnforder := NULL ,@rownum := 0) assist) result) m")})
"floor(months_between('?mCurrentDate?',a.birthday)/12),a.getyear,a.getstarttype,'00', 1,0,0,0,0,0,(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), a.InsuredName ,a.Gender ,a.Birthday ,t.SysPlanCode,'0',(select KindCode from lmriskapp where riskcode=t.riskcode),'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?' "+
"floor((EXTRACT(YEAR FROM AGE(('?mCurrentDate?'::DATE), a.birthday)) * 12+ EXTRACT(MONTH FROM AGE(('?mCurrentDate?'::DATE), a.birthday))+ EXTRACT(DAY FROM AGE(('?mCurrentDate?'::DATE), a.birthday)) / 31.0) / 12),a.getyear,a.getstarttype,'00', 1,0,0,0,0,0,(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), a.InsuredName ,a.Gender ,a.Birthday ,t.SysPlanCode,'0',(select KindCode from lmriskapp where riskcode=t.riskcode),'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?' "+
"from lbpoinsuredlist a, (select plancode,riskcode,SysPlanCode from LCContPlanDetail where policyno='?mGrpPropNo?' group by plancode,riskcode,SysPlanCode) t where t.plancode=a.plancode and a.batchno = '?mBatchNo?' and a.state = '?tState?' and a.serialno in(select t.serialno from "
"from lbpoinsuredlist a, (select plancode,riskcode,SysPlanCode from LCContPlanDetail where policyno='?mGrpPropNo?' group by plancode,riskcode,SysPlanCode) t where t.plancode=a.plancode and a.batchno = '?mBatchNo?' and a.state = '?tState?' and a.serialno in(select t.serialno from "
+"@{0} @{1}"
+"@{0} @{1}"
+" where t.rn>'?tStartRow?' and t.rn<='?tEndRow?') ",
+" where t.rn>'?tStartRow?' and t.rn<='?tEndRow?') ",
@ -183,7 +242,7 @@ public interface CreateInsuredDataSQL {
"floor(months_between(ifnull(gc.CValiDate,sysdate()),a.birthday)/12),a.getyear,a.getstarttype,'00', 1,0,0,0,0,0,(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), a.InsuredName ,a.Gender ,a.Birthday ,t.SysPlanCode,'0',(select KindCode from lmriskapp where riskcode=t.riskcode),'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?' "+
"floor((EXTRACT(YEAR FROM AGE(COALESCE(gc.CValiDate, CURRENT_DATE), a.birthday)) * 12+ EXTRACT(MONTH FROM AGE(COALESCE(gc.CValiDate, CURRENT_DATE), a.birthday))+ EXTRACT(DAY FROM AGE(COALESCE(gc.CValiDate, CURRENT_DATE), a.birthday)) / 31.0) / 12),a.getyear,a.getstarttype,'00', 1,0,0,0,0,0,(select occupationtype from ldoccupation where occuplevel='3' and occupationcode=a.occupcode), a.InsuredName ,a.Gender ,a.Birthday ,t.SysPlanCode,'0',(select KindCode from lmriskapp where riskcode=t.riskcode),'?mManageCom?','?mComCode?','?mOperator?','?mCurrentDate?','?mCurrentTime?','?mOperator?','?mCurrentDate?','?mCurrentTime?' "+
"from lbpoinsuredlist a, (select plancode,riskcode,SysPlanCode from LCContPlanDetail where policyno='?mGrpPropNo?' group by plancode,riskcode,SysPlanCode) t,(select serialno from lbpoinsuredlist where batchno = '?mBatchNo?' and state = '?tState?' order by serialno limit ?tStartRow?,?tEndRow? ) tmp ,lcgrpcont gc where a.serialno=tmp.serialno and t.plancode=a.plancode and a.batchno = '?mBatchNo?' and a.state = '?tState?' and gc.grpcontno = '?mGrpPropNo?' ")
"from lbpoinsuredlist a, (select plancode,riskcode,SysPlanCode from LCContPlanDetail where policyno='?mGrpPropNo?' group by plancode,riskcode,SysPlanCode) t,(select serialno from lbpoinsuredlist where batchno = '?mBatchNo?' and state = '?tState?' order by serialno limit ?tStartRow?,?tEndRow? ) tmp ,lcgrpcont gc where a.serialno=tmp.serialno and t.plancode=a.plancode and a.batchno = '?mBatchNo?' and a.state = '?tState?' and gc.grpcontno = '?mGrpPropNo?' ")