package shop.alien.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import shop.alien.entity.store.LifeUserExpertWorks;
import shop.alien.entity.store.vo.LifeUserExpertWorksVo;

import java.util.List;

/**
 * <p>
 * 达人作品表 Mapper 接口
 * </p>
 *
 * @author ssk
 * @since 2025-02-19
 */
public interface LifeUserExpertWorksMapper extends BaseMapper<LifeUserExpertWorks> {

    @Select("SELECT works.* , orders.order_money, orders.account_money AS actual_gmv, orders.id " +
            "FROM life_user_expert_works works " +
            "LEFT JOIN life_user_expert_order orders ON works.order_id = orders.order_no " +
            "WHERE orders.store_id = #{storeId}")
    List<LifeUserExpertWorksVo> getExpertOrderByStoreId(@Param("storeId") long storeId);

}
