package com.iformall.domain.po;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Table(name = "wx_mall")
public class WxMall implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Id
    protected Long id;
    
    @Transient
    protected List<Long> ids;
    @Transient
    protected String sortColumns;
  
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public String getSortColumns() {
		return sortColumns;
	}
	 
	public List<Long> getIds() {
		return ids;
	}

	public void setIds(List<Long> ids) {
		this.ids = ids;
	}
	
	
	
	/*租户ID**/
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	/*商场名**/
	@io.swagger.annotations.ApiModelProperty(value="商场名",name="name")
	private String name;
	/*集团**/
	@io.swagger.annotations.ApiModelProperty(value="集团",name="group")
	private String group;
	/*国家**/
	@io.swagger.annotations.ApiModelProperty(value="国家",name="country")
	private String country;
	/*省**/
	@io.swagger.annotations.ApiModelProperty(value="省",name="province")
	private String province;
	/*城市**/
	@io.swagger.annotations.ApiModelProperty(value="城市",name="city")
	private String city;
	/*地址**/
	@io.swagger.annotations.ApiModelProperty(value="地址",name="addr")
	private String addr;
	/*总面积**/
	@io.swagger.annotations.ApiModelProperty(value="总面积",name="totalArea")
	private BigDecimal totalArea;
	/*营业面积**/
	@io.swagger.annotations.ApiModelProperty(value="营业面积",name="operatingArea")
	private BigDecimal operatingArea;
	/*停车场面积**/
	@io.swagger.annotations.ApiModelProperty(value="停车场面积",name="parkArea")
	private BigDecimal parkArea;
	/*车位数**/
	@io.swagger.annotations.ApiModelProperty(value="车位数",name="parkPlaceNumber")
	private Integer parkPlaceNumber;
	@io.swagger.annotations.ApiModelProperty(value="电话",name="servicePhone")
	private String servicePhone;
	@io.swagger.annotations.ApiModelProperty(value="商场图标",name="imgUrl")
	private String imgUrl;
	@io.swagger.annotations.ApiModelProperty(value="商场图标",name="imgUrlH")
	private String imgUrlH;

	@io.swagger.annotations.ApiModelProperty(value="小程序二维码",name="imgQrcodeWeapp")
	private String imgQrcodeWeapp;
	@io.swagger.annotations.ApiModelProperty(value="公众平台二维码",name="imgQrcodeWemp")
	private String imgQrcodeWemp;

    @io.swagger.annotations.ApiModelProperty(value="分享标题",name="weappShareTitle")
    private String weappShareTitle;

    @io.swagger.annotations.ApiModelProperty(value="分享封面图片",name="weappShareCoverImg")
    private String weappShareCoverImg;

    @io.swagger.annotations.ApiModelProperty(value="小程序提示",name="weapNote")
    private String weapNote;

	@Transient
	protected List<WxMallBuilding> buildings;

	private String imgWeappQrcode;

	public String getImgWeappQrcode() {
		return imgWeappQrcode;
	}

	public void setImgWeappQrcode(String imgWeappQrcode) {
		this.imgWeappQrcode = imgWeappQrcode;
	}

	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getName() {
		return name;
	}
	public void setName(String _name) {
		name = _name;
	}
	public String  getGroup() {
		return group;
	}
	public void setGroup(String _group) {
		group = _group;
	}
	public String  getCountry() {
		return country;
	}
	public void setCountry(String _country) {
		country = _country;
	}
	public String  getProvince() {
		return province;
	}
	public void setProvince(String _province) {
		province = _province;
	}
	public String  getCity() {
		return city;
	}
	public void setCity(String _city) {
		city = _city;
	}
	public String  getAddr() {
		return addr;
	}
	public void setAddr(String _addr) {
		addr = _addr;
	}
	public BigDecimal  getTotalArea() {
		return totalArea;
	}
	public void setTotalArea(BigDecimal _totalArea) {
		totalArea = _totalArea;
	}
	public BigDecimal  getOperatingArea() {
		return operatingArea;
	}
	public void setOperatingArea(BigDecimal _operatingArea) {
		operatingArea = _operatingArea;
	}
	public BigDecimal  getParkArea() {
		return parkArea;
	}
	public void setParkArea(BigDecimal _parkArea) {
		parkArea = _parkArea;
	}
	public Integer  getParkPlaceNumber() {
		return parkPlaceNumber;
	}
	public void setParkPlaceNumber(Integer _parkPlaceNumber) {
		parkPlaceNumber = _parkPlaceNumber;
	}

	public String getServicePhone() {
		return servicePhone;
	}

	public void setServicePhone(String _servicePhone) {
		this.servicePhone = _servicePhone;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String _imgUrl) {
		this.imgUrl = _imgUrl;
	}

	public String getImgUrlH() {
		return imgUrlH;
	}

	public void setImgUrlH(String imgUrlH) {
		this.imgUrlH = imgUrlH;
	}

    public String getWeapNote() {
        return weapNote;
    }

    public void setWeapNote(String weapNote) {
        this.weapNote = weapNote;
    }

	public List<WxMallBuilding> getBuildings() {
		return buildings;
	}

	public void setBuildings(List<WxMallBuilding> buildings) {
		this.buildings = buildings;
	}

	public String getImgQrcodeWeapp() {
		return imgQrcodeWeapp;
	}

	public void setImgQrcodeWeapp(String imgQrcodeWeapp) {
		this.imgQrcodeWeapp = imgQrcodeWeapp;
	}

	public String getImgQrcodeWemp() {
		return imgQrcodeWemp;
	}

	public void setImgQrcodeWemp(String imgQrcodeWemp) {
		this.imgQrcodeWemp = imgQrcodeWemp;
	}

    public String getWeappShareTitle() {
        return weappShareTitle;
    }

    public void setWeappShareTitle(String weappShareTitle) {
        this.weappShareTitle = weappShareTitle;
    }

    public String getWeappShareCoverImg() {
        return weappShareCoverImg;
    }

    public void setWeappShareCoverImg(String weappShareCoverImg) {
        this.weappShareCoverImg = weappShareCoverImg;
    }

    public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
			,Name_ASC("`name` ASC"),Name_DESC("`name` DESC")
			,Group_ASC("`group` ASC"),Group_DESC("`group` DESC")
			,Country_ASC("`country` ASC"),Country_DESC("`country` DESC")
			,Province_ASC("`province` ASC"),Province_DESC("`province` DESC")
			,City_ASC("`city` ASC"),City_DESC("`city` DESC")
			,Addr_ASC("`addr` ASC"),Addr_DESC("`addr` DESC")
			,TotalArea_ASC("`total_area` ASC"),TotalArea_DESC("`total_area` DESC")
			,OperatingArea_ASC("`operating_area` ASC"),OperatingArea_DESC("`operating_area` DESC")
			,ParkArea_ASC("`parkArea` ASC"),ParkArea_DESC("`parkArea` DESC")
			,ParkPlaceNumber_ASC("`park_place_number` ASC"),ParkPlaceNumber_DESC("`park_place_number` DESC")
			,ServicePhone_ASC("`service_phone` ASC"),ServicePhone_DESC("`service_phone` DESC")
			,ImgUrl_ASC("`img_url` ASC"),ImgUrl_DESC("`img_url` DESC")
            ,ImgUrlH_ASC("`img_url_h` ASC"),ImgUrlH_DESC("`img_url_h` DESC")
            ,WeapNote_ASC("`weap_note` ASC"),WeapNote_DESC("`weap_note` DESC")
	;
		private String value;
		Field(String value){
			this.value = value;
		}
		public String getValue() {
			return value;
		}
		public void setCol(String value) {
			this.value = value;
		}
		@Override
		public String toString() {
			return this.getValue();
		}
	}
	
	public void setSortColumns(WxMall.Field... fields)
	{
		if (fields == null || fields.length == 0) {
			return;
		}
		for (int k = 0; k < fields.length; k++) {
			if (fields[k] == null) {
				return;
			}
		}
		StringBuilder sb = new StringBuilder(fields[0].toString());
		for (int k = 1; k < fields.length; k++) {
			sb.append(",");
			sb.append(fields[k].toString());
		}

		this.sortColumns = sb.toString();
	}
	
	public void setSortColumns(String sortColumns)
	{
		if (sortColumns == null || "".equals(sortColumns.trim())) {
			return;
		}
		if (sortColumns.contains(",")) {
			String[] cols = sortColumns.split(",");
			java.util.List<Field> fList = new java.util.ArrayList();
			for (int k = 0; k < cols.length; k++) {
				fList.add(Field.valueOf(cols[k]));
			}
			this.setSortColumns(fList.toArray(new Field[fList.size()]));
		} else {
			this.setSortColumns(Field.valueOf(sortColumns));
		}
	}
}
