/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package org.springblade.business.entity;



import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.business.utils.MileageUtill;
import org.springblade.business.utils.NumberUtil;
import org.springblade.core.tenant.mp.TenantEntity;
import javax.validation.constraints.Size;



/**
 * @author yangyj
 */
@Data
@TableName("t_om_mileagexy")
@EqualsAndHashCode(callSuper = true)
public class Mileagexy   extends TenantEntity {
	private static final long serialVersionUID = 491147543091757213L;
	private String projectId;		// projId
	private String notes;		// notes
	private String code;		// 编号
	private Double value=0.0;		// 里程
	private Double x=0.0;		// x
	private Double y=0.0;		// y
	private Double r=0.0;		// 半径
	private Double r2=0.0;		// 半径
	private String swing="";		// 转向
	private Double l=0.0;		// 长度
	private Double valueEnd=0.0;		// 结束里程
	private Integer orderNum=0;		// 顺序
	private Integer type=0;		// 类型 0 z，1 y,2 rh,3 ch
	private Double angle=0.0;		// 方位角
	private Integer du=0;		// 度
	private Integer fen=0;		// 分
	private Double miao=0.0;		// 秒
	private Double dlq=0.0;		// 断链前里程
	private Double dlh=0.0;		// 断链后里程
	private String ids;
	private String partNo;		// 片段前缀
	private String partId;		// 片段所属id t_pf_mileage_part
	private String contractId;


	public String getValueStr() {
		return MileageUtill.convertToMileage(value);
	}


	public String getValueEndStr() {
		return MileageUtill.convertToMileage(valueEnd);
	}

	public String getXxStr() {
		return NumberUtil.forcibleFormat(x,3);
	}

	public String getYyStr() {
		return NumberUtil.forcibleFormat(y,3);
	}

	public String getAngleStr() {
		return MileageUtill.convertToSexagesimal(angle);
	}

	public int compareTo(Mileagexy o) {
		return Integer.parseInt(NumberUtil.forcibleFormat(this.value*10-o.getValue()*10,0));
	}

}