package co.yixiang.yshop.module.member.dal.mysql.usertagref;

import java.util.*;

import co.yixiang.yshop.framework.common.pojo.PageResult;
import co.yixiang.yshop.framework.mybatis.core.query.LambdaQueryWrapperX;
import co.yixiang.yshop.framework.mybatis.core.mapper.BaseMapperX;
import co.yixiang.yshop.module.member.dal.dataobject.usertagref.UserTagRefDO;
import org.apache.ibatis.annotations.Mapper;
import co.yixiang.yshop.module.member.controller.admin.usertagref.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 用户标签中间 Mapper
 *
 * @author admin
 */
@Mapper
public interface UserTagRefMapper extends BaseMapperX<UserTagRefDO> {

    default PageResult<UserTagRefDO> selectPage(UserTagRefPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserTagRefDO>()
                .eqIfPresent(UserTagRefDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserTagRefDO::getTagId, reqVO.getTagId())
                .betweenIfPresent(UserTagRefDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserTagRefDO::getId));
    }

    List<UserTagRefDO> selectList(@Param("param") UserTagRefExportReqVO reqVO);

//    default List<UserTagRefDO> selectList(UserTagRefExportReqVO reqVO) {
//        return selectList(new LambdaQueryWrapperX<UserTagRefDO>()
//                .eqIfPresent(UserTagRefDO::getUserId, reqVO.getUserId())
//                .eqIfPresent(UserTagRefDO::getTagId, reqVO.getTagId())
//                .betweenIfPresent(UserTagRefDO::getCreateTime, reqVO.getCreateTime())
//                .orderByDesc(UserTagRefDO::getId));
//    }

}
