package shop.alien.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import shop.alien.entity.store.StorePersonalCustomized;
import shop.alien.entity.store.vo.StorePersonalCustomizedVo;

/**
 * <p>
 * 个性化定制 Mapper 接口
 * </p>
 *
 * @author ssk
 * @since 2025-03-18
 */
public interface StorePersonalCustomizedMapper extends BaseMapper<StorePersonalCustomized> {

    @Select("select custom.id, custom.coupon_id, coupon.name couponName, coupon.image_path couponImage, coupon.price " +
            "from store_personal_customized custom " +
            "join life_coupon coupon on coupon.id = custom.coupon_id ")
    IPage<StorePersonalCustomizedVo> getPersonalCustomizedList(IPage<StorePersonalCustomized> page, @Param(Constants.WRAPPER) QueryWrapper<StorePersonalCustomized> wrapper);

}
