# BadGuestQuery.java

    package cloud.wconnect.frontoffice.pojo.query.badguest;

    import lombok.Data;
    import org.apache.commons.lang3.StringUtils;
    import org.hibernate.validator.constraints.Range;

    import jakarta.validation.constraints.NotNull;
    import java.util.List;

    /**
     * Query类：黑名单查询
     * @author yyt
     * 2021/5/13
     */
    @Data
    public class BadGuestQuery {

        private String lastName;

        private String firstName;

        @NotNull(message = "the page must not be null")
        private Integer page;

        @NotNull(message = "the size must not be null")
        private Integer size;

        /**
         * 入住日期范围
         */
        private Long startCheckInDate;
        private Long endCheckInDate;
        /**
         * 离开日期范围
         */
        private Long startCheckOutDate;
        private Long endCheckOutDate;

        /**
         * 排序字段 详见：OrderByFieldEnum
         * 默认根据id排序
         */
        private String orderBy;

        /**
         * 排序方式 是否正序，默认是false
         */
        private Boolean isAsc;

        private List<Integer> statusList;

        /**
         * Reservation #
         */
        private String folioNumber;
        /**
         * 电话
         */
        private String phone;
        /**
         * 住址
         */
        private String address;
        /**
         * 会员卡号
         */
        private String memberCardNum;
        /**
         * 邮箱
         */
        private String email;

        /**
         * 查询的资产ID集合
         */
        private List<Integer> queryPropertyIds;

        /**
         * 创建人ID
         */
        private Integer createdBy;

        /**
         * 黑名单类型1-住房客人 2-会议/宴会房间
         */
        @Range(min = 1, max = 2,message = "The type must between in [1:Guest check-in 2:Meeting/Banquet Rooms]")
        private Integer type;

        /**
         * 是否查询同伴信息
         *
         * @return boolean
         * @author lichen
         * @date 2024/4/22
         */
        public boolean isQueryCompanion(){
            if (StringUtils.isNotBlank(this.firstName)) return true;

            if (StringUtils.isNotBlank(this.lastName)) return true;

            if (StringUtils.isNotBlank(this.phone)) return true;

            if (StringUtils.isNotBlank(this.address)) return true;

            if (StringUtils.isNotBlank(this.memberCardNum)) return true;

            if (StringUtils.isNotBlank(this.email)) return true;

            return false;
        }

    }