diff --git a/lis-framework-service/src/main/java/com/sinosoft/lis/httpservice/sql/nb/LCGrpInsuredBLSQL.java b/lis-framework-service/src/main/java/com/sinosoft/lis/httpservice/sql/nb/LCGrpInsuredBLSQL.java index 14a13548..12e5560d 100644 --- a/lis-framework-service/src/main/java/com/sinosoft/lis/httpservice/sql/nb/LCGrpInsuredBLSQL.java +++ b/lis-framework-service/src/main/java/com/sinosoft/lis/httpservice/sql/nb/LCGrpInsuredBLSQL.java @@ -6,73 +6,140 @@ import com.sinosoft.persistence.SQL; import com.sinosoft.utility.SSRS; public interface LCGrpInsuredBLSQL { - //ZCNTODO sql待写 - @SQL(value = - """ - select * from ( - select\s - a.ContNo , - a.InsuredNo , - a.Name, - (select codename from ldcode where codetype='sex' and code=a.Sex), - (select codename from ldcode where codetype='idtype' and code=a.IDType), - a.IDNo, - a.Birthday, - (select codename from ldcode where codetype='relation' and code=a.RelationToMainInsured), a.ContPlanCode, - (case when exists - (select 1 - from lcpol - where contno = a.contno - and riskcode in - (select riskcode - from lmriskapp - where risktype3 = '3' - and riskprop = 'G') - and exists - (select 1 - from LCAscriptionRuleFactory - where grpcontno = - a.grpcontno - limit 1 - )) then - '已归属' - when not exists - (select 1 - from lcpol - where contno = a.contno - and riskcode in - (select riskcode - from lmriskapp - where risktype3 = '3' - and riskprop = 'G')) then - '' - else - '未归属' - end), - '详细信息', \s - (case when exists (select 1 - from lcpassword - where passwordtype = '6' - and grpcontno = a.grpcontno - and gcontno = a.contno - and appflag in ('1', '2')) then '已开通' else '未开通' end ), - (@rownum := @rownum + 1) r - from lcinsured a,(SELECT @rownum := 0) r - where a.grpcontno = '?tGrpContNo?' - and a.IDNo is not null @{0} @{1} @{2} @{3} @{4} order by a.contno )t where t.r between @{5} and @{6} - """ ,clauses = { - @Clause(key=0,clause = " and a.contno='?tContNo?' " ,expression = " ?tContNo? != empty"), - @Clause(key=1,clause = " and a.Name='?tName?' " ,expression = " ?tName? != empty"), - @Clause(key=2,clause = " and a.Sex='?tSex?' " ,expression = " ?tSex? != empty"), - @Clause(key=3,clause = " and a.IDType='?tIDType?' " ,expression = " ?tIDType? != empty"), - @Clause(key=4,clause = " and a.IDNo='?tIDNo?' " ,expression = " ?tIDNo? != empty"), - @Clause(key=5,clause = " '?tPageNumStart?' " ,expression = " ?tPageNumStart? != empty"), - @Clause(key=6,clause = " '?tPageNumEnd?' " ,expression = " ?tPageNumEnd? != empty"), - }) - SSRS selectGrpInsuredList(@Param("tGrpContNo") String tGrpContNo, @Param("tContNo") String tContNo, - @Param("tName") String tName, @Param("tSex") String tSex, @Param("IDType") String IDType, - @Param("IDNo") String IDNo, @Param("tPageNumStart") String tPageNumStart, - @Param("tPageNumEnd") String tPageNumEnd); +// //ZCNTODO sql待写 +// @SQL(value = +// """ +// select * from ( +// select \s +// a.ContNo , +// a.InsuredNo , +// a.Name, +// (select codename from ldcode where codetype='sex' and code=a.Sex), +// (select codename from ldcode where codetype='idtype' and code=a.IDType), +// a.IDNo, +// a.Birthday, +// (select codename from ldcode where codetype='relation' and code=a.RelationToMainInsured), a.ContPlanCode, +// (case when exists +// (select 1 +// from lcpol +// where contno = a.contno +// and riskcode in +// (select riskcode +// from lmriskapp +// where risktype3 = '3' +// and riskprop = 'G') +// and exists +// (select 1 +// from LCAscriptionRuleFactory +// where grpcontno = +// a.grpcontno +// limit 1 +// )) then +// '已归属' +// when not exists +// (select 1 +// from lcpol +// where contno = a.contno +// and riskcode in +// (select riskcode +// from lmriskapp +// where risktype3 = '3' +// and riskprop = 'G')) then +// '' +// else +// '未归属' +// end), +// '详细信息', \s +// (case when exists (select 1 +// from lcpassword +// where passwordtype = '6' +// and grpcontno = a.grpcontno +// and gcontno = a.contno +// and appflag in ('1', '2')) then '已开通' else '未开通' end ), +// (@rownum := @rownum + 1) r +// from lcinsured a,(SELECT @rownum := 0) r +// where a.grpcontno = '?tGrpContNo?' +// and a.IDNo is not null @{0} @{1} @{2} @{3} @{4} order by a.contno )t where t.r between @{5} and @{6} +// """ ,clauses = { +// @Clause(key=0,clause = " and a.contno='?tContNo?' " ,expression = " ?tContNo? != empty"), +// @Clause(key=1,clause = " and a.Name='?tName?' " ,expression = " ?tName? != empty"), +// @Clause(key=2,clause = " and a.Sex='?tSex?' " ,expression = " ?tSex? != empty"), +// @Clause(key=3,clause = " and a.IDType='?tIDType?' " ,expression = " ?tIDType? != empty"), +// @Clause(key=4,clause = " and a.IDNo='?tIDNo?' " ,expression = " ?tIDNo? != empty"), +// @Clause(key=5,clause = " '?tPageNumStart?' " ,expression = " ?tPageNumStart? != empty"), +// @Clause(key=6,clause = " '?tPageNumEnd?' " ,expression = " ?tPageNumEnd? != empty"), +// }) +// SSRS selectGrpInsuredList(@Param("tGrpContNo") String tGrpContNo, @Param("tContNo") String tContNo, +// @Param("tName") String tName, @Param("tSex") String tSex, @Param("IDType") String IDType, +// @Param("IDNo") String IDNo, @Param("tPageNumStart") String tPageNumStart, +// @Param("tPageNumEnd") String tPageNumEnd); +//ZCNTODO sql待写 +@SQL(value = + """ + select * from ( + select \s + a.ContNo , + a.InsuredNo , + a.Name, + (select codename from ldcode where codetype='sex' and code=a.Sex), + (select codename from ldcode where codetype='idtype' and code=a.IDType), + a.IDNo, + a.Birthday, + (select codename from ldcode where codetype='relation' and code=a.RelationToMainInsured), a.ContPlanCode, + (case when exists + (select 1 + from lcpol + where contno = a.contno + and riskcode in + (select riskcode + from lmriskapp + where risktype3 = '3' + and riskprop = 'G') + and exists + (select 1 + from LCAscriptionRuleFactory + where grpcontno = + a.grpcontno + limit 1 + )) then + '已归属' + when not exists + (select 1 + from lcpol + where contno = a.contno + and riskcode in + (select riskcode + from lmriskapp + where risktype3 = '3' + and riskprop = 'G')) then + '' + else + '未归属' + end), + '详细信息', \s + (case when exists (select 1 + from lcpassword + where passwordtype = '6' + and grpcontno = a.grpcontno + and gcontno = a.contno + and appflag in ('1', '2')) then '已开通' else '未开通' end ), + rownum r + from lcinsured a,(select rownum from dual) r + where a.grpcontno = '?tGrpContNo?' + and a.IDNo is not null @{0} @{1} @{2} @{3} @{4} order by a.contno )t where t.r between @{5} and @{6} + """ ,clauses = { + @Clause(key=0,clause = " and a.contno='?tContNo?' " ,expression = " ?tContNo? != empty"), + @Clause(key=1,clause = " and a.Name='?tName?' " ,expression = " ?tName? != empty"), + @Clause(key=2,clause = " and a.Sex='?tSex?' " ,expression = " ?tSex? != empty"), + @Clause(key=3,clause = " and a.IDType='?tIDType?' " ,expression = " ?tIDType? != empty"), + @Clause(key=4,clause = " and a.IDNo='?tIDNo?' " ,expression = " ?tIDNo? != empty"), + @Clause(key=5,clause = " '?tPageNumStart?' " ,expression = " ?tPageNumStart? != empty"), + @Clause(key=6,clause = " '?tPageNumEnd?' " ,expression = " ?tPageNumEnd? != empty"), +}) +SSRS selectGrpInsuredList(@Param("tGrpContNo") String tGrpContNo, @Param("tContNo") String tContNo, + @Param("tName") String tName, @Param("tSex") String tSex, @Param("IDType") String IDType, + @Param("IDNo") String IDNo, @Param("tPageNumStart") String tPageNumStart, + @Param("tPageNumEnd") String tPageNumEnd); //ZCNTODO sql待写 @SQL(value = """