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.BMainTwoRandomTask;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 移动执法信息-双随机任务对象 b_main_two_random_task
 */
@ApiModel(value = "移动执法信息-双随机任务")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainTwoRandomTaskQuery extends PageQuery
{
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "企业名称")
    private String factoryName;
    @ApiModelProperty(value = "任务类型")
    private String taskType;
    @ApiModelProperty(value = "任务状态")
    private String taskStatus;

    public static QueryWrapper<BMainTwoRandomTask> createLambdaQueryWrapper(BMainTwoRandomTaskQuery query) {
        QueryWrapper<BMainTwoRandomTask> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.like(StringUtils.isNotEmpty(query.getFactoryName()), "factory_name", query.getFactoryName());
        wrapper.eq(StringUtils.isNotEmpty(query.getTaskType()), "task_type", query.getTaskType());
        wrapper.eq(StringUtils.isNotEmpty(query.getTaskStatus()), "task_status", query.getTaskStatus());
        wrapper.orderByAsc("factory_name", "id");
        return wrapper;
    }
}
