package com.chushang.inspection.project.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.chushang.common.mybatis.annotation.Condition;
import com.chushang.common.mybatis.page.CommonParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 查询 任务
 * @auther: zhao
 * @date: 2024/6/18 16:04
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class TaskQuery extends CommonParam {

    /** 任务名称或联系人 */
    @Size(max = 32, message = "任务名称或联系人长度不能超过32位")
    @Condition(name = "`name`,contact", type = Condition.ConditionType.or_like)
    private String blurry;

    /** 创建时间 */
    @Condition(name = "create_time", type = Condition.ConditionType.in)
    private List<LocalDateTime> createTime;

    /** 上级任务id */
    private Long pid;

    /** 是否查询未开启的状态1 不是 0是 */
    @Range(max = 1, message = "状态输入错误")
    @Condition(name = "enabled", type = Condition.ConditionType.eq)
    private Integer enabled;


    /**
     * 结束时间
     */
    @TableField(value = "end_time")
    private LocalDateTime endTime;

    @Condition(name = "name", type = Condition.ConditionType.eq)
    private String deptName;
}
