Merge remote-tracking branch 'origin/master'

master
ChenXono 3 weeks ago
commit a435ddc618
  1. 58
      lis-component-cloudstorage-bl/src/main/java/com/sinosoft/lis/cloud/CallHTTP.java
  2. 7
      lis-framework-springboot/src/main/resources/application-local.yml
  3. 4
      lis-module-grp-customer-schema/src/main/java/com/sinosoft/lis/sql/repository/LCInsuredInfoSQL.java
  4. 2
      lis-module-grp-customer-service/src/main/java/com/sinosoft/lis/sql/g_customer/CheckInsuredInfoListSQL.java
  5. 10
      lis-module-grp-finance-service/src/main/java/com/sinosoft/lis/g_finfee/LJPremMatchingBL.java
  6. 10
      lis-module-grp-nb-schema/src/main/java/com/sinosoft/lis/sql/repository/LBPOInsuredBnfListSQL.java
  7. 12
      lis-module-grp-nb-schema/src/main/java/com/sinosoft/lis/sql/repository/LBPOInsuredListSQL.java
  8. 48
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/controller/g_app/LCInsuredUploadController.java
  9. 5
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/controller/g_app/LCPropPrintBL.java
  10. 4
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/g_app/LCContPolBL.java
  11. 21
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/g_app/LCInsuredUploadBL.java
  12. 4
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/sql/easyquery/g_app/LCInsuredInfoSql.java
  13. 21
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/sql/g_app/CalInsuredStdPremBLSQL.java
  14. 18
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/sql/g_app/CheckInsuredListSQL.java
  15. 71
      lis-module-grp-nb-service/src/main/java/com/sinosoft/lis/sql/g_app/CreateInsuredDataSQL.java

@ -132,7 +132,8 @@ public class CallHTTP {
try { try {
PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, new File(localPath)); PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, new File(localPath));
putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite); putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite);
s3Client.putObject(putObjectRequest); //todo 暂时注释掉上传s3代码,等用户提供
// s3Client.putObject(putObjectRequest);
return true; return true;
} catch (AmazonServiceException e) { } catch (AmazonServiceException e) {
logger.error(e.getErrorMessage()); logger.error(e.getErrorMessage());
@ -175,7 +176,8 @@ public class CallHTTP {
try { try {
PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, file); PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, file);
putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite); putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite);
s3Client.putObject(putObjectRequest); //todo 暂时注释掉上传s3代码,等用户提供
// s3Client.putObject(putObjectRequest);
return true; return true;
} catch (AmazonServiceException e) { } catch (AmazonServiceException e) {
logger.error(e.getErrorMessage()); logger.error(e.getErrorMessage());
@ -236,7 +238,8 @@ public class CallHTTP {
objectMetadata.setContentLength(length); objectMetadata.setContentLength(length);
PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, bis,objectMetadata); PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, bis,objectMetadata);
putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite); putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite);
s3Client.putObject(putObjectRequest); //todo 暂时注释掉上传s3代码,等用户提供
// s3Client.putObject(putObjectRequest);
return true; return true;
} catch (AmazonServiceException e) { } catch (AmazonServiceException e) {
logger.error(e.getErrorMessage()); logger.error(e.getErrorMessage());
@ -298,7 +301,7 @@ public class CallHTTP {
objectMetadata.setContentLength(length); objectMetadata.setContentLength(length);
PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, bis,objectMetadata); PutObjectRequest putObjectRequest = new PutObjectRequest(uploadPath, fileName, bis,objectMetadata);
putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite); putObjectRequest.setCannedAcl(CannedAccessControlList.PublicReadWrite);
s3Client.putObject(putObjectRequest); // s3Client.putObject(putObjectRequest);
return true; return true;
} catch (AmazonServiceException e) { } catch (AmazonServiceException e) {
logger.error(e.getErrorMessage()); logger.error(e.getErrorMessage());
@ -344,25 +347,36 @@ public class CallHTTP {
* fileName:文件名 6ac09355546449b2a00eba4a376b1774.jpg * fileName:文件名 6ac09355546449b2a00eba4a376b1774.jpg
*/ */
public InputStream getObject(String path,String fileName) { public InputStream getObject(String path,String fileName) {
//暂时修改为从本地获取文件
AWSCredentials credentials = new BasicAWSCredentials(AK,SK); File file = new File(path +"/"+ fileName);
//AWSCredentials credentials = new BasicAWSCredentials("hxyx_jsc_lwl", "Ydthcom*it2021"); Path filePath = Paths.get(path +"/"+ fileName);
ClientConfiguration clientConfig = new ClientConfiguration(); try (InputStream inputStream = Files.newInputStream(filePath)) {
clientConfig.withMaxConnections(200); // 读取 inputStream
clientConfig.setProtocol(Protocol.HTTP); return inputStream;
clientConfig.setSocketTimeout(300000); } catch (IOException e) {
clientConfig.setConnectionTimeout(30000); e.printStackTrace();
clientConfig.withUseExpectContinue(true); }
return null;
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(credentials)) // AWSCredentials credentials = new BasicAWSCredentials(AK,SK);
.withClientConfiguration(clientConfig) // //AWSCredentials credentials = new BasicAWSCredentials("hxyx_jsc_lwl", "Ydthcom*it2021");
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(host, "us-west-1")) // ClientConfiguration clientConfig = new ClientConfiguration();
.withPathStyleAccessEnabled(false) // clientConfig.withMaxConnections(200);
.build(); // clientConfig.setProtocol(Protocol.HTTP);
com.amazonaws.services.s3.model.S3Object object=s3Client.getObject(new GetObjectRequest(path, fileName)); // clientConfig.setSocketTimeout(300000);
InputStream inStream = object.getObjectContent(); // clientConfig.setConnectionTimeout(30000);
return inStream; // clientConfig.withUseExpectContinue(true);
//
// AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
// .withCredentials(new AWSStaticCredentialsProvider(credentials))
// .withClientConfiguration(clientConfig)
// .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(host, "us-west-1"))
// .withPathStyleAccessEnabled(false)
// .build();
// com.amazonaws.services.s3.model.S3Object object=s3Client.getObject(new GetObjectRequest(path, fileName));
// InputStream inStream = object.getObjectContent();
// return inStream;
} }

