package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.PcFactoryAccessControlCoordinateOperationLog;
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="pc_factory_access_control_coordinate_operation_log查询对象")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcFactoryAccessControlCoordinateOperationLogQuery extends PageQuery
{

	/**主键标识*/
	@ApiModelProperty(value = "主键标识")
	private String logId;
	/**factoryName*/
	@ApiModelProperty(value = "门禁名称")
	private String accessControlName;
	@ApiModelProperty(value = "开始时间")
	private Date startTime;
	@ApiModelProperty(value = "结束时间")
	private Date endTime;
	/**企业ID*/
	@ApiModelProperty(value = "企业ID")
	private String factoryId;

    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<PcFactoryAccessControlCoordinateOperationLog>
     * @throws
     */
    public static QueryWrapper<PcFactoryAccessControlCoordinateOperationLog> createLambdaQueryWrapper(PcFactoryAccessControlCoordinateOperationLogQuery query) {
        QueryWrapper<PcFactoryAccessControlCoordinateOperationLog> 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.getAccessControlName()), "access_control_name", query.getAccessControlName());
		wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
		wrapper.orderByDesc("operation_time");
        return wrapper;
        }
}
