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.LifeGroupBuyMain;
import shop.alien.entity.store.vo.LifeGroupBuyMainVo;

import java.util.List;


public interface PlatformStoreLifeGroupBuyMainMapper extends BaseMapper<LifeGroupBuyMain> {

    @Select("SELECT\n" +
            "\tlife.id,store.store_name,life.inventory_num,life.group_name,user.phone,life.created_time,life.start_time_type,life.start_time_value,life.end_time,life.status\n" +
            "FROM\n" +
            "\tlife_group_buy_main life\n" +
            "\tJOIN store_info store ON store.id = life.store_id\n" +
            "\tJOIN store_user user ON store.id = user.store_id\n"+
            "${ew.customSqlSegment}")
    IPage<LifeGroupBuyMainVo> getLifeGroupBuyMainList(IPage<LifeGroupBuyMainVo> iPage, @Param(Constants.WRAPPER) QueryWrapper<LifeGroupBuyMainVo> wrapper);

    @Select("SELECT\n" +
            "\tlife.id,store.store_name,life.inventory_num,life.group_name,user.phone,life.created_time,life.start_time_value,life.end_time,life.status\n" +
            "FROM\n" +
            "\tlife_group_buy_main life\n" +
            "\tJOIN store_info store ON store.id = life.store_id\n" +
            "\tJOIN store_user user ON store.id = user.store_id\n"+
            "${ew.customSqlSegment}")
    List<LifeGroupBuyMainVo> getLifeGroupBuyMainListWithoutPage(@Param(Constants.WRAPPER) QueryWrapper<LifeGroupBuyMainVo> wrapper);

}
