package com.yc.ship.module.ota.dal.mysql.password;

import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.ota.controller.admin.password.vo.OperatePasswordPageReqVO;
import com.yc.ship.module.ota.dal.dataobject.password.OperatePasswordDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 操作密码 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface OperatePasswordMapper extends BaseMapperX<OperatePasswordDO> {

    default PageResult<OperatePasswordDO> selectPage(OperatePasswordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OperatePasswordDO>()
                .eqIfPresent(OperatePasswordDO::getUserId, reqVO.getUserId())
                .eqIfPresent(OperatePasswordDO::getType, reqVO.getType())
                .eqIfPresent(OperatePasswordDO::getPassword, reqVO.getPassword())
                .eqIfPresent(OperatePasswordDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(OperatePasswordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OperatePasswordDO::getId));
    }

}