package cn.iocoder.yudao.module.system.dal.mysql.attendance.addressgroup;

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.addressgroup.vo.AttendanceAddressGroupItemPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.addressgroup.AttendanceAddressGroupItemDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 考勤地址组子表 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface AttendanceAddressGroupItemMapper extends BaseMapperX<AttendanceAddressGroupItemDO> {

    default PageResult<AttendanceAddressGroupItemDO> selectPage(AttendanceAddressGroupItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AttendanceAddressGroupItemDO>()
                .eqIfPresent(AttendanceAddressGroupItemDO::getAddressGroupId, reqVO.getAddressGroupId())
                .eqIfPresent(AttendanceAddressGroupItemDO::getLongitude, reqVO.getLongitude())
                .eqIfPresent(AttendanceAddressGroupItemDO::getLatitude, reqVO.getLatitude())
                .eqIfPresent(AttendanceAddressGroupItemDO::getScope, reqVO.getScope())
                .eqIfPresent(AttendanceAddressGroupItemDO::getAddress, reqVO.getAddress())
                .betweenIfPresent(AttendanceAddressGroupItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AttendanceAddressGroupItemDO::getId));
    }

}
