puzhibing
昨天 770c90dd33db8f975db417531686e93e17e5a3a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
}