package com.xintong.visualinspection.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
public class WreckerStatisticsBO {
	
	 //编号
    private Integer id;
 
    private String dept_name ;
    
    // 部门id
    private Long dept_id;
    
    //开始日期
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  
    private Date start_date ;
    
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date end_date ;


    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date update_time ;

    private Long work_no;

    private Integer positionid ;
    
    private Long user_id ;
    
    private String name ;
    
    private String position_name ;
    
    private int score;
    
    private Integer item_id ;

    private String item_name ;
    
    private int chu_jing ;
    
    private int xian_chang;
    
    private int chang_tong ;
    
    private int zuo_ye;
    
    private int xin_xi ;
    
    private int zhuo_zhuang;
    
    private int zuo_ye_xian_chang;
    
    private int wen_ming ;
    
    private int cao_zuo ;
    
    private int gong_zuo;
    
    //
    private int private_check ;
    
    private int in_check ;
    
    private int other_check ;
    
    private int all_check_score ;
    
    private int check_num;
    
    private Integer wrecker_check_type ;

    
    public int compareTo(WreckerStatisticsBO o2){
    	if(this.getCheck_num() !=0  && o2.getCheck_num() !=0){
    		double a=this.getAll_check_score()/this.getCheck_num();
    		double b= o2.getAll_check_score() /  this.getCheck_num()  ;
    		if(a>b){
    			return 1;
    		}else if(a<b){
    			return -1 ;
    		}else{
    			return 0 ;
    		}
    	}else{
    		if(this.getCheck_num() == 0 && o2.getCheck_num() !=0){
    			return 1 ;
    		}else if(this.getCheck_num() != 0 && o2.getCheck_num() ==0){
    			return -1 ;
    		}else{
    			return 0 ;
    		}
    	}
    }
    
}
