package com.ruoyi.account.mapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.ruoyi.account.api.model.TAppUserSiteFavorite;
|
import org.apache.ibatis.annotations.Insert;
|
import org.apache.ibatis.annotations.Param;
|
|
import java.math.BigDecimal;
|
|
public interface TAppUserSiteFavoriteMapper extends BaseMapper<TAppUserSiteFavorite> {
|
|
@Insert("INSERT INTO t_app_user_site_favorite " +
|
"(app_user_id, site_id, favorite_price, notify_enabled, create_time, del_flag) " +
|
"VALUES (#{appUserId}, #{siteId}, #{favoritePrice}, #{notifyEnabled}, NOW(), 0) " +
|
"ON DUPLICATE KEY UPDATE favorite_price = VALUES(favorite_price), " +
|
"notify_enabled = VALUES(notify_enabled), last_notified_price = NULL, " +
|
"create_time = NOW(), del_flag = 0")
|
int upsert(@Param("appUserId") Long appUserId,
|
@Param("siteId") Integer siteId,
|
@Param("favoritePrice") BigDecimal favoritePrice,
|
@Param("notifyEnabled") Boolean notifyEnabled);
|
}
|