package cn.hnthyy.thmz.vo;

import cn.hnthyy.thmz.enums.YesNoEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 门诊收入明细
 */
@Data
public class ThmzmxsrParamsVo extends PageParams{
    //通用参数 姓名，卡号，id
    private String commonParams;
    //费用参照基数   0 日结时间  1 收费时间
    private String caseType;
    //开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date beginDate;
    //结束时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date endDate;
    //病人id
    private List<String> patientIds;
    //就诊/申请科室
    private String jzSqDept;
    //就诊/申请医生
    private String jzSqDoctor;
    //执行科室
    private String execDept;
    //核算码
    private String hsm;
    //父类码
    private String parentCode;
    //收费项目名称
    private String xmm;
    //是否是历史数据，Yes 历史数据
    private YesNoEnum hisData;
    //第一个表名
    private String firstTableName;
    //第二个表名
    private String secondTableName;
    //上一次查询到的总额
    private BigDecimal amount;
    //上一次查询到的总数
    private Integer total;



    public void setHisData(YesNoEnum hisData) {
        this.hisData = hisData;
        if (YesNoEnum.YES.equals(hisData)) {
            this.firstTableName = "mz_charge_detail_b";
            this.secondTableName = "mz_receipt_serial_b";
        } else {
            this.firstTableName = "mz_charge_detail";
            this.secondTableName = "mz_receipt_serial";
        }
    }
}
