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


/**
 * @Description: 企业门禁信息
 * @Author: code-generate
 * @Date:   2023-07-18
 * @Version: V1.0
 */
@ApiModel(value="pc_factory_access_control查询对象")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcFactoryAccessControlQuery extends PageQuery
{

	/**企业id*/
    @ApiModelProperty(value = "企业id")
	private String factoryId;
	/**门禁名称*/
    @ApiModelProperty(value = "门禁名称")
	private String accessControlName;
	/**门禁编码*/
    @ApiModelProperty(value = "门禁编码")
	private String accessControlCode;
	/**门禁经度*/
    @ApiModelProperty(value = "门禁经度")
	private String accessControlLng;
	/**门禁纬度*/
    @ApiModelProperty(value = "门禁纬度")
	private String accessControlLat;

    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<PcFactoryAccessControl>
     * @throws
     */
    public static QueryWrapper<PcFactoryAccessControl> createLambdaQueryWrapper(PcFactoryAccessControlQuery query) {
        QueryWrapper<PcFactoryAccessControl> wrapper = new QueryWrapper<>();
        
   		wrapper.eq(StringUtils.isNotEmpty(query.getFactoryId()), "factory_id", query.getFactoryId());
   		wrapper.like(StringUtils.isNotEmpty(query.getAccessControlName()), "access_control_name", query.getAccessControlName());
   		wrapper.eq(StringUtils.isNotEmpty(query.getAccessControlCode()), "access_control_code", query.getAccessControlCode());
   		wrapper.eq(StringUtils.isNotEmpty(query.getAccessControlLng()), "access_control_lng", query.getAccessControlLng());
   		wrapper.eq(StringUtils.isNotEmpty(query.getAccessControlLat()), "access_control_lat", query.getAccessControlLat());
		wrapper.orderByDesc("factory_id");
        return wrapper;
        }
}
