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

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.userlevelgrowthvalueconfig.UserLevelGrowthValueConfigDO;
import org.apache.ibatis.annotations.Mapper;
import co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo.*;

/**
 * 会员成长任务配置 Mapper
 *
 * @author admin
 */
@Mapper
public interface UserLevelGrowthValueConfigMapper extends BaseMapperX<UserLevelGrowthValueConfigDO> {

    default PageResult<UserLevelGrowthValueConfigDO> selectPage(UserLevelGrowthValueConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserLevelGrowthValueConfigDO>()
                .eqIfPresent(UserLevelGrowthValueConfigDO::getType, reqVO.getType())
                .likeIfPresent(UserLevelGrowthValueConfigDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(UserLevelGrowthValueConfigDO::getGrowthValue, reqVO.getGrowthValue())
                .betweenIfPresent(UserLevelGrowthValueConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserLevelGrowthValueConfigDO::getId));
    }

    default List<UserLevelGrowthValueConfigDO> selectList(UserLevelGrowthValueConfigExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserLevelGrowthValueConfigDO>()
                .eqIfPresent(UserLevelGrowthValueConfigDO::getType, reqVO.getType())
                .likeIfPresent(UserLevelGrowthValueConfigDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(UserLevelGrowthValueConfigDO::getGrowthValue, reqVO.getGrowthValue())
                .betweenIfPresent(UserLevelGrowthValueConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserLevelGrowthValueConfigDO::getId));
    }

}