@ -18,14 +18,15 @@ xxl:
job: job:
admin: admin:
# addresses: http://10.1.205.247:29001/xxl-job/ # 调度中心地址 # addresses: http://10.1.205.247:29001/xxl-job/ # 调度中心地址
addresses: http://10.1.105.44:29001/xxl-job/ # 调度中心地址 addresses: http://localhost:29001/xxl-job/ # 调度中心地址
accessToken: sinosoft01!&$#20 # 必须与调度中心一致 accessToken: sinosoft01!&$#20 # 必须与调度中心一致
appname: gpr-system-executor appname: gpr-system-executor
executor: executor:
port: 9998 # 执行器端口 port: 9998 # 执行器端口
logpath: /data/applogs/xxl-job/jobhandler logpath: ./data/applogs/xxl-job/jobhandler
logretentiondays: 30 logretentiondays: 30
forest: forest:
variables: variables:
baseUrl: http://139.196.45.197:29001 baseUrl: http://localhost:29001
# baseUrl: http://139.196.45.197:29001

@ -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 ",
clauses = { clauses = {
@Clause(key = 0, dbType = SysConst.DBTYPE_MYSQL, clause = " DATE_FORMAT(str_to_date(a.InsuredBirthday,'%Y-%m-%d'),'%Y-%m-%d') "), @Clause(key = 0, dbType = SysConst.DBTYPE_MYSQL, clause = " TO_CHAR(TO_DATE(a.InsuredBirthday, 'YYYY-MM-DD'), 'YYYYMMDD') "),
@Clause(key = 1, dbType = SysConst.DBTYPE_ORACLE, clause = " to_char(to_date(a.InsuredBirthday,'yyyy-mm-dd'),'YYYY-MM-DD') ")}) @Clause(key = 1, dbType = SysConst.DBTYPE_ORACLE, clause = " to_char(to_date(a.InsuredBirthday,'yyyy-mm-dd'),'YYYY-MM-DD') ")})
SQLwithBindVariables updateInsuredBirthdayByBatchNoAndFlagAndInsuredBirthdayNotNull(@Param("tBatchNo") String tBatchNo, SQLwithBindVariables updateInsuredBirthdayByBatchNoAndFlagAndInsuredBirthdayNotNull(@Param("tBatchNo") String tBatchNo,
@Param("tFlag") String tFlag); @Param("tFlag") String tFlag);
@SQL(value = "update LCInsuredInfo a set a.DeathDate=@{0}@{1} where a.batchno='?tBatchNo?' and a.flag='?tFlag?' and a.DeathDate is not null ", @SQL(value = "update LCInsuredInfo a set a.DeathDate=@{0}@{1} where a.batchno='?tBatchNo?' and a.flag='?tFlag?' and a.DeathDate is not null ",
clauses = { clauses = {
@Clause(key = 0, dbType = SysConst.DBTYPE_MYSQL, clause = " DATE_FORMAT(str_to_date(a.DeathDate,'%Y-%m-%d'),'%Y-%m-%d') "), @Clause(key = 0, dbType = SysConst.DBTYPE_MYSQL, clause = " TO_CHAR(TO_DATE(a.DeathDate, 'YYYY-MM-DD'), 'YYYY-MM-DD') "),
@Clause(key = 1, dbType = SysConst.DBTYPE_ORACLE, clause = " to_char(to_date(a.DeathDate,'yyyy-mm-dd'),'YYYY-MM-DD') ")}) @Clause(key = 1, dbType = SysConst.DBTYPE_ORACLE, clause = " to_char(to_date(a.DeathDate,'yyyy-mm-dd'),'YYYY-MM-DD') ")})
SQLwithBindVariables updateDeathDateByBatchNoAndFlagAndDeathDateNotNull(@Param("tBatchNo") String tBatchNo, SQLwithBindVariables updateDeathDateByBatchNoAndFlagAndDeathDateNotNull(@Param("tBatchNo") String tBatchNo,
@Param("tFlag") String tFlag); @Param("tFlag") String tFlag);

@ -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?' ",
clauses = { clauses = {
@Clause(key = 0, dbType = SysConst.DBTYPE_MYSQL, clause = "DATE_FORMAT(str_to_date(a.InsuredBirthday,'%Y-%m-%d'), '%Y%m%d')"), @Clause(key = 0, dbType = SysConst.DBTYPE_MYSQL, clause = "TO_CHAR(TO_DATE(a.InsuredBirthday, 'YYYY-MM-DD'), 'YYYYMMDD')"),
@Clause(key = 1, dbType = SysConst.DBTYPE_ORACLE, clause = "to_char(to_date(a.InsuredBirthday,'yyyy-mm-dd'), 'yyyyMMdd')")}) @Clause(key = 1, dbType = SysConst.DBTYPE_ORACLE, clause = "to_char(to_date(a.InsuredBirthday,'yyyy-mm-dd'), 'yyyyMMdd')")})
SQLwithBindVariables updateLCInsuredInfo_ReasonByIDTypeCodeAndInsuredBirthdayAndBatchNoAndFlag(@Param("tReason") String tReason, SQLwithBindVariables updateLCInsuredInfo_ReasonByIDTypeCodeAndInsuredBirthdayAndBatchNoAndFlag(@Param("tReason") String tReason,
@Param("tIDTypeCode") String tIDTypeCode, @Param("tIDTypeCode") String tIDTypeCode,

@ -312,11 +312,11 @@ public class LJPremMatchingBL {
String tValue = SQLProxy.getInstance(LDAttachmentSQL.class).countByOtherNoTypeAndOtherNo( String tValue = SQLProxy.getInstance(LDAttachmentSQL.class).countByOtherNoTypeAndOtherNo(
"MATCH", mMatchSerialNo "MATCH", mMatchSerialNo
); );
if ("0".equals(tValue)) { // if ("0".equals(tValue)) {
//
buildError("checkData", new I18nMessage("请上传相关证明材料!", "LIS-99999")); // buildError("checkData", new I18nMessage("请上传相关证明材料!", "LIS-99999"));
return false; // return false;
} // }
} }
} }

