| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty(value = "计划周期具体值,数组对象[1,2,3]") |
| | | @TableField(typeHandler = FastjsonTypeHandler.class) |
| | | private List<String> planCycleValue; |
| | | |
| | | @ApiModelProperty(value = "维护状态(0未维修1已维修)") |
| | | private Integer maintainStatus; |
| | | |
| | | @ApiModelProperty(value = "最后维修时间") |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private Date lastMaintainTime; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | |
| | | b.create_time as device_create_time |
| | | </sql> |
| | | |
| | | <sql id="maintainStatusCalculation"> |
| | | CASE |
| | | WHEN ( |
| | | SELECT COUNT(1) |
| | | FROM ja_fw_device_maintain_record r |
| | | WHERE r.device_id = a.device_id |
| | | AND r.is_deleted = 0 |
| | | AND r.maintain_time IS NOT NULL |
| | | AND ( |
| | | (a.plan_cycle_type = '1' AND FIND_IN_SET(DATE_FORMAT(r.maintain_time, '%m月%d号'), REPLACE(REPLACE(REPLACE(a.plan_cycle_value, '[', ''), ']', ''), '"', '')) > 0) |
| | | OR (a.plan_cycle_type = '2' AND FIND_IN_SET(DATE_FORMAT(r.maintain_time, '%d号'), REPLACE(REPLACE(REPLACE(a.plan_cycle_value, '[', ''), ']', ''), '"', '')) > 0) |
| | | OR (a.plan_cycle_type = '3' AND FIND_IN_SET(ELT(DAYOFWEEK(r.maintain_time), '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'), REPLACE(REPLACE(REPLACE(a.plan_cycle_value, '[', ''), ']', ''), '"', '')) > 0) |
| | | ) |
| | | ) > 0 THEN '已维护' |
| | | ELSE '未维护' |
| | | END AS maintain_status, |
| | | (SELECT MAX(r.maintain_time) FROM ja_fw_device_maintain_record r WHERE r.device_id = a.device_id AND r.is_deleted = 0) AS last_maintain_time |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="getFwDeviceMaintainPlanById" resultMap="fwDeviceMaintainPlanResultMap"> |
| | | select |
| | | <include refid="deviceFields"/>,a.* |
| | |
| | | |
| | | <select id="selectFwDeviceMaintainPlanPage" resultMap="fwDeviceMaintainPlanResultMap"> |
| | | select |
| | | <include refid="deviceFields"/>,a.*, |
| | | <include refid="maintainStatusCalculation"/> |
| | | <include refid="deviceFields"/>,a.* |
| | | from |
| | | ja_fw_device_maintain_plan a |
| | | left join ja_fw_device b on (a.device_id = b.id) |
| | |
| | | */ |
| | | package org.sxkj.fw.device.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.sxkj.system.cache.SysCache; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | @ApiModelProperty("入库时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "维修状态") |
| | | private String maintainStatus; |
| | | @ApiModelProperty(value = "维护状态(0未维修1已维修)") |
| | | private Integer maintainStatus; |
| | | |
| | | @ApiModelProperty(value = "最后维修时间") |
| | | private String lastMaintainTime; |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private Date lastMaintainTime; |
| | | |
| | | @ApiModelProperty(value = "所属部门名称") |
| | | public String getBelongDeptName() { |