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


/**
 * 站房运维签到信息对象 pc_station_building_ops
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "站房运维签到信息")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcStationBuildingOpsQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "站房id")
    private String stationBuildingId;
    @ApiModelProperty(value = "签到人员")
    private String signInPersonnel;
    @ApiModelProperty(value = "签到开始时间")
    private String signInStartTime;
    @ApiModelProperty(value = "签到结束时间")
    private String signInEndTime;
    @ApiModelProperty(value = "签到图片")
    private String signInImage;
    @ApiModelProperty(value = "运维活动")
    private String signOutPersonnel;
    @ApiModelProperty(value = "签退时间")
    private String signOutTime;
    @ApiModelProperty(value = "签退图片")
    private String signOutImage;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcStationBuildingOps> createLambdaQueryWrapper(PcStationBuildingOpsQuery query) {
        QueryWrapper<PcStationBuildingOps> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotEmpty(query.getStationBuildingId()), "station_building_id", query.getStationBuildingId());
        wrapper.eq(StringUtils.isNotEmpty(query.getSignInPersonnel()), "sign_in_personnel", query.getSignInPersonnel());
        wrapper.ge(StringUtils.isNotEmpty(query.getSignInStartTime()) && StringUtils.isNotEmpty(query.getSignInStartTime()), "sign_in_time", query.getSignInStartTime());
        wrapper.le(StringUtils.isNotEmpty(query.getSignInEndTime()) && StringUtils.isNotEmpty(query.getSignInEndTime()), "sign_in_time", query.getSignInEndTime());

        wrapper.eq(StringUtils.isNotEmpty(query.getSignInImage()), "sign_in_image", query.getSignInImage());
        wrapper.eq(StringUtils.isNotEmpty(query.getSignOutPersonnel()), "sign_out_personnel", query.getSignOutPersonnel());
        wrapper.eq(StringUtils.isNotEmpty(query.getSignOutTime()), "sign_out_time", query.getSignOutTime());
        wrapper.eq(StringUtils.isNotEmpty(query.getSignOutImage()), "sign_out_image", query.getSignOutImage());
        wrapper.orderByDesc("sign_in_time");
        return wrapper;
        }
}
