บทความนี้ส่วนใหญ่แนะนำวิธีการบันทึกข้อมูลเอนทิตี เนื้อหาเฉพาะมีดังนี้
1. ตัวอย่าง XML
<? xml เวอร์ชัน = "1.0" การเข้ารหัส = "gbk"?> <!-1..1-> <cisreports batno = "หมายเลขแบทช์แบบสอบถาม" unitname = "ชื่อหน่วยการสืบค้น" suborgan = "ชื่อสาขา" queryuserid = "querytime HH24: MM: SS "> <!-ต่อไปนี้เป็นผลลัพธ์การสืบค้นสำหรับแอปพลิเคชันแบบสอบถามแต่ละครั้ง 1..N-> <CISREPORT ReportID =" หมายเลขรายงาน "BuildEndTime =" การสร้างรายงานเวลาสิ้นสุดรูปแบบ yyyy-mm-dd HH24: mm: ss "ss" queryReasonid = ID SubReport ถูกคั่นด้วย commas "การรักษา Result =" การนับค่าธรรมเนียมขนาดกะทัดรัดเวลาของค่าธรรมเนียม subreport ซึ่งสอดคล้องกับ subreportTypes เป็นชุดของค่าที่มากกว่าหรือเท่ากับ 0, คั่นด้วย commas "idedystion" ide Id " จริง: มีข้อผิดพลาด, เท็จ: ไม่มีข้อผิดพลาด "isfrozen =" ไม่ว่าลูกค้าจะถูกแช่แข็งจริงจริง: แช่แข็ง, เท็จ: ไม่แช่แข็ง "> <!-1 ข้อมูลเงื่อนไข 1..1-> <queryConditions> <!-1..N-> <ition> <name> </queryConditions> <!-2Identity Authentication1..1-> <PolicecheckInfo subreportType = "10602" subreportTypecost = "96040" การรักษา = "สถานะการสืบค้น subreport พจนานุกรมเมื่อ treatresult! = 3, คุณสมบัตินี้ไม่มีอยู่ "errorMessage =" ข้อผิดพลาดคำอธิบายข้อมูลเมื่อ treatresult = 3, เมื่อ treatresult! = 3 ค่าของคุณสมบัตินี้ว่างเปล่า "> <ite> <name> ชื่อของ queryee </name> ผลลัพธ์, 1, สม่ำเสมอ 2, ไม่สอดคล้องกัน </result> </itect> </policecheckInfo> <!-3 คนการตรวจสอบหมายเลขโทรศัพท์มือถือ 1..1-> <mobileCheckInfo subreportType = "13612" subreportTypecost = "96040" การรักษา code = "treatresult = 3 ดูพจนานุกรมข้อมูลสำหรับรายละเอียดเมื่อ treatresult! = 3 แอตทริบิวต์ไม่มีอยู่" errorMessage = "คำอธิบายข้อผิดพลาดข้อมูลเมื่อ treatresult = 3 เมื่อ treatresult! = 3 ค่าของแอตทริบิวต์นี้ว่างเปล่า"> <! --- treatresult คือ 2 และ 3 ไม่มีโหนดต่อไปนี้-> <item> ผลลัพธ์รวมถึง: สอดคล้องกันไม่สอดคล้องกันและไม่สอดคล้องกัน </documentNocheckResult> <phoneCheckResult> ผลการตรวจสอบหมายเลขมือถือ: ผลการตรวจสอบหมายเลขโทรศัพท์มือถือ: ไม่สามารถตรวจสอบได้ </PhoneCheckResult> <!-สรุปความเสี่ยงต่อการทุจริตส่วนบุคคล 4 ความเสี่ยง 1..1-> <personantispoofingdescinfo subreportType = "14225" subreportTypecost = "96040" การรักษา = "สถานะการสืบค้น subreport Treatsult! = 3 แอตทริบิวต์ไม่มีอยู่ ในตัวอย่างต่อไปนี้อาจว่างเปล่าและอาจมี 0 หรือ N ของพวกเขาซึ่งสามารถส่งคืนได้ตามผลลัพธ์ที่เฉพาะเจาะจง 1. คะแนนความเสี่ยงต่อต้านการฉ้อโกงคือ 100 คะแนนระดับความเสี่ยงสูงและขอแนะนำให้ปฏิเสธ 2. หมายเลขโทรศัพท์มือถือโทรคมนาคม 131 **** 1542 ถูกใช้น้อยกว่า 1 เดือน 3. เข้าสู่รายชื่อฝ่ายขนสัตว์ 4. รายการความเสี่ยงต่อการฉ้อโกง 5. รายชื่อบุคลากรที่มีความเสี่ยงสูง 6. มีบันทึกเครดิตเกินกำหนด 7 รายการ 7. มีข้อมูลสรุปความเสี่ยงส่วนบุคคล 40 รายการ 8. ในช่วงสองปีที่ผ่านมาข้อมูลส่วนบุคคลของฉันได้รับการสอบถาม 23 ครั้ง -> <personantispoofingdesc> ข้อมูลการทบทวนการต่อต้านการทุจริตส่วนบุคคล </personantispoofingdesc> </personantispoofingdesc> <!-5 ข้อมูลความเสี่ยงต่อการต่อต้านการทุจริตส่วนบุคคล 1..1-> <personantispoofinginfo subreporttype = "14224 ตรวจสอบ, 3: ไม่ได้ตรวจสอบด้วยเหตุผลอื่น ๆ "รหัสข้อผิดพลาดเมื่อ treaterrorCode =" treatresult = 3, ดูพจนานุกรมข้อมูลสำหรับรายละเอียด errorMessage = "ข้อผิดพลาดข้อมูลคำอธิบายเมื่อ treatresult = 3 เมื่อ treatresult! = 3 ค่าของคุณสมบัตินี้ว่างเปล่า"> - - 6 ข้อมูลสถานะหมายเลขโทรศัพท์มือถือ 1..1 -> <mobilestatusInfo subreportType = "13611" subreportTypecost = "96040" การรักษา = "สถานะการสืบค้น subreport, 1: ค้นหา, 2: ไม่พบ, 3: ไม่พบเหตุผลอื่น" errorMessage = "คำอธิบายข้อผิดพลาดข้อมูลเมื่อ treatresult = 3, เมื่อ treatresult! = 3 ค่าของแอตทริบิวต์นี้ว่างเปล่า"> <!-เมื่อ treatretresult คือ 2 หรือ 3 ไม่มีโหนดต่อไปนี้-> <itect> 1: การใช้งานปกติ 2: การปิดเครื่อง 3: ไม่ได้เปิดใช้งาน 4: หมายเลขยกเลิก 5-Other 6: Cancellation ก่อน </phonestatus> <Timelength> หมายเลขโทรศัพท์มือถือบนอินเทอร์เน็ตเช่น: เวลาบนอินเทอร์เน็ตน้อยกว่า 1 เดือน 1-2 เดือน, 3-6 เดือน, 7-12 เดือน รายการของฝ่ายขนสัตว์ 1..1-> <econnoisserurinfo subreportType = "14228" subreportTypecost = "96040" การรักษา Result = "สถานะการสืบค้น subreport, 1: ค้นหา 2: ไม่พบ 3: ไม่พบเหตุผลอื่น ๆ เมื่อ treatresult! = 3 แอตทริบิวต์ไม่มี "errorMessage =" คำอธิบายข้อผิดพลาดข้อมูลเมื่อ treatresult = 3 เมื่อ treatresult! = 3 ค่าของแอตทริบิวต์นี้ว่างเปล่า "> <! -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- subreportTypecost = "96040" การรักษา Result = "สถานะการสืบค้นย่อยย่อย, 1: ค้นหา, 2: ไม่พบ, 3: ไม่พบเหตุผลอื่น" "treaterrorCode =" รหัสข้อผิดพลาด 3 ข้อมูลที่เกิดขึ้น ค่าของคุณสมบัตินี้ว่างเปล่า "> <!-เมื่อ treatreatresult คือ 2 หรือ 3 ไม่มีโหนดต่อไปนี้-> <state> ไม่ว่าจะตีรายการความเสี่ยงการฉ้อโกงค่า: 0/1, 0 หมายถึงรายการเสี่ยงการฉ้อโกง 1 หมายถึงรายการความเสี่ยงจากการฉ้อโกง subreportTypecost = "96040" การรักษา Result = "สถานะการสืบค้นย่อยย่อย, 1: ค้นหา, 2: ไม่ได้ตรวจสอบ, 3: ไม่พบเหตุผลอื่น" "treaterrorCode =" treatresult = 3, ดูข้อมูล ค่าของแอตทริบิวต์นี้ว่างเปล่า "> <!-เมื่อ treatreatresult คือ 2 หรือ 3 ไม่มีโหนดต่อไปนี้-> <heckResult> ไม่ว่าจะตีรายการที่มีความเสี่ยงสูง 1: ใช่ 2: ไม่ </extresult> </personRiskassess> <! SubreportTypecost = "96040" การรักษา Result = "สถานะการสืบค้นย่อย subreport, 1: ค้นหา, 2: ไม่พบ, 3: ไม่พบด้วยเหตุผลอื่น" รหัสข้อผิดพลาดเมื่อ treaterrorCode = "treatresult = 3, ดูข้อมูลพจนานุกรมข้อมูลสำหรับรายละเอียด เมื่อ treatresult! = 3 แอตทริบิวต์ไม่มีอยู่ "errormessage =" ข้อผิดพลาดคำอธิบายข้อมูลเมื่อ treatresult = 3, เมื่อ treatresult! = 3 ค่าของแอตทริบิวต์นี้ว่างเปล่า "> <! ข้อมูลพื้นฐานของเงินกู้ </doverdueamount> <ส่วนเกินวัน> ช่วงเวลาวันที่เกินกำหนดช่วงค่า: overdue หนึ่งวัน (รวม) หรือมากกว่า </overduedays> <OverdueCount> จำนวนการทำธุรกรรมทั้งหมดในจำนวนวันที่เกินกว่า> <overdueamount> เงินต้นที่เกินกำหนดหน่วย: ขึ้นอยู่กับสกุลเงินของข้อมูลพื้นฐานของเงินกู้ </overdueamount> <Onduedays> ช่วงเวลาวันที่เกินกำหนดช่วงค่า: 1-6 วันเกินกำหนด 7-29 วันเกินกว่าที่เกินกว่า 30-59 วัน ช่วงเวลาวันที่เกินกำหนด </overduecount> </itect> </itect> </micronearlythreeersoverdueInfo> <!-11 ข้อมูลความเสี่ยง 1..1-> <personriskinfo subreporttype = "14227" subreporttypecost = "96040" เหตุผล "รหัสข้อผิดพลาดเมื่อ treaterRorCode =" treatresult = 3 ดูพจนานุกรมข้อมูลสำหรับรายละเอียด เมื่อ treatresult! = 3 แอตทริบิวต์ไม่มีอยู่ "errorMessage =" treatresult = 3 ข้อมูลคำอธิบายข้อผิดพลาดข้อมูลเมื่อ treatresult! = 3 ค่าของแอตทริบิวต์นี้ว่างเปล่า "> - <cqggcount> จำนวนข้อมูลเกี่ยวกับการประกาศการจ้างงาน </cqggcount> <wdyqcount> จำนวนข้อมูลเกี่ยวกับเงินกู้ออนไลน์ที่เกินกำหนด </wdyqcount> </stat> <!-ข้อมูลสรุปสิ้นสุด-> <!-ข้อมูลสรุป 0..1-> <! -> <itect> <recordid> หมายเลขบันทึก </recordId> <bt> ชื่อเรื่อง </bt> <ajlx> ประเภทกรณี </ajlx> <SJNF> ปีแห่งการตรวจสอบรูปแบบ: yyyy </sjnf> <Dsrlx> ประเภทของงานปาร์ตี้ </dsrlx> ข้อมูลสรุปของข้อมูลการบังคับใช้ตุลาการ 1..N-> <itect> <recordID> หมายเลขบันทึก </recordId> <bt> ชื่อเรื่อง </bt> <zxbd> วัตถุดำเนินการหน่วย: สกุลเงินจะเหนือกว่า </zxbd> <SxS> <!-ข้อมูลสรุปการละเมิดข้อมูลความน่าเชื่อถือ 1..N-> <itect> <recordID> หมายเลขบันทึก </recordID> <bt> ชื่อเรื่อง </bt> <larq> วันที่ยื่นวันที่ yyyy-mm-dd </larq> <fbrq> วันที่วางจำหน่าย 0..1-> <sws> <!-ข้อมูลการบังคับใช้กฎหมายการบริหารภาษีข้อมูลสรุปเนื้อหาข้อมูล 1..n-> <ite> <creamid> หมายเลขบันทึก </recordid> <bt> ชื่อเรื่อง </bt> <ggrq> วันที่ประกาศการจัดรูปแบบ yyyy-mm-dd </ggrq> </item> </ws> ข้อมูลสรุปข้อมูลเนื้อหา 1..N-> <ite> <creamid> หมายเลขบันทึก </recordId> <bt> title </bt> <fbrq> วันที่วางจำหน่ายรูปแบบ yyyy-mm-dd </fbrq> </item> </cqs> <! <recordId> หมายเลขบันทึก </recordId> <bt> ชื่อเรื่อง </bt> <fbrq> วันที่วางจำหน่ายรูปแบบ yyyy-mm-dd </fbrq> </itect> </wdyqs> </summary> </personriskinfo> <! SubreportTypecost = "96040" การรักษา Result = "สถานะการสืบค้น subreport, 1: ตรวจสอบ, 2: ไม่พบ, 3: ไม่พบด้วยเหตุผลอื่น ๆ " "รหัสข้อผิดพลาด =" treatresult = 3, ดูพจนานุกรมข้อมูล ว่างเปล่า "> <! --- เมื่อ treatreatresult คือ 2 และ 3 ไม่มีโหนดต่อไปนี้-> <!-0..1-> <รายการ> <!-1..N-> <iteMember> <last6month> จำนวนบันทึกการสืบค้นในช่วง 6 เดือนที่ผ่านมา </nate6month> <nast12month> จำนวนบันทึกการสืบค้นในช่วง 12 เดือนที่ผ่านมา </last12month> <nast18month> จำนวนบันทึกการสืบค้นในช่วง 18 เดือนที่ผ่านมา <count> <count1month> จำนวนบันทึกการสืบค้นทั้งหมดใน 1 เดือนที่ผ่านมา </last1month> <stamenmonth> จำนวนบันทึกการสืบค้นทั้งหมดในช่วง 3 เดือนที่ผ่านมา </nate3month> <nast6month> จำนวนการสืบค้นทั้งหมดในช่วง 6 เดือนที่ผ่านมา </last6month> บันทึกของแต่ละหน่วยประเภทในช่วง 18 เดือนที่ผ่านมา </nate18month> <nast24month> จำนวนบันทึกการสืบค้นทั้งหมดของแต่ละหน่วยในช่วง 24 เดือนที่ผ่านมา </ast24month> </count>
2. การออกแบบโครงสร้างตาราง
1. หมายเลขแบทช์: แต่ละตารางเชื่อมโยงกับหมายเลขแบทช์ด้านนอกสุด
2. ตารางหลัก: นั่นคือฟิลด์ทั้งหมดของแต่ละชั้นจะถูกเก็บไว้ในตารางเดียว
สามการออกแบบทางกายภาพ
มันแบ่งออกเป็นสามชั้น: Cisreportroot, Cisreportchild, Reportelement
คลาสสาธารณะ Cisreportroot ขยาย Basepojo ใช้ serializable {private string docid; สตริงส่วนตัว batno; // หมายเลขแบทช์แบบสอบถาม @JSONFIELD (serialize = false) สตริงส่วนตัว xmlid; Cisreportchild ส่วนตัว Cisreportchild;/*** 2017/7/21 *รายงานคุณสมบัติโหนดและโหนดเด็ก*/คลาสสาธารณะ Cisreportchild ขยาย basepojo {/***การสร้างรายงานสิ้นสุดเวลาสิ้นสุด **/สตริงส่วนตัว buildendtime; / ***มีข้อผิดพลาดของระบบจริงหรือไม่ว่ามีเท็จซึ่งหมายความว่าไม่มี **/ สตริงส่วนตัว HassystemError; / ***ลูกค้าถูกแช่แข็ง **/ สตริงส่วนตัว isfrozen; Private Reportelement Reportelement Public Class Reportelement ขยาย basepojo {โทรศัพท์สตริงส่วนตัว; Private PolicecheckInfo PolicecheckInfo; // การรับรองความถูกต้องประจำตัว MobileCheckInfo MobileCheckInfo; // บุคคลหมายเลขโทรศัพท์มือถือการตรวจสอบบุคคลส่วนตัวบุคคลส่วนตัว mobilestatusinfo; // สถานะโทรศัพท์มือถือข้อมูลสถานะส่วนตัว econnoisserurinfo econnoisserurinfo; // ตีรายการปาร์ตี้ขนสัตว์ปาร์ตี้ส่วนตัว fraudriskinfo fraudriskinfo; // ได้รับความเสี่ยงจากการฉ้อโกง MICRONEARLYTHREEYEARSOVERDUEINFO; // เงินกู้ออนไลน์เกินกำหนดข้อมูลบุคคลส่วนตัวบุคคลบุคคลบุคคลที่มีความเสี่ยง; // ข้อมูลความเสี่ยงข้อมูลประวัติศาสตร์ส่วนตัวสี่รหัส
<1> ธุรกรรมเดี่ยวไม่จำเป็นต้องใช้คีย์หลักในแบทช์
ข้อมูลสามารถเก็บไว้ในแผนที่ในธุรกรรมเดียวหรือแบทช์และข้อมูลสามารถรับได้ผ่านปุ่มแผนที่ใน SQL
ชอบ:
โมฆะส่วนตัว savepersonriskinfo (สตริง batno, personriskinfo personriskinfo) โยนข้อยกเว้น {แผนที่ <สตริง, วัตถุ> แผนที่ = ใหม่ hashmap <> (); map.put ("batno", batno); // map.put.put ("item", personriskinfo); pymapper.savepersonriskinfo (แผนที่); if (! liStutil.isempty (personriskinfo.getallist ())) {// batch map.put ("รายการ", personriskinfo.getallist ()); pymapper.savealinfolist (แผนที่); -SQL:
<!-บันทึกความเสี่ยงส่วนบุคคล-> // single <insert id = "savePersonRiskinfo" parameterType = "java.util.map"> แทรกลงใน table_person_risk_info (batno, totlecount, alcount, zxcount, sxcount, swcount, cqggcount ( #{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> <!-บันทึกรายละเอียดของ overdue-> // batch <insert id = "savemicronearlythreeyearsoverdueinfolist" parameterType = "java.util.map"> แทรกลงใน table_mntyoi (batno #{batno, jdbctype = varchar}, #{item.overdueamount, jdbctype = varchar}, #{item.overduedays, jdbctype = varchar}, #{item.overduecount, jdbctype = numeric} Invokepy (PyQueryBean PyQueryBean) โยนข้อยกเว้น {PyQueryBean.setQueryFrompy (query_from_py); // โทร py service cisreportroot cisreportroot = queryCisReportFrompyServer (PyQueryBean); Cisreportroot.getCisreportChild (). getReportElement (). setphone (pyquerybean.getphone ()); //cacheservice.save(cisreportroot); // (1) บันทึกข้อมูล SaveCisReport (CISREPORTROOT); กลับ Cisreportroot; -(1) บันทึกข้อมูล
@Transactional (rollbackfor = exception.class) @Override สาธารณะ cisreportroot saveCisreport (cisreportroot cisreportroot) โยนข้อยกเว้น {ลอง {รายงานการรายงานการเลือกตั้ง = cisreportroot.getCisReportChild () personriskinfo personriskinfo = prolementelement.getPersonRiskinfo (); // (2) ตารางหลักบันทึกข้อมูลโหนดทั้งหมดของ XML (ไม่รวมข้อมูลความเสี่ยงส่วนบุคคล), บันทึกข้อมูลเดียว pymapper.savecisreport (Cisreportroot); if (success.equals (cisreportroot.getcisreportchild (). getReportelement (). getPersonRiskinfo (). getTreatResult ())) {SavePersonRiskinfo (cisreportroot.getBatno () } if (cisreportroot.getcisreportchild (). getReportelement (). gethistorysimpleQueryInfo (). getTreatResult (). เท่ากับ (ความสำเร็จ)) {แผนที่ <สตริง, วัตถุ> แผนที่ = ใหม่ hashmap <> (); // (3) บันทึกแบตช์ข้อมูลแผนที่ ("batno", cisreportroot.getBatno ()); if (! liStutil.isempty (cisreportroot.getcisreportchild (). getReportelement (). gethistorysimpleQueryInfo (). getItemList ()) {map.put ("รายการ" cisreportroot.getCisreportchild (). getReportelement (). gethistorysimpleQueryInfo (). getItemList ()); pymapper.savehistorysimpleQueryInfolist (แผนที่); } if (! liStUtil.isEmpty (cisreportroot.getCisreportChild (). getReportElement (). getMICRONEARLYTHREEYEARDUEINFO (). getList ())) {map.put ("รายการ" cisreportroot.getcisreportchild (). getReportelement (). getmicronearlythreeyearsoverdueinfo (). getList ()); pymapper.savemicronearlythreeyearsoverdueinfolist (แผนที่); }} ส่งคืน cisreportroot; } catch (exception 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_DOCUMNANO, PCI_NAME, PCI_RESULT, PASDI_DESC pasi_hittypes, pasi_risklevel, pasi_riskscore, pasi_risksuggest, ms_areainfo, ms_canceltime, ms_operator, ms_phonestatus, ms_timelength, econnoisserur, fraudrisk, pra_checkres mntyoi_overdueamount, mntyoi_overduecount, mntyoi_overduecount, mntyoi_overduedays, hs_last1month, hs_last3month, hs_last6month, hs_last12month, hs_last18mmonth (#{batno, jdbctype = varchar}, to_date (#{cisreportchild.buildendtime}, 'yyyy-mm-dd hh24: mi: ss'),#{cisreportchild.isfroen, jdbctype = varchar #{cisreportchild.reportelement.mobilecheckinfo.nameCheckResult, jdbcType = varchar}, #{cisreportchild.reportelement.mobilecheckinfo.areinfo, jdbctype = varchar} #{cisreportchild.reportelement.mobilecheckinfo.documentNocheckResult, jdbctype = varchar}, #{cisreportchild.reportelement.mobilecheckinfo.operator, jdbctype = numeric} #{cisreportchild.reportelement.mobileCheckInfo.phoneCheckResult, jdbcType = varchar}, #{cisreportchild.reportelement.polecheckinfo.documentno, jdbctype = varchar} #{cisreportchild.reportelement.piolateCheckInfo.result, jdbctype = numeric}, #{cisreportchild.reportelement.personantispoofingdescinfo #{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.mobilestataSinfo.canceltime, jdbctype = varchar} #{cisreportchild.reportelement.mobilestatusinfo.operator, jdbctype = numeric}, #{cisreportchild.reportelement.mobilestataSinfo.phonestatus, jdbctype = numeric} #{cisreportchild.reportelement.mobilestatusinfo.timelength, jdbctype = varchar}, #{cisreportchild.reportelement.econnoisserurinfo.state, jdbctype = ตัวเลข} #{cisreportchild.reportelement.fraudriskinfo.state, jdbctype = numeric}, #{cisreportchild.reportelement.personriskassess.checkresult, jdbctype = ตัวเลข} #{cisreportchild.reportelement.micronearlythreeersoverdueinfo.overdueamount, jdbctype = varchar}, #{cisreportchild.reportelement.micronearlythreeeardueverdueinfo.overduecount #{cisreportchild.reportelement.micronearlythreeersoverdueinfo.overduedays, jdbctype = varchar}, #{cisreportchild.reportelement.historysimpleQueryinfo.totalcount.last1month #{cisreportchild.reportelement.HistorySimpleQueryInfo.totalcount.last3month, jdbctype = ตัวเลข}, #{cisreportchild.reportelement.HistorySimpleQueryInfo.Totalcount.last6month #{cisreportchild.reportelement.HistorySimpleQueryInfo.totalcount.last12month, jdbctype = ตัวเลข}, #{cisreportchild.reportelement.HistorySimpleQueryInfo.totalcount #{cisreportchild.reportelement.historysimpleQueryinfo.totalcount.last24month, jdbctype = ตัวเลข}, #{cisreportchild.reportelement.phone, jdbctype = varchar}, #{xmlid(3) บันทึกข้อมูลแบตช์ (ไม่มีการสร้างคีย์หลักโดยอัตโนมัติ)
<!-บันทึกการสืบค้นประวัติศาสตร์ส่วนบุคคลสำหรับสองปีที่ผ่านมา-> <insert id = "saveHistorySimpleQueryInfolist" parameterType = "java.util.map"> แทรกลงใน table_history_simple_query (batno, unot_member, last1month, last3month item = "item" separator = "Union All"> (เลือก #{batno, jdbctype = varchar}, #{item.unitmember, jdbctype = varchar}, #{item.last1month, jdbctype = numeric}, # #{item.last6month, jdbctype = numeric}, #{item.last12month, jdbctype = numeric}, #{item.last18month, jdbctype = numeric}, #ime.last24month, jdbctype = numeric} <2> จังหวะเดี่ยวต้องใส่ชุดเข้าไปในคีย์หลัก
จังหวะเดียวมีคีย์หลัก
DataServiceDetailResult DataServiceDetailResult = tdService.getDataserviceDetailResult (tDrepOrtroot); int n = tddataservicemapper.insertDataserviceDetailResult (DataServiceDetailResult); <!-อินเทอร์เฟซการตรวจสอบข้อมูล-> <!-DataService-> <insert id = "InsertDataServiceDetailResult" parameterType = "DataServiceDetailResult"> <selectKey keyProperty = "id" resultType = "bigDecimal" order = "ก่อน" ics_td_dataservice (id, recordid, reason_desc, reason_code, ความสำเร็จ) ค่า ( #{id, jdbctype = ทศนิยม}, #{recordid, jdbctype = ทศนิยม}, #{reasondesc, jdbctype = varchar} #{ความสำเร็จ jdbcType = ทศนิยม}) </insert>Batch Save มีคีย์หลัก
if (! liStUtil.isEmpty (InterfacesList)) {map.put ("recordId", id); map.put ("list", interfaceslist); TDDATASERVICEMAPPER.ADDBATCHINTERFACES (MAP); -SQL:
<!-แบทช์บันทึกอินเทอร์เฟซ-> <แทรก id = "addBatchInterfaces" พารามิเตอร์ = "java.util.list"> <!-ความคิดเห็นคือวิธีการแทรก MySQL สามารถแทรกได้ แต่ข้อมูลไม่สามารถย้อนกลับได้ ต่อไปนี้เป็นวิธีการแทรกของ Oracle: โปรดทราบว่าพารามิเตอร์ Type: java.util.list หรือ java.util.map สามารถเริ่มต้นได้ <foreach collection = "item" item = "item" index = "index" ตัวคั่น = ""> แทรกลงใน ics_td_interfaces #{recordid, jdbcType = ทศนิยม}, #{item.type, jdbcType = varchar}); </foreach> commit; end;-> แทรกลงใน ics_td_interfaces (id, recordid, type) เลือก seq_ics_td_interfaces.nextval id, A.* จาก (<foreach collection = "item" item = "item" index = "index" ตัวคั่น = </foreach>) A </insert>สรุป
ข้างต้นเป็นวิธีการบันทึกข้อมูลทางกายภาพในชุดเดียวโดยตัวแก้ไข ฉันหวังว่ามันจะเป็นประโยชน์กับทุกคน หากคุณมีคำถามใด ๆ โปรดฝากข้อความถึงฉันและบรรณาธิการจะตอบกลับทุกคนในเวลา ขอบคุณมากสำหรับการสนับสนุนเว็บไซต์ Wulin.com!