이 기사는 주로 엔티티 데이터를 저장하는 방법을 소개합니다. 특정 내용은 다음과 같습니다.
1. XML 샘플
<? xml version = "1.0"encoding = "gbk"?> <! <! <!-1..1-> <cisReports batno = "쿼리 배치 번호"Query hatname = "쿼리 단위 이름"subOrgan = "branch name"queryuserid = "쿼리 로그인 이름"querycount = "Query yyyymmd" hh24 : mm : ss "> <!-다음은 각 쿼리 응용 프로그램에 대한 쿼리 결과입니다. ID는 Commas "TreationResult ="Compact 수수료 수수료 수수료 시간에 해당하는 SubReportTypes에 해당하는 수수료 하위 보고서의 소형 수수료 시간은 0보다 큰 값의 세트입니다. Commas "SubReportTypessHortCaption ="Query Fee Subreport Chinese Name "refid ="Query ID, Query Application 조건의 참조 ID "Hassystemerror ="hassystemerror가 있습니다. 거짓 : 오류 없음 "isfrozen ="고객이 동결되었는지, true : frozen, false : frozen : frozen "> <!-1Qery 조건 정보 1..1-> <queryConditions> <!-1...n-> <item> <name> 쿼리 조건 영어 이름 </name> <caption> query 조건 중국어 이름 </value> query value </value condition </value condition> <!-2identity Authentication1..1-> <PoliceCheckinfo subReportType = "10602"SubReportTypeCost = "96040"TreateResult = "Subreport Query Status, 1 : Find, 2 : 발견되지 않음, 3 : 세부 사항이 발견 될 때의 오류 코드를 찾을 수 없습니다. 이 속성은 "errormessage ="오류 설명 treeatresult = 3, treatresult! = 3 일 때,이 속성의 값이 비어있을 때,이 속성의 값이 쿼리의 이름 </name> <tocumentno> queryee의 이름 </documentno> <!-1, 일관성있는 2, 일관성있는 치료법은 비어있다. 일관되지 않은 </resent> </item> </policecheckinfo> <!-3 사람의 휴대 전화 번호 검증 1..1-> <mobileCheckinfo subReportType = "13612"SubReportTypeCost = "96040"TreatmentResult = "하위보고 쿼리 상태, 1 : 찾기, 3 : ever found, not fornes fornes found, not forend the found. Treeatresult! = 3 일 때 데이터 사전. 속성이 존재하지 않습니다. " errormessage = "errormessage = treetresult = 3, treatresult! = 3 일 때,이 속성의 값은 비어있을 때,이 속성의 값은 비어있을 때"> <! --- treatesult는 2와 3입니다. 검증 결과 : 일관성, 일관성이없고 일관되지 않은 </d 4 개의 개인 소포 위험 요약 1..1-> <personantispoofingdescinfo subreporttype = "14225"subreporttypecost = "96040"TreatmentResult = "Subreport Query Status ="Sub-Report Query Status, 1 : Find, 2 : 3 : 다른 이유로 찾을 수 없음 "트리터 러 스코 코드 ="트리트레이트 러트가 가능합니다. treatsult! = 3, 속성이 존재하지 않습니다. 다음 예에서와 같이, 비어있을 수 있으며, 그 중 0 또는 n이있을 수 있으며, 이는 특정 결과에 따라 반환 할 수 있습니다. 1. 송곳 방지 위험 점수는 100 포인트이고 위험 수준이 높으며 거부하는 것이 좋습니다. 2. 통신 휴대 전화 번호 131 **** 1542는 1 개월 미만으로 사용되었습니다. 3. 양모 파티 목록을 쳤다. 4. 적중 사기 위험 목록. 5. 고위험 직원 목록. 6. 7 개의 연체 신용 기록이 있습니다. 7. 40 개의 개인 위험 요약 정보가 있습니다. 8. 지난 2 년 동안 개인 정보는 23 번 쿼리되었습니다. -> <cernantispoofingdesc> 개인 차가 반대 검토 정보 </personantispoofingdesc> </personantispoofingdesc> <!-5 개인 금지 위험 점수 정보 1..1-> <personantispoofinginfo subreporttype = "14224"SubreportTypecost = "96040"Subreporpery stituble " Checked, 3 : "TreeTresult = 3 인 경우 오류 코드는 다른 이유로 확인하지 않으 셨습니다. errormessage = "treeatresult = 3 인 경우 오류 설명 정보 Treeatresult! = 3,이 속성의 값이 비어 있습니다"> <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------. 6 휴대폰 번호 상태 정보 1..1-> <mobilestatusinfo subreporttype = "13611"SubReportTypeCost = "96040"TreateResult = "Subreport Query Status, 1 : Find, 2 : 찾지 못한다." "오류 코드 ="Treetresult = 3, TREATRESULTER, TREATRESULTER를 참조하십시오. errormessage = "Treatresult = 3 일 때의 오류 설명 정보, treatresult! = 3,이 속성의 값은 비어있을 때"> <!-Treeatretresult가 2 또는 3 일 때 다음 노드가 없습니다-> <item> <operatator> 운영자 1 : China Telecom 2 : China Mobile 3 : inlain <cailorin <ancointustrittip. 1 : 정상 사용 2 : 셧다운 3 : 활성화되지 않음 4 : 숫자 5-Other 6 : 사전 낭독 </phonestatus> <timelgrength> 인터넷에서의 휴대폰 번호 : 인터넷 시간, 1 개월 미만, 1-2 개월, 3-6 개월, 7-12 개월 </timelgrength </aittin> Wool Parties 1..1-> <econnoisserurinfo subreporttype = "14228"subreporttypecost = "96040"TreateResult = "subreport query status, 1 : find, 2 : find : 3 : 다른 이유에 대해 찾지 못한다" "오류 코드 = 3, trutresult = 3 : treatres-dictres-dectres worly for for the dictionary for for for the the the the Setalle. treatresult! = 3 인 경우 속성이 존재하지 않습니다. <!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- subReportType="14229" SubReportTyPecost = "96040"TreaterResult = "Subreport Query Status, 1 : Find, 2 : 찾을 수 없음, 3 : 다른 이유로 찾을 수 없음" "TreeTresult = 3 오류 코드, TreeTresult! = 3,이 속성이 존재하지 않는 경우, TREATRESULT = 3, TREATRESUTT의 TREATRESULT = 3, TREATRESULT! 속성은 "> <!-Treeatretresult가 2 또는 3 인 경우 다음 노드가 없습니다.> <state> 사기 위험 목록에 부딪 칠 것인지, 값 : 0/1, 0은 사기 위험 목록을 누락했는지, 1은 사기 위험 목록을 누락했음을 의미합니다. SubReportTypecost = "96040"TreaterResult = "Subreport Query Status, 1 : Find, 2 : Checked, 3 : 다른 이유로 찾을 수 없음" "TreaterrorCode ="TreeTresult = 3, TreeTresult! = 3, 속성이 존재하지 않는 경우, TREATRESULT = 3, TREATRESUTT의 오류 설명이 존재하지 않을 때 데이터 사전을 참조하십시오. 속성은 "> <!-Treatreatesult가 2 또는 3 인 경우 다음 노드가 없습니다 .-> <checkresult> 고위험 목록에 도달할지 여부 : 예, 2 : no </checkresult> </personRiskAssess> <!-10 온라인 대출 초과 정보 1..1-> <MicronearlyStreeIearSoverDueInfo SUBPORTTYPE ="13204 ""13204 " SubReportTypecost = "96040"TreaterResult = "Subreport Query Status, 1 : Find, 2 : 찾을 수 없음, 3 : 다른 이유로 찾을 수 없음"TreeTRESULT = 3 일 때 오류 코드를 찾을 수 없습니다. 자세한 내용은 Data Dictionary를 참조하십시오. Treatresult! = 3이 될 때 속성이 존재하지 않습니다. "errormessage ="오류 설명 treatresult = 3, treatresult! = 3이 될 때이 속성의 값이 비어있을 때,이 속성의 값이 비어있을 때 "-treeatretresult가 2 또는 3 인 경우, 다음 노드가 없습니다.> <stat> <everdueamount> overdue-indue indue induemount> <everdueamount. 대출의 기본 정보 </overdueamount> <duduedays> 연체 일일 간격, 값 범위 : 기한 연체 (포함) 이상 (포함) 이상 </overduedays> <dudduecount> 초과 일일 수의 총 거래 수 </perforduecount> </stat> <!-0..1-> aitment> <aitment 1.5 다중 레코드 1.5. <deverdueamount> 연체 교장, 단위 : 대출 기본 정보의 통화에 따라 </overdueamount> <duduedays> 초과 일일 간격, 가치 범위 : 1-6 일 연체, 7-29 일 연체, 30-89 일 연정, 60-89 일, 90 일 이상 (inclubure). 연체 일수 간격 </overduecount> </item> </item> </micronearlythreeyearsoverDueInfo> <!-11 위험 정보 1..1-> <personRiskInfo subReportType = "14227"subReportTyPecost = "96040"DeaterResult = "Subreport Quents =" Code TreaterrorCode = "TreeTresult = 3 인 경우, 자세한 내용은 데이터 사전을 참조하십시오. treatresult! = 3 인 경우 속성이 존재하지 않습니다. "errormessage ="treatresult = 3, 오류 설명 정보 Treatresult! = 3 인 경우이 속성의 값이 비어 있습니다. "> <!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <cqggcount> 채용 발표에 대한 정보 수 </cqggcount> <wdyqcount> 기한 연체 온라인 대출에 대한 정보 수 </wdyqcount> </stat> <!-요약 정보 종료-> <!-요약 정보 0..1-> <!-요약 정보 0..1- <als> <als> <als> <als> -> <item> <crecord> 레코드 번호 </recordid> <bt> title </bt> <ajlx> 사례 유형 </ajlx> <sjnf> 검토 연도, 형식 : yyyy </sjnf> <dsrlx> 파티 유형 </dsrlx> </airet> <!-Judicial Information of Judicution Information 0..1-> 사법 집행 정보의 요약 1..n-> <eittid> recordid> 레코드 번호 </recordid> <bt> title </bt> <zxbd> 실행 대상, 단위 : 통화는 우선 </zxbd> <larq> 제출 날짜, 제출 날짜, </leqq> </aits> <!----------- <SXS> <!-신탁 정보의 사법 위반에 대한 요약 정보 1..N-> <item> <ceptid> 레코드 번호 </recordid> <bt> 제목 </bt> <larq> 제출 날짜, 형식 YYYY-MM-DD </larq> <fbrq> 릴리스 날짜, 형식 YYYY-MM-DD </fbrq> </sx> 요약 정보 0..1-> <sws> <!-세금 행정법 집행 정보 요약 정보 내용 1..n-> <item> <ceptid> 레코드 번호 </recordid> title </bt> <ggrq> 발표 날짜, 형식 Yyyy-MM-DD </ggrq> </item> </sws>-> tale information information 0..1-> 1-> 법 집행 정보 요약 정보 내용 1..N-> <item> <crectid> 레코드 번호 </recordid> <bt> title </bt> <fbrq> 출시 날짜, yyyy-mm-dd </fbrq> </item> </cqs> <! <itet> <crectid> 레코드 번호 </recordid> <bt> title </bt> <fbrq> 출시 날짜, 형식 Yyyy-MM-DD 형식 </fbrq> </item> </wdyqs> </summary> </personRiskInfo> <!-지난 2 년 동안의 12 명의 역사적 쿼리 레코드 1-> <1990 년 history impeoryinfo infoyinfo infoyinfo historical query 기록. SubReportTyPecost = "96040"TreateResult = "하위보고 쿼리 상태, 1 : 확인, 2 : 찾을 수 없음, 3 : 다른 이유로 찾을 수 없음" "오류 코드 ="TreeTresult! = 3에 대해서는 세부 사항이 존재하지 않을 때 "ErrormesSage = 3, TreaTresUld가있을 때! 빈 "> <! --- Treatreatesult가 2와 3 인 경우 다음 노드가 없습니다-> <!-0..1-> <afferme> <!-1..-> <itempermember> initmember> initmember> <ospermmonth> 지난 달의 쿼리 레코드 수 </last1month> <ast3month의 query 숫자 번호 </last3month 숫자 번호. 지난 6 개월 동안의 쿼리 레코드 </last6month> <Fast12month> 지난 12 개월 동안의 쿼리 레코드 수 </last12month> <ast18month> 지난 18 개월 동안의 쿼리 레코드 수 </last18month> <ast24month> 지난 24 개월 동안의 쿼리 레코드 수 </last24mon </items> <! 지난 1 개월 동안의 쿼리 기록 </last1month> <Fast3month> 지난 3 개월 동안의 총 쿼리 레코드 수 </last3month> <ast6month> 지난 6 개월 동안의 총 쿼리 레코드 수 </last6month> <SOFF12MONTH> 지난 12 개월 동안 총 쿼리 레코드의 총 쿼리 레코드 수치 <Sonfer 18month> 지난 18 년의 총 쿼리 레코드의 총 쿼리 레코드 수 달 </last18month> <Fast24month> 지난 24 개월 동안 각 단위 유형의 총 쿼리 레코드 수 </last24month> </count> </historsimplequeryInfo> </cisreport> </cisreports>
2. 테이블 구조 설계
1. 배치 번호 : 각 테이블은 가장 바깥 쪽 배치 번호와 관련이 있습니다.
2. 메인 테이블 : 즉, 각 레이어의 모든 필드는 한 테이블에 저장됩니다.
세, 물리적 디자인
Cisreportroot, CisreportChild, ReportElement의 세 가지 층으로 나뉩니다
공개 클래스 CisReportroot 확장 Basepojo 구현 시리얼이즈 가능한 {private String docid; 개인 문자열 batno; // 쿼리 배치 번호 @jsonfield (serialize = false) 개인 문자열 xmlid; 개인 CisreportChild CisreportChild;/*** 2017/7/21. *노드 속성 및 자식 노드 보고서*/공개 클래스 CisreportChild는 Basepojo {/***보고서 생성 종료 시간 **/private String buildendtime; / *****/ private string hassystemerror가 없다는 거짓이 있다는 시스템 오류가 사실입니까? / ***고객이 동결되었는지 여부 **/ 개인 문자열 isfrozen; 개인 보고서 보고서보고; Public Class ReportElement는 Basepojo {Private String Phone; 개인 정책 정책 인증 PoliceCheckinfo; // Identity Authentication Private MobileCheckinfo MobileCheckinfo; // 사람 휴대 전화 번호 검증 개인 인물 푸딩 스 피신 페르소 팬티 스 푸싱 드 스케인 포; // 개인적 반기적 인 Fraud Risk InformantISPOFOFOFINFO; // 개인적 반점 위험 검토 정보 개인 정보 반응 위험 검토; mobilestatusinfo mobilestatusinfo; // 휴대 전화 번호 상태 정보 개인 econnoisserurinfo econnoisserurinfo; // Wool Party List에 부딪쳤다. 개인 사기 사기 리스크 킨포 사기 리스크 킨포; // 사기 위험 목록에 부딪쳤다. MicronearlythreeYearSoverDueInfo; // 온라인 대출 기한 기한 기한 정보 개인 riskInfo personRiskInfo; // 위험 정보 개인 historysimplequeryInfo historysimplequeryInfo; // 지난 2 년 동안의 개인 기록 쿼리 레코드4, 코드
<10> 단일 트랜잭션, 배치에는 1 차 키가 필요하지 않습니다
데이터는 단일 트랜잭션 또는 배치의 맵에 저장 될 수 있으며 SQL의 맵 키를 통해 데이터를 얻을 수 있습니다.
좋다:
private void savepersonRiskInfo (String batno, personRiskInfo personRiskInfo) 예외 {map <String, Object> Map = new Hashmap <> (); map.put ( "batno", batno); // 단일 핸드 맵 .put ( "항목", personRiskInfo); pymapper.savepersonRiskInfo (지도); if (! listUtil.isempty (personRiskInfo.getallist ())) {// batch map.put ( "list", personRiskInfo.getallist ()); pymapper.savealinfolist (지도); }SQL :
<!-개인 위험 기록->/ 단일 <insert id = "SavePersonRiskInfo"ParameterType = "java.util.map"> table_person_risk_info (batno, totlecount, alcount, ZxCount에 삽입 ( #{batno, jdbctype = varchar}, #{item.totlecount, jdbctype = numeric}, #{item.alcount, jdbctype = numeric},#{item.zxcount, jdbctype = numeric},#{item.sxcount, jdbctype = numeric},#{ item.swcount, jdbctype = numeric},#{item.cqggcount, jdbctype = numeric},#{item.wdyqcount, jdbctype = numeric}). </insert> <!-기한 기한의 세부 레코드-> // Batch <insert id = "sevemicronearlythreeyearSoverDueInfolist"parameterType = "java.util.map"> table_mntyoi에 삽입. #{batno, jdbctype = varchar}, #{item.overdueamount, jdbctype = varchar}, #{item.overduedays, jdbctype = varchar}, #{item.overduecount, jdbctype = numeric} </foreach> Invokepy (Pyquerybean Pyquerybean) 예외 {pyquerybean.setqueryfrompy (query_from_py); // py service cisreportroot cisreportroot = querycisreportfrompyserverver (pyquerybean); cisreportroot.getCisreportChild (). getReportElement (). setphone (pyqueryBean.getPhone ()); //cacheservice.save(cisreportroot); // (1) 데이터 저장 SaveCisReport (cisreportroot); CISREPORTROOT 리턴; }(1) 데이터 저장
@transactional (rollbackfor = exception.class) @override public cisreportroot savecisreport (cisreportroot cisreportroot) throws exception {reportElement ReportElement = cisreportroot.getCisreportChild (). getReportElement (); PersonRiskInfo PersonRiskInfo = ReportElement.getPersonRiskInfo (); // (2) 주 테이블, XML의 모든 노드 정보 저장 (개인 위험 정보 제외), 단일 데이터 저장 Pymapper.SaveCisReport (CisReportroot); if (성공. } if (cisreportroot.getCisReportChild (). getReportElement (). gethistorySimpleQueryInfo (). getTreeTresult (). Equals (success)) {map <String, Object> Map = new Hashmap <> (); // (3) 배치 데이터 맵을 저장합니다. if (! listutil.isempty (cisreportroot.getCisreportChild (). getReportElement (). gethistorySimpleQueryInfo (). getItemList ())) {map.put ( "list", cisreportroot.getCisReportChild (). getReportElement (). gethistorySimpleQueryInfo (). getItemList ()); Pymapper.SaveHistorySimpleQueryInfolist (MAP); } if (! listUtil.isempty (cisreportroot.getCisReportChild (). getReportElement (). getMicroneArlySoearSoverDueInfo (). getList ())) {map.put ( "list", cisreportroot.getCisReportChild (). getReportElement (). getMicronearlythreeyEarsOverDueInfo (). getList ()); pymapper.savemicronearlythreeyearsoverdueinfolist (MAP); }} CisReportroot를 반환합니다. } catch (예외 e) {logger.error ( "savecisreport@pyserviceimpl_exception", e); e 던지기; }}(2) 메인 테이블을 저장하십시오
<insert id = "savecisreport"parametertype = "java.util.map"> table_cisreport에 삽입 (batno, buildendtime, isfrozen, MCI_NAMECHECKRESULT, MCI_AREAINFO, MCI_DOCUMENTNOCHECKRESULT, MCI_OPERATOR, MCI_PHONECHECKRESULT, PCI_DOCUMENTNO, PCI_NAME, PCI_RESULT, PASDI_DESC, PASI_HITTYPES, PASI_RISKLEVEL, PASIKSISK, PASI_RISKLEVEL MS_AREAINFO, MS_CANCELTIME, MS_OPERATOR, MS_PHONESTATUS, MS_TIMELENGTER, ECONNOISSERUR, 사기 리스크, PRA_CHECKRESULT, MNTYOI_OVERDUEAMOUNT, MNTYOI_OVERDUECOUNT, MNTYOI_OVERDUECOUNT, MNTYOI_OVERDUEDAYS, MNTYOI_OVERDUECOUNT hs_last1month, hs_last3month, hs_last6month, hs_last12month, hs_last18month, hs_last24month, phone, xmlid) 값 (#{batno, jdbctype = varchar}, to_date (#{cispportchild.buildendchild.buildchild.buildchild hh24 : mi : ss '), #{cisreportchild.isprozen, jdbctype = varchar}, #{cisreportchild.reportElement.mobileCheckinfo.namecheckresult, jdbctype = varchar}, #{CisReportChild.ReportElement.MobileCheckinfo.areainfo, jdbctype = varchar}, #{cisreportChild.ReportElement.MobileCheckInfo.documentNocheckecresult, jdbctype = varchar}, #{CisReportChild.ReportElement.MobileCheckinfo.operator, jdbctype = numeric}, #{cisreportChild.RopportElement.MobileCheckInfo.Phonecheckresult, jdbctype = varchar}, #{CisReportChild.ReportElement.policEcheckinfo.documentno, jdbctype = varchar}, #{cisreportchild.reportElement.policeCheckinFo.Result, jdbctype = numeric}, #{CisReportChild.ReportElement.PersonAntisPoofingDescInfo.personantispoofingdesc, jdbctype = varchar}, #{cisreportchild.reportElement.personantispoofinginfo.hittypes, jdbctype = varchar}, #{CisReportChild.reportElement.PersonAntisPoofingInfo.RiskLevel, JDBCType = VarChar}, #{CisReportChild.ReportElement.PersonAntisPoofingInfo.RiskScore, jdbctype = Varchar}, #{CisReportChild.ReportElement.PersonAntisPoofingInfo.Suggest, jdbctype = varchar}, #{cisreportChild.ReportElement.Mobilestatusinfo.areainfo, jdbctype = varchar}, #{CisReportChild.ReportElement.Mobilestatusinfo.canceltime, jdbctype = varchar}, #{cisreportchild.reportElement.mobilestatusinfo.operator, jdbctype = numeric}, #{CisReportChild.ReportElement.MobilestatusInfo.Phonestatus, jdbctype = numeric}, #{cisreportChild.ReportElement.MobilestatusInfo.tomelength, jdbctype = varchar}, #{CisReportChild.ReportElement.econnoisserurinfo.state, jdbctype = numeric}, #{cisreportChild.FraudRiskInfo.state, jdbctype = numeric}, #{CisReportChild.ReportElement.personRiskAssess.Checkresult, JDBCTYPE = NUMERIC}, #{CisReportChild.ReportElement.MICRONEARLYTHREEYEARSOVERDUEINFO.OverdUeAmount, JDBCTYPE = VARCHAR}, #{CisReportChild.ReportElement.MICRONEARLYTREEYEURSOVERDUEINFO.OVERDUECOUNT, jDBCTYPE = Numeric}, #{CisReportChild.ReportElement.MicroneArlyTreeYearSoverDueInfo.OverDudeAides, jdbctype = varchar}, #{CisReportChild.ReportElement.HistorySimpleQueryInfo.totalCount.last1month, jdbctype = Numeric}, #{CisreportChild.ReportElement.historySimplequeryInfo.totalCount.last3month, JDBCTYPE = Numeric} #{CisReportChild.ReportElement.HistorySimpleQueryInfo.totalCount.last6month, jdbctype = Numeric}, #{CisreportChild.ReportElement.historySimplequeryInfo.totalCount.last12month, JDBCTYPE = NUMERIC}, #{CisReportChild.ReportElement.HistorySimpleQueryInfo.totalCount.last18month, jdbctype = Numeric}, #{CisReportChild.ReportElement.historySimplequeryInfo.totalCount.last24month, JDBCTYPE = NUMERIC}, #{CisReportChild.ReportElement.Phone, jdbctype = varchar}, #{xmlid, jdbctype = varchar})(3) 배치 데이터 저장 (기본 키는 자동으로 생성되지 않음)
<!-지난 2 년간의 개인 역사적 쿼리 레코드-> <insert id = "saveHistorySimpleQueryInfolist"parameterType = "java.util.map"> table_history_simple_query (batno, unit_member, last1month, last3month, last12month, last18month, last18month) collection = "list"item = "item"separator = "Union all"> ( #{batno, jdbctype = varchar}, #{item.unitmember, jdbctype = varchar}, #{item.last1month, jdbctype = numeric}, jdbctype = {item.last3month, jdbctype = 숫자}, #{item.last6month, jdbctype = numeric}, #{item.last12month, jdbctype = numeric}, #{item.last18month, jdbctype = numeric}, #{item.last24month, jdbctype = humeric} <2> 단일 스트로크, 배치를 기본 키에 삽입해야합니다.
단일 스트로크에는 기본 키가 포함되어 있습니다
DataServicedEtailResult DataServicedEtailResult = tdservice.getServicedEtailResult (tdreportroot); int n = tddataservicemapper.insertDataservicedEtailResult (dataServicedEtailResult); <!-정보 검증 인터페이스-> <!-DataService-> <insert id = "insertDataServicedEtailResult"parameterType = "dataServiceKeProperty ="selectKey keyProperty = "id"resultType = "bigdecimal"order = "이전"> seq_ics_td_dataservice.nextval as id id idect at indect as idect </select <datservice. ics_td_dataservice (id, recordid, rasy_desc, rasy_code, success) 값 ( #{id, jdbctype = decimal}, #{recordid, jdbctype = decimal}, #{reasondesc, jdbctype = varchar}, #{varcode, jdbctype = varctype. #{성공, jdbctype = Decimal}) </insert>배치 저장에는 기본 키가 포함됩니다
if (! listUtil.isempty (interfacesList)) {map.put ( "recordId", id); map.put ( "list", interfacesList); tddataservicemapper.addbatchinterfaces (map); }SQL :
<!-배치 저장 인터페이스-> <insert id = "addbatchinterfaces"parametertype = "java.util.list"> <!-주석은 mySQL 삽입 방법입니다. 삽입 할 수 있지만 데이터는 롤백 할 수 없습니다. 다음은 Oracle Insertion 방법입니다. ParameterType : java.util.list 또는 java.util.map을 시작할 수 있습니다. <foreach collection = "list"item = "item"index = "index"separator = ""> insert inc_td_interfaces (id, recordid, type) 값 (bloancrdtdata.seq_ics.seq_ics.sextfaces. #{recordId, jdbctype = decimal}, #{item.type, jdbctype = varchar}); </foreach> 커밋; end;-> ics_td_interfaces (id, recordid, type)에 삽입) seq_ics_td_interfaces.nextval id, A.* from (<foreach collection = "list"item = "index"index "separator ="union all "> select #{recordid, jdbctype = decimal}, #{jdbctype = varl. </foreach>) a </insert>요약
위의 것은 편집기가 단일 배치로 물리적 데이터를 저장하는 방법입니다. 모든 사람에게 도움이되기를 바랍니다. 궁금한 점이 있으면 메시지를 남겨 주시면 편집자가 제 시간에 모든 사람에게 답장을 드리겠습니다. Wulin.com 웹 사이트를 지원해 주셔서 대단히 감사합니다!