package cn.cecep.talroad.vo;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.MAmVideoCoordinateOperationLog;
import cn.cecep.talroad.domain.MAmVideoDevFi;
import cn.cecep.talroad.vo.query.MAmVideoDevFiQuery;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @className: MAmVideoCoordinateOperationLog
 * @description: TODO 类描述
 * @author: Mr.Yanghongtao
 * @date: 2023/04/28 15:27
 * @Company: Copyright© [2023/04/28 15:27] by [Mr.Yanghongtao]
 **/

/**
 * 视频坐标操作日志表
 */
@ApiModel(value = "视频坐标操作日志表")
@Data
@EqualsAndHashCode(callSuper = false)
public class MAmVideoCoordinateOperationLogQuery extends PageQuery {
    /**
     * 主键标识
     */
    private String logId;

    /**
     * 操作时间
     */
    private Date operationTime;

    /**
     * 视频监测点位名称
     */
    private String videoStationName;

    /**
     * 操作前经度
     */
    private String beforeModifyLng;

    /**
     * 操作前纬度
     */
    private String beforeModifyLag;

    /**
     * 操作状态
     */
    private String operationStatus;

    /**
     * 操作后经度
     */
    private String afterModifyLng;

    /**
     * 操作后纬度
     */
    private String afterModifyLag;

    /**
     * 操作人
     */
    private String operator;

    /**
     * 操作人ID
     */
    private String operatorId;

    /**
     * 视频通道ID
     */
    private String videoChannel;

    /**
     * 企业ID
     */
    private String factoryId;


    @ApiModelProperty(value = "开始时间")
    private Date startTime;
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    public static QueryWrapper<MAmVideoCoordinateOperationLog> createLambdaQueryWrapper(MAmVideoCoordinateOperationLogQuery query) {
        QueryWrapper<MAmVideoCoordinateOperationLog> wrapper = new QueryWrapper<>();

        wrapper.ge(ObjectUtil.isNotNull(query.getStartTime()), "operation_time", query.getStartTime());
        wrapper.le(ObjectUtil.isNotNull(query.getEndTime()), "operation_time", query.getEndTime());
        wrapper.like(ObjectUtil.isNotNull(query.getVideoStationName()), "video_station_name", query.getVideoStationName());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.orderByDesc("operation_time");
        return wrapper;
    }
}
