package cn.iocoder.yudao.module.system.dal.mysql.devicemoney;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo.DeviceMoneyPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.devicemoney.DeviceMoneyDO;
import org.apache.ibatis.annotations.Mapper;
/**
 * 门店设备日流水 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface DeviceMoneyMapper extends BaseMapperX<DeviceMoneyDO> {

    default PageResult<DeviceMoneyDO> selectPage(DeviceMoneyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceMoneyDO>()
                .eqIfPresent(DeviceMoneyDO::getDeviceIp, reqVO.getDeviceIp())
                .likeIfPresent(DeviceMoneyDO::getDeviceName, reqVO.getDeviceName())
                .eqIfPresent(DeviceMoneyDO::getDeviceSn, reqVO.getDeviceSn())
                .eqIfPresent(DeviceMoneyDO::getCarteenId, reqVO.getCarteenId())
                .eqIfPresent(DeviceMoneyDO::getMoney, reqVO.getMoney())
                .eqIfPresent(DeviceMoneyDO::getTimePeriod, reqVO.getTimePeriod())
                .eqIfPresent(DeviceMoneyDO::getDishesIds, reqVO.getDishesIds())
                .betweenIfPresent(DeviceMoneyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceMoneyDO::getId));
    }

}