package cn.cecep.talroad.vo.query;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.cecep.talroad.domain.BasDeviceConfig;
import cn.cecep.talroad.common.core.domain.query.PageQuery;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;


/**
 * 企业设备参数配置对象 bas_device_config
 *
 * @author szhpt
 * @date 2023-04-05*/
@ApiModel(value = "企业设备参数配置")
@EqualsAndHashCode(callSuper = false)
@Data
public class BasDeviceConfigQuery extends PageQuery
{

    @ApiModelProperty(value = "主键")
    private String dataId;
    @ApiModelProperty(value = "企业ID")
    private String factoryId;
    @ApiModelProperty(value = "设备ID")
    private String deviceId;
    @ApiModelProperty(value = "设备名称")
    private String deviceName;
    @ApiModelProperty(value = "参数编码")
    private String paramCode;
    @ApiModelProperty(value = "参数名称")
    private String paramName;
    @ApiModelProperty(value = "单位")
    private String unit;
    @ApiModelProperty(value = "行业")
    private String industry;
    @ApiModelProperty(value = "设备类型")
    private String deviceType;
    @ApiModelProperty(value = "配置值")
    private String normalValue;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BasDeviceConfig> createLambdaQueryWrapper(BasDeviceConfigQuery query) {
        QueryWrapper<BasDeviceConfig> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getDataId()), "data_id", query.getDataId());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(ObjectUtil.isNotNull(query.getDeviceId()), "device_id", query.getDeviceId());
        wrapper.eq(ObjectUtil.isNotNull(query.getDeviceName()), "device_name", query.getDeviceName());
        wrapper.eq(ObjectUtil.isNotNull(query.getParamCode()), "param_code", query.getParamCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getParamName()), "param_name", query.getParamName());
        wrapper.eq(ObjectUtil.isNotNull(query.getUnit()), "unit", query.getUnit());
        wrapper.eq(ObjectUtil.isNotNull(query.getIndustry()), "industry", query.getIndustry());
        wrapper.eq(ObjectUtil.isNotNull(query.getDeviceType()), "device_type", query.getDeviceType());
        wrapper.eq(ObjectUtil.isNotNull(query.getNormalValue()), "normal_value", query.getNormalValue());
        wrapper.eq(ObjectUtil.isNotNull(query.getRemark()), "remark", query.getRemark());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateTime()), "create_time", query.getCreateTime());
        return wrapper;
        }
}
