标签:ignore value each city basis ble cno mode mit
有多种方式
其中效率高 要求低的方式 是 把sql拼接出来 后一次性commit;
eg:
public int insertBatch(List<PeccDetailModel> list) {
return super.insert("com.hshc.web.pec.dao.PeccDetailDao.insertBatch",list);
}
<insert id="insertBatch">
insert ignore into table_
(
id, pecc_id,
pecc_no,
plate_no,
infomation_code,
pecc_time,
pecc_addr,
pecc_reason,
pecc_amount,
status,
department,
pecc_score,
pecc_code,
violation_code,
archive_no,
phone,
excute_location,
excute_department,
category, late_fees,
basis_punishment,
illegal_entry,
location_id,
pecc_location_code,
location_name,
source_id,
record_type,
handle_time,
parties, version,
create_emp,
create_emp_id,
create_time,
modify_emp_id,
modify_emp,
modify_time,
vin_no,
engine_no,
city_id
)
values
<foreach collection="list" separator="," item="item">
(
#{item.id},
#{item.peccId},
#{item.peccNo},
#{item.plateNo},
#{item.infomationCode},
#{item.peccTime},
#{item.peccAddr},
#{item.peccReason},
#{item.peccAmount},
#{item.status},
#{item.department},
#{item.peccScore},
#{item.peccCode},
#{item.violationCode},
#{item.archiveNo},
#{item.phone},
#{item.excuteLocation},
#{item.excuteDepartment},
#{item.category},
#{item.lateFees},
#{item.basisPunishment},
#{item.illegalEntry},
#{item.locationId},
#{item.peccLocationCode},
#{item.locationName},
#{item.sourceId},
#{item.recordType},
#{item.handleTime},
#{item.parties},
#{item.version},
#{item.createEmp},
#{item.createEmpId},
#{item.createTime},
#{item.modifyEmpId},
#{item.modifyEmp},
#{item.modifyTime},
#{item.vinNo},
#{item.engineNo},
#{item.cityId}
)
</foreach>
</insert>
标签:ignore value each city basis ble cno mode mit
原文地址:https://www.cnblogs.com/beixiaoyi/p/9909244.html