抢购货品同步
This commit is contained in:
33
src/main/resources/mapper/LbGoodsMapper.xml
Normal file
33
src/main/resources/mapper/LbGoodsMapper.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rj.mapper.LbGoodsMapper">
|
||||
|
||||
<insert id="upsertBatch">
|
||||
INSERT INTO lb_goods (
|
||||
id, tenant_id, old_id, user_id, title, image, price, total_money,
|
||||
quantity, seller_id, is_show, status, created_at, updated_at
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.tenantId}, #{item.oldId}, #{item.userId}, #{item.title},
|
||||
#{item.image}, #{item.price}, #{item.totalMoney}, #{item.quantity},
|
||||
#{item.sellerId}, #{item.isShow}, #{item.status}, #{item.createdAt}, #{item.updatedAt}
|
||||
)
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
tenant_id = VALUES(tenant_id),
|
||||
old_id = VALUES(old_id),
|
||||
user_id = VALUES(user_id),
|
||||
title = VALUES(title),
|
||||
image = VALUES(image),
|
||||
price = VALUES(price),
|
||||
total_money = VALUES(total_money),
|
||||
quantity = VALUES(quantity),
|
||||
seller_id = VALUES(seller_id),
|
||||
is_show = VALUES(is_show),
|
||||
status = VALUES(status),
|
||||
created_at = VALUES(created_at),
|
||||
updated_at = VALUES(updated_at)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user