package cn.cecep.talroad.vo.query;

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


/**
 * 有组织-分表计电设备对应对象 bas_dev_to_elec
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "有组织-分表计电设备对应")
@EqualsAndHashCode(callSuper = false)
@Data
public class BasDevToElecQuery extends PageQuery
{

    @ApiModelProperty(value = "有组织设备ID")
    private String deviceId;
    @ApiModelProperty(value = "计电设备ID")
    private String elecDeviceId;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BasDevToElec> createLambdaQueryWrapper(BasDevToElecQuery query) {
        QueryWrapper<BasDevToElec> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getDeviceId()), "device_id", query.getDeviceId());
        wrapper.eq(ObjectUtil.isNotNull(query.getElecDeviceId()), "elec_device_id", query.getElecDeviceId());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateTime()), "create_time", query.getCreateTime());
        return wrapper;
        }
}
