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.BMainFactoryVerification;
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;


/**
 * 移动执法信息-企业核查对象 b_main_factory_verification
 *
 * @author szhpt
 * @date 2023-03-30*/
@ApiModel(value = "移动执法信息-企业核查")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainFactoryVerificationQuery extends PageQuery
{

    @ApiModelProperty(value = "id")
    private String id;
    @ApiModelProperty(value = "任务名称")
    private String taskName;
    @ApiModelProperty(value = "任务来源")
    private String taskSource;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "企业名称")
    private String factoryName;
    @ApiModelProperty(value = "企业地址")
    private String factoryAddress;
    @ApiModelProperty(value = "所属区域")
    private String area;
    @ApiModelProperty(value = "统一社会信用代码")
    private String creditCode;
    @ApiModelProperty(value = "当前办理人")
    private String handlePerson;
    @ApiModelProperty(value = "完成时间")
    private String completeTime;
    @ApiModelProperty(value = "核查内容")
    private String verificationContent;
    @ApiModelProperty(value = "核查时间")
    private String verificationTime;
    @ApiModelProperty(value = "任务状态;任务状态（0=办理中 4=已交办 5=已办结 9=已归档）")
    private String taskStatus;
    @ApiModelProperty(value = "企业类型;1 涉水 2涉气 3固废 4其他")
    private String factoryType;
    @ApiModelProperty(value = "是否现场执法;0 否 1 是")
    private String isLawEnforcement;
    @ApiModelProperty(value = "下达隐患提示函;0 否 1 是")
    private String isHiddenDangerReminder;
    @ApiModelProperty(value = "是否存在问题;0 否 1 是")
    private String isProblem;
    @ApiModelProperty(value = "执法人员名称")
    private String lawEnforcementPerson;
    @ApiModelProperty(value = "执法小结")
    private String enforcementSummary;
    @ApiModelProperty(value = "备注信息")
    private String remark;
    @ApiModelProperty(value = "证据清单")
    private String evidenceList;
    @ApiModelProperty(value = "创建人")
    private String createBy;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    @ApiModelProperty(value = "更新时间")
    private String updateTime;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BMainFactoryVerification> createLambdaQueryWrapper(BMainFactoryVerificationQuery query) {
        QueryWrapper<BMainFactoryVerification> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.like(ObjectUtil.isNotEmpty(query.getTaskName()), "task_name", query.getTaskName());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getTaskSource()), "task_source", query.getTaskSource());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getFactoryName()), "factory_name", query.getFactoryName());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getFactoryAddress()), "factory_address", query.getFactoryAddress());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getArea()), "area", query.getArea());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getCreditCode()), "credit_code", query.getCreditCode());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getHandlePerson()), "handle_person", query.getHandlePerson());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getCompleteTime()), "complete_time", query.getCompleteTime());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getVerificationContent()), "verification_content", query.getVerificationContent());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getVerificationTime()), "verification_time", query.getVerificationTime());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getTaskStatus()), "task_status", query.getTaskStatus());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getFactoryType()), "factory_type", query.getFactoryType());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getIsLawEnforcement()), "is_law_enforcement", query.getIsLawEnforcement());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getIsHiddenDangerReminder()), "is_hidden_danger_reminder", query.getIsHiddenDangerReminder());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getIsProblem()), "is_problem", query.getIsProblem());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getLawEnforcementPerson()), "law_enforcement_person", query.getLawEnforcementPerson());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getEnforcementSummary()), "enforcement_summary", query.getEnforcementSummary());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getRemark()), "remark", query.getRemark());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getEvidenceList()), "evidence_list", query.getEvidenceList());

        wrapper.orderByAsc("create_time");
        return wrapper;
        }
}
