a.id AS "id",
a.userId AS "userId",
a.productId AS "productId",
a.shopId AS "shopId",
a.shopName AS "shopName",
a.taxRate AS "taxRate",
a.currentPrice AS "currentPrice",
a.createTime AS "createTime"
left join product as b on a.productId = b.productID
left join user as c on a.userId = c.userId
INNER JOIN repeat_purchase_price AS b ON a.`userId` = b.`userId` AND a.`productId` = b.`productId`
INSERT INTO repeat_purchase_price(
id,
userId,
productId,
shopId,
shopName,
taxRate,
currentPrice,
createTime,
orderId,
clubId
) VALUES (
#{id},
#{userId},
#{productId},
#{shopId},
#{shopName},
#{taxRate},
#{currentPrice},
#{createTime},
#{orderId},
#{clubId}
)
UPDATE repeat_purchase_price SET
userId = #{userId},
productId = #{productId},
shopId = #{shopId},
shopName = #{shopName},
taxRate = #{taxRate},
currentPrice = #{currentPrice},
createTime = #{createTime}
WHERE id = #{id}
UPDATE repeat_purchase_price SET
delFlag = #{delFlag}
WHERE id = #{id}