package cn.cecep.talroad.vo.query;

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

import java.util.Date;


/**
 * @Description: 企业坐标操作记录表
 * @Author: code-generate
 * @Date:   2023-07-18
 * @Version: V1.0
 */
@ApiModel(value="企业坐标操作查询对象")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcFactoryCoordinateOperationLogQuery extends PageQuery
{

	/**主键标识*/
    @ApiModelProperty(value = "主键标识")
	private String logId;
	/**factoryName*/
    @ApiModelProperty(value = "企业名称")
	private String factoryName;
	@ApiModelProperty(value = "开始时间")
	private Date startTime;
	@ApiModelProperty(value = "结束时间")
	private Date endTime;
	/**企业ID*/
	@ApiModelProperty(value = "企业ID")
	private String factoryId;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<PcFactoryCoordinateOperationLog>
     * @throws
     */
    public static QueryWrapper<PcFactoryCoordinateOperationLog> createLambdaQueryWrapper(PcFactoryCoordinateOperationLogQuery query) {
        QueryWrapper<PcFactoryCoordinateOperationLog> wrapper = new QueryWrapper<>();

		wrapper.ge(ObjectUtil.isNotNull(query.getStartTime()), "operation_time", query.getStartTime());
		wrapper.le(ObjectUtil.isNotNull(query.getEndTime()), "operation_time", query.getEndTime());
		wrapper.like(ObjectUtil.isNotNull(query.getFactoryName()), "factory_name", query.getFactoryName());
		wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
		wrapper.orderByDesc("operation_time");
        
        return wrapper;
        }
}
