package cn.superdesk.uniorder.dto.param.organisation;

import cn.hutool.core.util.ObjectUtil;
import cn.superdesk.uniorder.common.enums.common.CommonEnabledEnum;
import cn.superdesk.uniorder.common.enums.common.CommonSoftDeleteEnum;
import cn.superdesk.uniorder.common.numerical.AnIntegerUtils;
import cn.superdesk.uniorder.common.numerical.AnLongUtils;
import cn.superdesk.uniorder.common.pagination.AnBaseQueryCriteria;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2022/2/18 下午6:21
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/2/18 下午6:21
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder(toBuilder = true)
@Data
public class SysEnterpriseExtInvoiceQueryCriteria extends AnBaseQueryCriteria {


//	if (ObjectUtil.isNotNull(conditions.get("outVirtId"))) {
//		Long virtId = AnLongUtils.getLong(conditions.get("outVirtId"));
//		criteria.andOutVirtIdEqualTo(virtId);
//	}
//
//	// 是否删除
//		if (ObjectUtil.isNotNull(conditions.get("deleted"))) {
//		Integer deleted = AnIntegerUtils.getInteger(conditions.get("deleted"));
//		criteria.andDeletedEqualTo(deleted);
//	} else {
//		criteria.andDeletedEqualTo(CommonSoftDeleteEnum.正常.getKey());
//	}
//
//	// 是否启用:1-启用;0-禁用;
//		if (ObjectUtil.isNotNull(conditions.get("enabled"))) {
//		Integer enabled = AnIntegerUtils.getInteger(conditions.get("enabled"));
//		criteria.andEnabledEqualTo(enabled);
//	} else {
//		criteria.andEnabledEqualTo(CommonEnabledEnum.启用.getKey());
//	}
//
//
//	example.setOrderByClause("is_default DESC , update_time DESC");

	@ApiModelProperty("企业扩展-发票信息Id sql -> and id = #{sysEnterpriseExtInvoiceId}")
	private Long       sysEnterpriseExtInvoiceId;
	@ApiModelProperty("企业扩展-发票信息Id sql -> and id not in ( #{sysEnterpriseExtInvoiceIdNotIn} )")
	private List<Long> sysEnterpriseExtInvoiceIdNotIn;

	@ApiModelProperty("所属企业Id")
	private Long   outVirtId;
	@ApiModelProperty("发票抬头  (如果selectedInvoiceTitle=5则此字段必须) sql -> and company_name like CONCAT('%',#{companyName},'%')")
	private String companyName;
	@ApiModelProperty("发票抬头 sql -> and company_name = #{companyName}")
	private String companyNameEq;

	@ApiModelProperty("是否启用:0-禁用;1-启用;默认为1-启用")
	private Integer enabled = 1;
	@ApiModelProperty("软删除:0-正常;1-删除;默认为0-正常")
	private Integer deleted = 0;
	@ApiModelProperty("排序,默认为 is_default DESC, update_time DESC sql -> order by is_default DESC, update_time DESC")
	private String  orderBy = "is_default DESC, update_time DESC";

}
