package cn.cecep.talroad.vo.query;

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


/**
 * 门禁监控对象 m_am_door_monitor_account_fi
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "门禁监控")
@EqualsAndHashCode(callSuper = false)
@Data
public class AmDoorMonitorAccountFiQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "车牌号码")
    private String lpnCode;
    @ApiModelProperty(value = "出入类型")
    private String entryType;
    @ApiModelProperty(value = "出入开始时间")
    private String entryStartTime;
    @ApiModelProperty(value = "出入结束时间")
    private String entryEndTime;
    @ApiModelProperty(value = "车队名称")
    private String carTeam;
    @ApiModelProperty(value = "排放阶段")
    private String dischargeStage;
    @ApiModelProperty(value = "发动机号码")
    private String ngineCode;
    @ApiModelProperty(value = "货物名称")
    private String ioType;
    @ApiModelProperty(value = "货物净重")
    private String cargoQuantity;
    @ApiModelProperty(value = "行驶证照片")
    private String drivingLicenseImage;
    @ApiModelProperty(value = "随车清单")
    private String accessoryListImage;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<AmDoorMonitorAccountFi> createLambdaQueryWrapper(AmDoorMonitorAccountFiQuery query) {
        QueryWrapper<AmDoorMonitorAccountFi> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.like(StringUtils.isNotEmpty(query.getLpnCode()), "lpn_code", query.getLpnCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getEntryType()), "entry_type", query.getEntryType());
        wrapper.between(StringUtils.isNotEmpty(query.getEntryStartTime()) && StringUtils.isNotEmpty(query.getEntryEndTime()), "entry_time", query.getEntryStartTime(), query.getEntryEndTime());
        wrapper.eq(StringUtils.isNotEmpty(query.getCarTeam()), "car_team", query.getCarTeam());
        wrapper.eq(StringUtils.isNotEmpty(query.getDischargeStage()), "discharge_stage", query.getDischargeStage());
        wrapper.eq(StringUtils.isNotEmpty(query.getNgineCode()), "ngine_code", query.getNgineCode());
        wrapper.like(StringUtils.isNotEmpty(query.getIoType()), "io_type", query.getIoType());
        wrapper.eq(StringUtils.isNotEmpty(query.getCargoQuantity()), "cargo_quantity", query.getCargoQuantity());
        wrapper.eq(StringUtils.isNotEmpty(query.getDrivingLicenseImage()), "driving_license_image", query.getDrivingLicenseImage());
        wrapper.eq(StringUtils.isNotEmpty(query.getAccessoryListImage()), "accessory_list_image", query.getAccessoryListImage());

        wrapper.orderByDesc("entry_time");
        return wrapper;
        }
}
