# LatestRate.java

    package cloud.wconnect.rateshop.entity.rateshop;

    import java.math.BigDecimal;
    import java.io.Serializable;
    import java.util.List;

    import com.google.common.collect.Lists;
    import lombok.Data;
    import lombok.EqualsAndHashCode;
    import lombok.experimental.Accessors;
    import org.apache.commons.lang3.StringUtils;

    /**
     * <p>
     * 房价 实体类
     * </p>
     *
     * @author lichen
     * @since 2023-06-06
     */
    @Data
    @EqualsAndHashCode(callSuper = false)
    @Accessors(chain = true)
    public class LatestRate implements Serializable {

        private static final long serialVersionUID = 1L;

        private Integer id;

        /**
         * 酒店id
         */
        private Integer hotelId;

        /**
         * 平台id（0表示官网）
         */
        private Integer platformId;

        /**
         * 最新查询时间戳
         */
        private Long queryDate;

        /**
         * 入住日期（yyyyMMdd）
         */
        private Long checkInDate;

        /**
         * 币种id
         */
        private Integer currencyId;

        /**
         * room_info.id
         */
        private Integer roomId;

        /**
         * 税前房价
         */
        private BigDecimal rate;

        /**
         * 税后房价
         */
        private BigDecimal afterTaxRate;

        /**
         * 房价抓取数据源ID
         */
        private Integer datasourceId;

        /**
         * 销售地区。us：美国 tw：台湾
         */
        private String pos;

        /**
         * 生成key
         *
         * @return java.lang.String
         * @author lichen
         * @date 2024/4/2
         */
        public String generateKey() {
            List<String> list = Lists.newArrayList(checkInDate.toString(), hotelId.toString(), currencyId.toString(),
                    pos, platformId.toString(), datasourceId.toString(), roomId.toString());
            return StringUtils.join(list, "_");
        }

    }