package com.fzm.mall.server.front.goods.mapper;

import com.fzm.mall.server.front.asset.model.UserAsset;
import com.fzm.mall.server.front.goods.model.Auction;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzm.mall.server.front.goods.model.vo.UserAuctionVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商品拍卖 Mapper 接口
 * </p>
 *
 * @author fzm
 * @since 2021-09-02
 */
public interface AuctionMapper extends BaseMapper<Auction> {
    @Select({"<script>","select r.* from goods_auction a inner join order_bidding_record r on a.auction_id=r.auction_id where r.uid = #{uid} and a.status=#{status} "+ "<if test='finalUid != null and finalUid != \"\"'>", "and a.final_uid= #{finalUid}", "</if>"+"  limit #{start},#{size}",
            "</script>"})
    List<UserAuctionVO> getUserAuctionList(@Param("uid") String uid, @Param("status") Integer status,@Param("finalUid") String finalUid,@Param("start") Integer start, @Param("size") Integer size);

}
