package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.MAmVideoDevFi;
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;


/**
 * 基础信息 与 产治排跟踪--视频设施清单对象 m_am_video_dev_fi
 *
 * @author szhpt
 * @date 2023-02-10
 */
@ApiModel(value = "基础信息 与 产治排跟踪--视频设施清单")
@EqualsAndHashCode(callSuper = false)
@Data
public class MAmVideoDevFiQuery extends PageQuery {

    @ApiModelProperty(value = "设备主键")
    private Long id;
    @ApiModelProperty(value = "摄像头ID")
    private String devId;
    @ApiModelProperty(value = "摄像头名称")
    private String devName;
    @ApiModelProperty(value = "摄像头内部编号")
    private String devInsideCode;
    @ApiModelProperty(value = "验证码")
    private String devCode;
    @ApiModelProperty(value = "型号")
    private String model;
    @ApiModelProperty(value = "通道号")
    private String modelRoad;
    @ApiModelProperty(value = "安装位置")
    private String location;
    @ApiModelProperty(value = "经度(地图)")
    private String lonMap;
    @ApiModelProperty(value = "纬度(地图)")
    private String latMap;
    @ApiModelProperty(value = "备注说明")
    private String descrAny;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    @ApiModelProperty(value = "修改时间")
    private String updateTime;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "排口id")
    private String outletId;
    @ApiModelProperty(value = "设备类型")
    private String devType;
    @ApiModelProperty(value = "设备来源")
    private String devSource;

    private String status;

    /**
     * @throws
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     */
    public static QueryWrapper<MAmVideoDevFi> createLambdaQueryWrapper(MAmVideoDevFiQuery query) {
        QueryWrapper<MAmVideoDevFi> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getDevId()), "dev_id", query.getDevId());
        wrapper.like(StrUtil.isNotBlank(query.getDevName()), "dev_name", query.getDevName());
        wrapper.eq(ObjectUtil.isNotNull(query.getDevInsideCode()), "dev_inside_code", query.getDevInsideCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getDevCode()), "dev_code", query.getDevCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getModel()), "model", query.getModel());
        wrapper.eq(ObjectUtil.isNotNull(query.getModelRoad()), "model_road", query.getModelRoad());
        wrapper.eq(ObjectUtil.isNotNull(query.getLocation()), "location", query.getLocation());
        wrapper.eq(ObjectUtil.isNotNull(query.getLonMap()), "lon_map", query.getLonMap());
        wrapper.eq(ObjectUtil.isNotNull(query.getLatMap()), "lat_map", query.getLatMap());
        wrapper.eq(ObjectUtil.isNotNull(query.getDescrAny()), "descr_any", query.getDescrAny());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateTime()), "create_time", query.getCreateTime());
        wrapper.eq(ObjectUtil.isNotNull(query.getUpdateTime()), "update_time", query.getUpdateTime());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(ObjectUtil.isNotNull(query.getOutletId()), "outlet_id", query.getOutletId());
        wrapper.eq(ObjectUtil.isNotNull(query.getDevType()), "dev_type", query.getDevType());
        wrapper.eq(ObjectUtil.isNotNull(query.getDevSource()), "dev_source", query.getDevSource());
        wrapper.eq(StrUtil.isNotBlank(query.getStatus()), "status", query.getStatus());
        wrapper.orderByAsc("id");
        return wrapper;
    }
}
