# LatestRateManual.java

    package cloud.wconnect.rateshop.entity.revenue;

    import com.baomidou.mybatisplus.annotation.*;

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

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

    /**
     * <p>
     * 手动编辑的最新房价表
     * </p>
     *
     * @author lichen
     * @since 2024-05-14
     */
    @Getter
    @Setter
    @Accessors(chain = true)
    @TableName("latest_rate_manual")
    public class LatestRateManual implements Serializable {

        private static final long serialVersionUID = 1L;

        @TableId(value = "id", type = IdType.AUTO)
        private Long id;

        /**
         * 所属租户id
         */
        private Integer tenantId;

        /**
         * 所属资产id
         */
        private Integer propertyId;

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

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

        /**
         * 入住日期（YYYYMMDD）
         */
        private Integer checkInDate;

        /**
         * 平台id
         */
        @TableField(updateStrategy = FieldStrategy.ALWAYS)
        private Integer platformId;

        /**
         * 房价类型1-早鸟价 2-BAR房价
         */
        private Integer rateType;

        /**
         * 税前最低房价
         * 手动编辑的房价可能带符号，所以是字符串类型
         */
        @TableField(updateStrategy = FieldStrategy.ALWAYS)
        private String rate;

        /**
         * 税后最低房价
         * 手动编辑的房价可能带符号，所以是字符串类型
         */
        @TableField(updateStrategy = FieldStrategy.ALWAYS)
        private String afterTaxRate;

        /**
         * [{uid: 1, timestamp:11111},…]
         */
        private String updateLog;

        /**
         * 来源 1:本资产录入 2:其他资产录入
         */
        private Integer source;

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

        /**
         * 根据参数生成key
         *
         * @return java.lang.String
         * @author lichen
         * @date 2024/5/17
         */
        public String generate() {
            List<String> list = Lists.newArrayList(propertyId, hotelId, currencyId, pos, checkInDate, rateType)
                    .stream().map(Object::toString).toList();
            return StringUtils.join(list, "_");
        }
    }