package cn.iocoder.yudao.module.iot.dal.mysql.feedback;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.iot.dal.dataobject.feedback.FeedbackDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.iot.controller.admin.feedback.vo.*;

/**
 * 用户反馈 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface FeedbackMapper extends BaseMapperX<FeedbackDO> {

    default PageResult<FeedbackDO> selectPage(FeedbackPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FeedbackDO>()
                .eqIfPresent(FeedbackDO::getTitle, reqVO.getTitle())
                .eqIfPresent(FeedbackDO::getContent, reqVO.getContent())
                .eqIfPresent(FeedbackDO::getTags, reqVO.getTags())
                .eqIfPresent(FeedbackDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(FeedbackDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FeedbackDO::getId));
    }

}