@ -40,7 +40,7 @@ public interface LBPOInsuredBnfListSQL {
@Param("sState") String sState, @Param("sState") String sState,
@Param("State") String State); @Param("State") String State);
@SQL(value = "update lbpoinsuredbnflist set birthday=date_Format(str_to_date(birthday,'%Y-%m-%d'),'%Y-%m-%d') " + @SQL(value = "update lbpoinsuredbnflist set TO_CHAR(TO_DATE(birthday, 'YYYY-MM-DD'), 'YYYY-MM-DD') " +
"where batchno='" + "?mBatchNo?" + "' and state='?State?' " + "where batchno='" + "?mBatchNo?" + "' and state='?State?' " +
"and birthday is not null ") "and birthday is not null ")
SQLwithBindVariables updateBirthdayByBatchNoAndStateAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateBirthdayByBatchNoAndStateAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo,
@ -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?' ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndBirthdayBetween(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndBirthdayBetween(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -75,7 +75,7 @@ public interface LBPOInsuredBnfListSQL {
@Param("CurrentDate")String CurrentDate); @Param("CurrentDate")String CurrentDate);
@SQL(value = "update lbpoinsuredbnflist set reason=concat(reason,'?reason?') " + @SQL(value = "update lbpoinsuredbnflist set reason=concat(reason,'?reason?') " +
"where str_to_date(IDStartDate,'%Y-%m-%d')> str_to_date('?CurrentDate?','%Y-%m-%d') " + "where TO_DATE(IDStartDate,'YYYY-MM-DD')> TO_DATE('?CurrentDate?','YYYY-MM-DD') " +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDStartDate is not null or IDStartDate !='') ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDStartDate is not null or IDStartDate !='') ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndIDStartDate(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndIDStartDate(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -83,7 +83,7 @@ public interface LBPOInsuredBnfListSQL {
@Param("CurrentDate") String CurrentDate); @Param("CurrentDate") String CurrentDate);
@SQL(value = "update lbpoinsuredbnflist set reason=concat(reason,'?reason?') " + @SQL(value = "update lbpoinsuredbnflist set reason=concat(reason,'?reason?') " +
"where str_to_date(IDEndDate,'%Y-%m-%d') < str_to_date('?CurrentDate?','%Y-%m-%d') " + "where TO_DATE(IDEndDate,'YYYY-MM-DD') < TO_DATE('?CurrentDate?','YYYY-MM-DD') " +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDEndDate is not null or IDEndDate !='') ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDEndDate is not null or IDEndDate !='') ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndIDEndDate(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndIDEndDate(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String 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') ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndIsLongValid(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndIsLongValid(@Param("mBatchNo") String mBatchNo,
@Param("mState") String mState, @Param("mState") String mState,
@Param("mReason") String mReason); @Param("mReason") String mReason);

@ -62,7 +62,7 @@ public interface LBPOInsuredListSQL {
SSRS getBnfInfoByBatchNoAndState(@Param("mBatchNo") String mBatchNo, @Param("mState") String mState,@Param("mStartNo") int mStartNo, @Param("mNum") int mNum); SSRS getBnfInfoByBatchNoAndState(@Param("mBatchNo") String mBatchNo, @Param("mState") String mState,@Param("mStartNo") int mStartNo, @Param("mNum") int mNum);
@SQL(value = "update lbpoinsuredlist set birthday=date_Format(str_to_date(birthday,'%Y-%m-%d'),'%Y-%m-%d') " + @SQL(value = "update lbpoinsuredlist set birthday = TO_CHAR(TO_DATE(birthday, 'YYYY-MM-DD'), 'YYYY-MM-DD') " +
"where batchno='" + "?mBatchNo?" + "' and state='?state?' " + "where batchno='" + "?mBatchNo?" + "' and state='?state?' " +
"and birthday is not null ") "and birthday is not null ")
SQLwithBindVariables updateBirthdayByBatchNoAndStateAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateBirthdayByBatchNoAndStateAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo,
@ -138,7 +138,7 @@ public interface LBPOInsuredListSQL {
//为了兼容pg数据库。pg数据库中,now返回的是timestamptz类型,在作为参数调用months_between时,会因参数类型不匹配而报错,所以增加通过to_date进行日期转换的过程 //为了兼容pg数据库。pg数据库中,now返回的是timestamptz类型,在作为参数调用months_between时,会因参数类型不匹配而报错,所以增加通过to_date进行日期转换的过程
@SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " + @SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " +
"where (months_between( date_sub( str_to_date('?CurrentDate?','%Y-%m-%d'),interval 1 day) ,birthday)<?minAge? or months_between(date_sub( str_to_date('?CurrentDate?','%Y-%m-%d'),interval 1 day),birthday)>?maxAge?) " + "where (EXTRACT(YEAR FROM AGE('?CurrentDate?'::DATE - 1, birthday)) * 12 + EXTRACT(MONTH FROM AGE('?CurrentDate?'::DATE - 1, birthday))<?minAge? or EXTRACT(YEAR FROM AGE('?CurrentDate?'::DATE - 1, birthday)) * 12 + EXTRACT(MONTH FROM AGE('?CurrentDate?'::DATE - 1, birthday))>?maxAge?) " +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndBirthdayBetween(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndBirthdayBetween(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -148,7 +148,7 @@ public interface LBPOInsuredListSQL {
@Param("CurrentDate") String CurrentDate); @Param("CurrentDate") String CurrentDate);
@SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " + @SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " +
"where str_to_date(IDStartDate,'%Y-%m-%d')> str_to_date('?CurrentDate?','%Y-%m-%d') " + "where TO_DATE(IDStartDate,'YYYY-MM-DD')> TO_DATE('?CurrentDate?','YYYY-MM-DD') " +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDStartDate is not null or IDStartDate !='') ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDStartDate is not null or IDStartDate !='') ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndIDStartDate(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndIDStartDate(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -156,7 +156,7 @@ public interface LBPOInsuredListSQL {
@Param("CurrentDate") String CurrentDate); @Param("CurrentDate") String CurrentDate);
@SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " + @SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " +
"where str_to_date(IDEndDate,'%Y-%m-%d') < str_to_date('?CurrentDate?','%Y-%m-%d') " + "where TO_DATE(IDEndDate,'YYYY-MM-DD') < TO_DATE('?CurrentDate?','YYYY-MM-DD') " +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDEndDate is not null or IDEndDate !='') ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' and (IDEndDate is not null or IDEndDate !='') ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndIDEndDate(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndIDEndDate(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -167,7 +167,7 @@ public interface LBPOInsuredListSQL {
SQLwithBindVariables deleteByGrpPropNoIn(@Param("grpPropNos") ArrayList<String> grpPropNos); SQLwithBindVariables deleteByGrpPropNoIn(@Param("grpPropNos") ArrayList<String> grpPropNos);
@SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " + @SQL(value = "update lbpoinsuredlist set reason=concat(reason,'?reason?') " +
"where str_to_date(JoinCompDate,'%Y-%m-%d')> str_to_date('?CurrentDate?','%Y-%m-%d') " + "where TO_DATE(JoinCompDate,'YYYY-MM-DD')> TO_DATE('?CurrentDate?','YYYY-MM-DD') " +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndJoinCompDate(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndJoinCompDate(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -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') ")
SQLwithBindVariables updateReasonByBatchNoAndStateAndIsLongValid(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateReasonByBatchNoAndStateAndIsLongValid(@Param("mBatchNo") String mBatchNo,
@Param("mState") String mState, @Param("mState") String mState,
@Param("mReason") String mReason); @Param("mReason") String mReason);

@ -43,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.io.File; import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream; import java.io.InputStream;
@Controller @Controller
@ -111,20 +112,51 @@ public class LCInsuredUploadController {
InputStream fileInputStream = null; InputStream fileInputStream = null;
try { try {
fileInputStream = file.getInputStream(); fileInputStream = file.getInputStream();
// 2. 传入声明的流变量,保持原有业务逻辑不变 byte[] fileBytes = fileInputStream.readAllBytes();
if (!callHttp.putObject(tAttachPath, tAttachSysName, fileInputStream)) {
tFlagStr = "Fail"; String localBasePath = System.getProperty("user.home") + File.separator + "lis_upload_files";
tContent = new I18nMessage("上传文件失败", "LIS-18251").getMessage(); System.out.println("localBasePath::"+localBasePath);
// if (localBasePath == null || localBasePath.isEmpty()) {
// localBasePath = System.getProperty("user.home") + File.separator + "lis_upload_files";
// }
String datePath = PubFun.getCurrentDate().replaceAll("-", File.separator);
String localDirPath = localBasePath + File.separator + datePath;
File localDir = new File(localDirPath);
if (!localDir.exists()) {
localDir.mkdirs();
}
tAttachPath = localDirPath + File.separator;
String localFilePath = tAttachPath + tAttachSysName;
response.setContent(tContent); File localFile = new File(localFilePath);
response.fail();
} else { try (FileOutputStream fos = new FileOutputStream(localFile)) {
fos.write(fileBytes);
fos.flush();
logger.info("文件已保存到本地: {}", localFilePath);
}
java.io.ByteArrayInputStream byteArrayInputStream = new java.io.ByteArrayInputStream(fileBytes);
tFlagStr = "Succ"; tFlagStr = "Succ";
tContent = new I18nMessage("上传文件成功", "LIS-18250").getMessage(); tContent = new I18nMessage("上传文件成功", "LIS-18250").getMessage();
response.setContent(tContent); response.setContent(tContent);
response.succ(); response.succ();
} // 2. 传入声明的流变量,保持原有业务逻辑不变
// if (!callHttp.putObject(tAttachPath, tAttachSysName, fileInputStream)) {
// tFlagStr = "Fail";
// tContent = new I18nMessage("上传文件失败", "LIS-18251").getMessage();
//
// response.setContent(tContent);
// response.fail();
// } else {
// tFlagStr = "Succ";
// tContent = new I18nMessage("上传文件成功", "LIS-18250").getMessage();
//
// response.setContent(tContent);
// response.succ();
// }
} finally { } finally {
// 3. 新增finally块,确保流无论上传成功/失败都能释放 // 3. 新增finally块,确保流无论上传成功/失败都能释放

@ -479,6 +479,9 @@ public class LCPropPrintBL implements BusinessService {
lsQuotPlanDetailSubSchema.setPlanCode(plan.getContPlanCode());//plancode 计划代码 lsQuotPlanDetailSubSchema.setPlanCode(plan.getContPlanCode());//plancode 计划代码
lsQuotPlanDetailSubSchema.setRiskCode(plan.getRiskCode());//riskcode 险种代码 lsQuotPlanDetailSubSchema.setRiskCode(plan.getRiskCode());//riskcode 险种代码
lsQuotPlanDetailSubSchema.setDutyCode(plan.getDutyCode());//dutycode 责任代码 lsQuotPlanDetailSubSchema.setDutyCode(plan.getDutyCode());//dutycode 责任代码
lsQuotPlanDetailSubSchema.setP6(plan.getDeductionFee());//DeductionFee 免赔额
lsQuotPlanDetailSubSchema.setP7(plan.getWaitdays());//Waitdays 等待期
lsQuotPlanDetailSubSchema.setP11(plan.getDeductDays());//DeductDays 免赔日数
lsQuotPlanDetailSubSet.add(lsQuotPlanDetailSubSchema); lsQuotPlanDetailSubSet.add(lsQuotPlanDetailSubSchema);
// if (lsQuotPlanDetailSubSchema != null) { // if (lsQuotPlanDetailSubSchema != null) {
// mMMap.put(lsQuotPlanDetailSubSchema, MMap.Action.DELETE_INSERT); // mMMap.put(lsQuotPlanDetailSubSchema, MMap.Action.DELETE_INSERT);
@ -546,6 +549,8 @@ public class LCPropPrintBL implements BusinessService {
lwMissionSchema.setLastOperator(operator);//modifyoperator 修改人 lwMissionSchema.setLastOperator(operator);//modifyoperator 修改人
lwMissionSchema.setModifyDate(DateUtil.getCurrentDate());//modifydate 修改日期 lwMissionSchema.setModifyDate(DateUtil.getCurrentDate());//modifydate 修改日期
lwMissionSchema.setModifyTime(DateUtil.getCurrentTime());//modifytime 修改时间 lwMissionSchema.setModifyTime(DateUtil.getCurrentTime());//modifytime 修改时间
lwMissionSchema.setInDate(DateUtil.getCurrentDate());//modifydate 进入日期
lwMissionSchema.setInTime(DateUtil.getCurrentTime());//modifytime 进入时间
if (lwMissionSchema != null) { if (lwMissionSchema != null) {
mMMap.put(lwMissionSchema, MMap.Action.DELETE_INSERT); mMMap.put(lwMissionSchema, MMap.Action.DELETE_INSERT);

@ -382,8 +382,8 @@ public class LCContPolBL implements BusinessService {
cLDCustomerIDSchema.setIDNo(mGrpID); cLDCustomerIDSchema.setIDNo(mGrpID);
cLDCustomerIDSchema.setIDInitiateDate(mGrpIDStartDate); cLDCustomerIDSchema.setIDInitiateDate(mGrpIDStartDate);
cLDCustomerIDSchema.setIDExpiryDate(mGrpIDExpiryDate); cLDCustomerIDSchema.setIDExpiryDate(mGrpIDExpiryDate);
// mAppntNo = PubFunGroup.getAppntNo(cLDCustomerIDSchema, mGrpName); mAppntNo = PubFunGroup.getAppntNo(cLDCustomerIDSchema, mGrpName);
mAppntNo = "00000006"; // mAppntNo = "00000006";
logger.info("投保单位生成客户号:"+mAppntNo); logger.info("投保单位生成客户号:"+mAppntNo);
if("".equals(mAppntNo)){ if("".equals(mAppntNo)){
buildError("insertData", new I18nMessage("创建投保单位信息错误!", "LIS-06681")); buildError("insertData", new I18nMessage("创建投保单位信息错误!", "LIS-06681"));

@ -16,7 +16,11 @@ import org.apache.poi.xssf.model.SharedStringsTable;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -366,12 +370,21 @@ public class LCInsuredUploadBL extends ReadXlsxAbstract {
*/ */
private boolean parseExcelData() { private boolean parseExcelData() {
try { Path filePath = Paths.get(mFilePath +"/"+ mFileName);
try(InputStream inputStream = Files.newInputStream(filePath)) {
// CallHTTP callHttp = new CallHTTP(mS3System);
// InputStream inStream = callHttp.getObject(mFilePath, mFileName);
CallHTTP callHttp = new CallHTTP(mS3System); // try (InputStream inputStream = Files.newInputStream(filePath)) {
InputStream inStream = callHttp.getObject(mFilePath, mFileName); // // 读取 inputStream
// return inputStream;
// } catch (IOException e) {
// e.printStackTrace();
// }
process(inStream); process(inputStream);
if (mErrors.getErrorCount()>0) { if (mErrors.getErrorCount()>0) {
return false; return false;

@ -9,7 +9,7 @@ import com.sinosoft.utility.SSRS;
@EasyQuery @EasyQuery
public interface LCInsuredInfoSql { public interface LCInsuredInfoSql {
//#查询新增加的被保人信息 //#查询新增加的被保人信息
@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 = 1, clause = "and a.insuredno = '#{para1}'", expression = "#{para1} != empty"), @Clause(key = 1, clause = "and a.insuredno = '#{para1}'", expression = "#{para1} != 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 {
SSRS LCInsuredInfo6(@Param("para0") String para0); SSRS LCInsuredInfo6(@Param("para0") String para0);
//#查询新增加的被保人信息 //#查询新增加的被保人信息
@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"),
@Clause(key = 1, clause = "and a.insuredno = '#{para1}'", expression = "#{para1} != empty"), @Clause(key = 1, clause = "and a.insuredno = '#{para1}'", expression = "#{para1} != 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"),

@ -73,9 +73,16 @@ public interface CalInsuredStdPremBLSQL {
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
order by order by
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'))")
SQLwithBindVariables deleteLCDutyByBatchNoAndState( @Param("mBatchNo") String mBatchNo, @Param("tState") String tState); SQLwithBindVariables deleteLCDutyByBatchNoAndState( @Param("mBatchNo") String mBatchNo, @Param("tState") String tState);
@SQL("update lcpol a join lcgrpcont grp set a.AGENTCODE=grp.AGENTCODE ,a.APPNTNO=grp.APPNTNO ,a.SaleChnl= grp.SaleChnl" + @SQL("update lcpol a set a.AGENTCODE=grp.AGENTCODE ,a.APPNTNO=grp.APPNTNO ,a.SaleChnl= grp.SaleChnl" +
" ,a.agenttype = grp.agenttype where grp.grpcontno='?tGrpContNo?' and a.grpcontno='?tGrpContNo?'" + " ,a.agenttype = grp.agenttype from lcgrpcont grp where grp.grpcontno='?tGrpContNo?' and a.grpcontno='?tGrpContNo?'" +
" and a.GRPCONTNO =GRP.GRPCONTNO ") " and a.GRPCONTNO =GRP.GRPCONTNO ")
SQLwithBindVariables updateLcpol( @Param(value = "tGrpContNo",required = true) String tGrpContNo); SQLwithBindVariables updateLcpol( @Param(value = "tGrpContNo",required = true) String tGrpContNo);
@SQL("update lccont a join lcgrpcont grp set a.AGENTCODE=grp.AGENTCODE ,a.APPNTNO=grp.APPNTNO ,a.SaleChnl= grp.SaleChnl" + @SQL("update lccont a set a.AGENTCODE=grp.AGENTCODE ,a.APPNTNO=grp.APPNTNO ,a.SaleChnl= grp.SaleChnl" +
" ,a.agenttype = grp.agenttype where grp.grpcontno='?tGrpContNo?' and a.grpcontno='?tGrpContNo?'" + " ,a.agenttype = grp.agenttype from lcgrpcont grp where grp.grpcontno='?tGrpContNo?' and a.grpcontno='?tGrpContNo?'" +
" and a.GRPCONTNO =GRP.GRPCONTNO ") " and a.GRPCONTNO =GRP.GRPCONTNO ")
SQLwithBindVariables updateLccont( @Param(value = "tGrpContNo",required = true) String tGrpContNo); SQLwithBindVariables updateLccont( @Param(value = "tGrpContNo",required = true) String tGrpContNo);
} }

@ -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') "),
}) })
SQLwithBindVariables updateLBPOInsuredList_ReasonByBatchNoAndStateAndIDTypeAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateLBPOInsuredList_ReasonByBatchNoAndStateAndIDTypeAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo,
@Param("state") String State, @Param("state") String State,
@ -709,8 +709,8 @@ public interface CheckInsuredListSQL {
@Param("state") String State, @Param("state") String State,
@Param("idtype") String idtype); @Param("idtype") String idtype);
@SQL(value = "update lbpoinsuredlist set birthday = date_Format(str_to_date(case when char_length(idno) = 18 " + @SQL(value = "update lbpoinsuredlist set birthday = TO_CHAR(TO_DATE(case when char_length(idno) = 18 " +
"then substr(idno, 7, 8) else concat('19' , substr(idno, 7, 6)) end,'%Y%m%d'),'%Y-%m-%d') " + "then substr(idno, 7, 8) else concat('19' , substr(idno, 7, 6)) end,'YYYYMMDD'),'YYYY-MM-DD') " +
"where idtype='?idtype?' and (birthday is null or birthday='')" + "where idtype='?idtype?' and (birthday is null or birthday='')" +
"and batchno='" + "?mBatchNo?" + "' and state='?state?' ") "and batchno='" + "?mBatchNo?" + "' and state='?state?' ")
SQLwithBindVariables updateLBPOInsuredList_BirthdayByBatchNoAndStateAndIDTypeAndBirthdayNull(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateLBPOInsuredList_BirthdayByBatchNoAndStateAndIDTypeAndBirthdayNull(@Param("mBatchNo") String mBatchNo,
@ -724,7 +724,7 @@ public interface CheckInsuredListSQL {
"and exists(select 1 from lccontplandetailsub where policyno='" + "?mGrpPropNo?" + "' and plancode=a.plancode and p13 is not null) " + "and exists(select 1 from lccontplandetailsub where policyno='" + "?mGrpPropNo?" + "' and plancode=a.plancode and p13 is not null) " +
"and not exists(select 1 from lccontplandetailsub p,Rate_Age_Gender_Pay r where p.policyno='" + "?mGrpPropNo?" + "' " + "and not exists(select 1 from lccontplandetailsub p,Rate_Age_Gender_Pay r where p.policyno='" + "?mGrpPropNo?" + "' " +
"and p.plancode=a.plancode and r.riskcode=p.riskcode and r.dutycode=p.dutycode and r.addfeeflag='0' " + "and p.plancode=a.plancode and r.riskcode=p.riskcode and r.dutycode=p.dutycode and r.addfeeflag='0' " +
"and r.minage<=floor(months_between('" + "?mCurrentDate?" + "',a.birthday)/12) " + "and r.minage<=floor(EXTRACT(YEAR FROM AGE('" + "?mCurrentDate?" + "',a.birthday)/12) " +
"and r.maxage>=floor(months_between('" + "?mCurrentDate?" + "',a.birthday)/12) " + "and r.maxage>=floor(months_between('" + "?mCurrentDate?" + "',a.birthday)/12) " +
"and r.gender=a.gender and r.payperiod=p.p13) ") "and r.gender=a.gender and r.payperiod=p.p13) ")
SQLwithBindVariables updateLBPOInsuredList_ReasonByBatchNoAndStateAndNotExistsLCContPlanDetailSub(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateLBPOInsuredList_ReasonByBatchNoAndStateAndNotExistsLCContPlanDetailSub(@Param("mBatchNo") String mBatchNo,
@ -962,7 +962,7 @@ public interface CheckInsuredListSQL {
" where batchno='" + "?mBatchNo?" + "' and state='?State?' and @{0} @{1} and bnflot is not null ", " where batchno='" + "?mBatchNo?" + "' and state='?State?' and @{0} @{1} and bnflot is not null ",
clauses = { clauses = {
@Clause(key = 0, dbType = SysConst.DBTYPE_ORACLE, clause = " not REGEXP_LIKE(bnflot, '^([0-9]+)(.[0-9]+){0,1}$') "), @Clause(key = 0, dbType = SysConst.DBTYPE_ORACLE, clause = " not REGEXP_LIKE(bnflot, '^([0-9]+)(.[0-9]+){0,1}$') "),
@Clause(key = 1, dbType = SysConst.DBTYPE_MYSQL, clause = " not bnflot REGEXP '^([0-9]+)(.[0-9]+){0,1}$' "), @Clause(key = 1, dbType = SysConst.DBTYPE_MYSQL, clause = " not bnflot ~ '^([0-9]+)(.[0-9]+){0,1}$' "),
}) })
SQLwithBindVariables updateLBPOInsuredBnfList_ReasonByBatchNoAndStateAndBnfLotNotNull(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateLBPOInsuredBnfList_ReasonByBatchNoAndStateAndBnfLotNotNull(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -1051,7 +1051,7 @@ public interface CheckInsuredListSQL {
@SQL(value = "update lbpoinsuredbnflist set reason=concat(reason,'?reason?') " + @SQL(value = "update lbpoinsuredbnflist set reason=concat(reason,'?reason?') " +
"where (select case when char_length(idno)=18 then substr(idno, 7, 8) else (concat('19',substr(idno, 7, 6))) end from dual) " + "where (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') and idtype='?idtype?' and birthday is not null " + "<> TO_CHAR(TO_DATE(birthday, 'YYYY-MM-DD'), 'YYYYMMDD') and idtype='?idtype?' and birthday is not null " +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' ")
SQLwithBindVariables updateLBPOInsuredBnfList_ReasonByBatchNoAndStateAndIDTypeAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateLBPOInsuredBnfList_ReasonByBatchNoAndStateAndIDTypeAndBirthdayNotNull(@Param("mBatchNo") String mBatchNo,
@Param("State") String State, @Param("State") String State,
@ -1061,8 +1061,8 @@ public interface CheckInsuredListSQL {
@SQL(value = "update lbpoinsuredbnflist set birthday = date_Format(str_to_date(case when char_length(idno) = 18 " + @SQL(value = "update lbpoinsuredbnflist set birthday = TO_CHAR(TO_DATE(case when char_length(idno) = 18 " +
"then substr(idno, 7, 8) else concat('19' , substr(idno, 7, 6)) end,'%Y%m%d'),'%Y-%m-%d') " + "then substr(idno, 7, 8) else concat('19' , substr(idno, 7, 6)) end,'YYYYMMDD'),'YYYY-MM-DD') " +
"where idtype='?idtype?' and (birthday is null or birthday='')" + "where idtype='?idtype?' and (birthday is null or birthday='')" +
"and batchno='" + "?mBatchNo?" + "' and state='?State?' ") "and batchno='" + "?mBatchNo?" + "' and state='?State?' ")
SQLwithBindVariables updateLBPOInsuredBnfList_GenderBirthdayByBatchNoAndStateAndBirthdayNull(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateLBPOInsuredBnfList_GenderBirthdayByBatchNoAndStateAndBirthdayNull(@Param("mBatchNo") String mBatchNo,
@ -1311,7 +1311,7 @@ public interface CheckInsuredListSQL {
"where batchno='" + "?mBatchNo?" + "' and state='?State?' and not @{0}@{1} " + "where batchno='" + "?mBatchNo?" + "' and state='?State?' and not @{0}@{1} " +
"and investrate is not null ", "and investrate is not null ",
clauses ={ clauses ={
@Clause(key = 0,dbType = SysConst.DBTYPE_MYSQL,clause = " investrate REGEXP '^([0-9]+)(.[0-9]+){0,1}$' "), @Clause(key = 0,dbType = SysConst.DBTYPE_MYSQL,clause = " investrate ~ '^([0-9]+)(.[0-9]+){0,1}$' "),
@Clause(key = 1,dbType = SysConst.DBTYPE_ORACLE,clause = " REGEXP_LIKE(investrate, '^([0-9]+)(.[0-9]+){0,1}$')") @Clause(key = 1,dbType = SysConst.DBTYPE_ORACLE,clause = " REGEXP_LIKE(investrate, '^([0-9]+)(.[0-9]+){0,1}$')")
} ) } )
SQLwithBindVariables updateLBPOInvestList_ReasonByBatchNoAndStateAndCheckInvestRate(@Param("mBatchNo") String mBatchNo, SQLwithBindVariables updateLBPOInvestList_ReasonByBatchNoAndStateAndCheckInvestRate(@Param("mBatchNo") String mBatchNo,

@ -11,7 +11,7 @@ public interface CreateInsuredDataSQL {
@SQL(value = "insert into lcinsured( grpcontno, contno, insuredno, prtno, appntno, executecom, relationtomaininsured, insuredtype, sequenceno, name, sex, birthday, idtype, idno, islongvalid,IDStartDate, IDExpDate, " + @SQL(value = "insert into lcinsured( grpcontno, contno, insuredno, prtno, appntno, executecom, relationtomaininsured, insuredtype, sequenceno, name, sex, birthday, idtype, idno, islongvalid,IDStartDate, IDExpDate, " +
"insuredappage, seniority, JoinCompanyDate, workno, position, salary, OccupationType, OccupationCode,socialinsuflag, contplancode, plancode, InsuredStat, serverarea, subcustomerno, substandard, " + "insuredappage, seniority, JoinCompanyDate, workno, position, salary, OccupationType, OccupationCode,socialinsuflag, contplancode, plancode, InsuredStat, serverarea, subcustomerno, substandard, " +
"deptcode, subcompanycode, insurecode, workaddress, socialinsuaddress, InsuredPeoples,NativePlace,Nationality,BankAccNo,BankCode,AccName,EnterPriseBurden,PersonBurden,Marriage,WorkState, managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime, PoliticalSecuCoopFlag, IndividualBusOperFlag, DisabledPersonFlag) " + "deptcode, subcompanycode, insurecode, workaddress, socialinsuaddress, InsuredPeoples,NativePlace,Nationality,BankAccNo,BankCode,AccName,EnterPriseBurden,PersonBurden,Marriage,WorkState, managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime, PoliticalSecuCoopFlag, IndividualBusOperFlag, DisabledPersonFlag) " +
"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), " +
"a.occupcode,ifnull(a.socialinsuflag,'3'),b.contplancode,a.plancode,'00',a.serverarea,a.subcustomerno,a.substandard,a.deptcode,a.subcompanycode,a.insurecode,a.workaddress,a.socialinsuaddress,1,a.NativePlace,a.Nationality,a.BankAccNo,a.HeadBankCode ,a.AccName,a.EnterPriseBurden,a.PersonBurden,a.Marriage,a.WorkState, " + "a.occupcode,ifnull(a.socialinsuflag,'3'),b.contplancode,a.plancode,'00',a.serverarea,a.subcustomerno,a.substandard,a.deptcode,a.subcompanycode,a.insurecode,a.workaddress,a.socialinsuaddress,1,a.NativePlace,a.Nationality,a.BankAccNo,a.HeadBankCode ,a.AccName,a.EnterPriseBurden,a.PersonBurden,a.Marriage,a.WorkState, " +
"'?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 {
@SQL(value = "insert into lcinsured( grpcontno, contno, insuredno, prtno, appntno, executecom, relationtomaininsured, insuredtype, sequenceno, name, sex, birthday, idtype, idno, islongvalid,IDStartDate, IDExpDate, " + @SQL(value = "insert into lcinsured( grpcontno, contno, insuredno, prtno, appntno, executecom, relationtomaininsured, insuredtype, sequenceno, name, sex, birthday, idtype, idno, islongvalid,IDStartDate, IDExpDate, " +
"insuredappage, seniority, JoinCompanyDate, workno, position, salary, OccupationType, OccupationCode,socialinsuflag, contplancode, plancode, InsuredStat, serverarea, subcustomerno, substandard, " + "insuredappage, seniority, JoinCompanyDate, workno, position, salary, OccupationType, OccupationCode,socialinsuflag, contplancode, plancode, InsuredStat, serverarea, subcustomerno, substandard, " +
"deptcode, subcompanycode, insurecode, workaddress, socialinsuaddress, InsuredPeoples,NativePlace,Nationality,BankAccNo,BankCode,AccName,EnterPriseBurden,PersonBurden,Marriage,WorkState, managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime, PoliticalSecuCoopFlag, IndividualBusOperFlag, DisabledPersonFlag) " + "deptcode, subcompanycode, insurecode, workaddress, socialinsuaddress, InsuredPeoples,NativePlace,Nationality,BankAccNo,BankCode,AccName,EnterPriseBurden,PersonBurden,Marriage,WorkState, managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime, PoliticalSecuCoopFlag, IndividualBusOperFlag, DisabledPersonFlag) " +
"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), " +
"a.occupcode,ifnull(a.socialinsuflag,'3'),b.contplancode,a.plancode,'00',a.serverarea,a.subcustomerno,a.substandard,a.deptcode,a.subcompanycode,a.insurecode,a.workaddress,a.socialinsuaddress,1,a.NativePlace,a.Nationality,a.BankAccNo,a.HeadBankCode ,a.AccName,a.EnterPriseBurden,a.PersonBurden,a.Marriage,a.WorkState, " + "a.occupcode,ifnull(a.socialinsuflag,'3'),b.contplancode,a.plancode,'00',a.serverarea,a.subcustomerno,a.substandard,a.deptcode,a.subcompanycode,a.insurecode,a.workaddress,a.socialinsuaddress,1,a.NativePlace,a.Nationality,a.BankAccNo,a.HeadBankCode ,a.AccName,a.EnterPriseBurden,a.PersonBurden,a.Marriage,a.WorkState, " +
"'?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 {
@SQL(value = "insert into lcbnf(contno, polno, insuredno,CustomerNo, bnftype, bnfgrade, bnfno, relationtoinsured, bnflot, name, sex, birthday, idtype, idno,NativePlace,IDStartDate,islongvalid,IDEndDate,Mobile,Province,City,District,PostalAddress, managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime) " + @SQL(value = "insert into lcbnf(contno, polno, insuredno,CustomerNo, bnftype, bnfgrade, bnfno, relationtoinsured, bnflot, name, sex, birthday, idtype, idno,NativePlace,IDStartDate,islongvalid,IDEndDate,Mobile,Province,City,District,PostalAddress, managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime) " +
"select contno, contno, insuredno, CustomerNo, bnftype, bnforder, bnfno,relationtoinsured, bnflot, bnfname, gender, birthday, idtype, idno,NativePlace,IDStartDate,islongvalid,IDEndDate,Mobile,Province,City,County ,Address,'?mManageCom?','?mComCode?','?mOperator?', " + "select t.contno,\n" +
" t.contno AS polno,\n" +
" t.insuredno,\n" +
" t.CustomerNo,\n" +
" t.bnftype,\n" +
" t.bnforder AS bnfgrade,\n" +
" 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")}) @Clause(key = 1, dbType = SysConst.DBTYPE_MYSQL, clause = "SELECT\n" +
" b.contno,\n" +
" b.insuredno,\n" +
" a.CustomerNo,\n" +
" a.bnforder,\n" +
" a.relationtoinsured,\n" +
" a.bnflot,\n" +
" a.bnfname,\n" +
" a.gender,\n" +
" a.birthday,\n" +
" a.idtype,\n" +
" a.idno,\n" +
" a.bnftype,\n" +
" a.NativePlace,\n" +
" a.IDStartDate,\n" +
" a.islongvalid,\n" +
" a.IDEndDate,\n" +
" a.Mobile,\n" +
" a.Province,\n" +
" a.City,\n" +
" a.County,\n" +
" a.Address,\n" +
" a.serialno\n" +
" FROM lbpoinsuredbnflist a\n" +
" JOIN lbpoinsuredlist b ON b.batchno = a.batchno AND b.insuredid = a.insuredid\n" +
" WHERE a.batchno = '?mBatchNo?'\n" +
" AND a.state = '?tState?'\n" +
" AND b.batchno = '?mBatchNo?'\n" +
" AND b.state = '?tState?'\n" +
" AND b.serialno IN (\n" +
" SELECT serialno\n" +
" FROM lbpoinsuredlist\n" +
" WHERE batchno = '?mBatchNo?' AND state = '?tState?'\n" +
" ORDER BY serialno\n" +
" OFFSET ?tStartRow? LIMIT ?tPageSize?\n" +
" )\n" +
") t\n" +
"ORDER BY t.contno, t.insuredno, t.bnforder, t.serialno")})
SQLwithBindVariables insertLCBnfByLBPOInsuredBnfList_LBPOInsuredListAndBatchNoAndStateAndMore(@Param("mManageCom") String mManageCom, SQLwithBindVariables insertLCBnfByLBPOInsuredBnfList_LBPOInsuredListAndBatchNoAndStateAndMore(@Param("mManageCom") String mManageCom,
@Param("mOperator") String mOperator, @Param("mOperator") String mOperator,
@Param("mComCode") String mComCode, @Param("mComCode") String mComCode,
@ -164,7 +223,7 @@ public interface CreateInsuredDataSQL {
@SQL(value = "insert into lcpol(GrpContNo, grppolno, PROPOSALNO, PRTNO, AGENTCODE, AGENTGROUP, contno, polno, insuredno, riskcode, insuredappage, getyear, getstarttype, polstate, MULT,STANDPREM,PREM,SUMPREM,AMNT,RISKAMNT,OccupationType,InsuredName,InsuredSex,InsuredBirthday,ContPlanCode,poltypeflag,KindCode, " + @SQL(value = "insert into lcpol(GrpContNo, grppolno, PROPOSALNO, PRTNO, AGENTCODE, AGENTGROUP, contno, polno, insuredno, riskcode, insuredappage, getyear, getstarttype, polstate, MULT,STANDPREM,PREM,SUMPREM,AMNT,RISKAMNT,OccupationType,InsuredName,InsuredSex,InsuredBirthday,ContPlanCode,poltypeflag,KindCode, " +
"managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime) select '?mGrpPropNo?','000000','?mGrpPropNo?','?mGrpPropNo?','000000','000000',a.contno,CreateBussNo('POLNO','?mManageCom?'),a.insuredno,t.riskcode, " + "managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime) select '?mGrpPropNo?','000000','?mGrpPropNo?','?mGrpPropNo?','000000','000000',a.contno,CreateBussNo('POLNO','?mManageCom?'),a.insuredno,t.riskcode, " +
"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 {
@SQL(value = "insert into lcpol(GrpContNo, grppolno, PROPOSALNO, PRTNO, AGENTCODE, AGENTGROUP, contno, polno, insuredno, riskcode, insuredappage, getyear, getstarttype, polstate, MULT,STANDPREM,PREM,SUMPREM,AMNT,RISKAMNT,OccupationType,InsuredName,InsuredSex,InsuredBirthday,ContPlanCode,poltypeflag,KindCode, " + @SQL(value = "insert into lcpol(GrpContNo, grppolno, PROPOSALNO, PRTNO, AGENTCODE, AGENTGROUP, contno, polno, insuredno, riskcode, insuredappage, getyear, getstarttype, polstate, MULT,STANDPREM,PREM,SUMPREM,AMNT,RISKAMNT,OccupationType,InsuredName,InsuredSex,InsuredBirthday,ContPlanCode,poltypeflag,KindCode, " +
"managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime) select '?mGrpPropNo?','000000','?mGrpPropNo?','?mGrpPropNo?','000000','000000',a.contno,CreateBussNo('POLNO','?mManageCom?'),a.insuredno,t.riskcode, " + "managecom, comcode, operator, makedate, maketime, modifyoperator, modifydate, modifytime) select '?mGrpPropNo?','000000','?mGrpPropNo?','?mGrpPropNo?','000000','000000',a.contno,CreateBussNo('POLNO','?mManageCom?'),a.insuredno,t.riskcode, " +
"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?' ")
SQLwithBindVariables insertLCPolByLBPOInsuredList_LCContPlanDetailAndBatchNoAndStateAndMoreNew(@Param("mManageCom") String mManageCom, SQLwithBindVariables insertLCPolByLBPOInsuredList_LCContPlanDetailAndBatchNoAndStateAndMoreNew(@Param("mManageCom") String mManageCom,
@Param("mOperator") String mOperator, @Param("mOperator") String mOperator,

Loading…
Cancel
Save