20 changed files with 1696 additions and 17 deletions
@ -0,0 +1,139 @@ |
|||||
|
package com.ccsens.wisdomcar.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class PatientWisdomCar implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private Long patientId; |
||||
|
|
||||
|
private Long taskSubId; |
||||
|
|
||||
|
private Long carId; |
||||
|
|
||||
|
private Long startTime; |
||||
|
|
||||
|
private Long endTime; |
||||
|
|
||||
|
private Byte isDemo; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private Byte bindingStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getPatientId() { |
||||
|
return patientId; |
||||
|
} |
||||
|
|
||||
|
public void setPatientId(Long patientId) { |
||||
|
this.patientId = patientId; |
||||
|
} |
||||
|
|
||||
|
public Long getTaskSubId() { |
||||
|
return taskSubId; |
||||
|
} |
||||
|
|
||||
|
public void setTaskSubId(Long taskSubId) { |
||||
|
this.taskSubId = taskSubId; |
||||
|
} |
||||
|
|
||||
|
public Long getCarId() { |
||||
|
return carId; |
||||
|
} |
||||
|
|
||||
|
public void setCarId(Long carId) { |
||||
|
this.carId = carId; |
||||
|
} |
||||
|
|
||||
|
public Long getStartTime() { |
||||
|
return startTime; |
||||
|
} |
||||
|
|
||||
|
public void setStartTime(Long startTime) { |
||||
|
this.startTime = startTime; |
||||
|
} |
||||
|
|
||||
|
public Long getEndTime() { |
||||
|
return endTime; |
||||
|
} |
||||
|
|
||||
|
public void setEndTime(Long endTime) { |
||||
|
this.endTime = endTime; |
||||
|
} |
||||
|
|
||||
|
public Byte getIsDemo() { |
||||
|
return isDemo; |
||||
|
} |
||||
|
|
||||
|
public void setIsDemo(Byte isDemo) { |
||||
|
this.isDemo = isDemo; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
public Byte getBindingStatus() { |
||||
|
return bindingStatus; |
||||
|
} |
||||
|
|
||||
|
public void setBindingStatus(Byte bindingStatus) { |
||||
|
this.bindingStatus = bindingStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", patientId=").append(patientId); |
||||
|
sb.append(", taskSubId=").append(taskSubId); |
||||
|
sb.append(", carId=").append(carId); |
||||
|
sb.append(", startTime=").append(startTime); |
||||
|
sb.append(", endTime=").append(endTime); |
||||
|
sb.append(", isDemo=").append(isDemo); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append(", bindingStatus=").append(bindingStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,861 @@ |
|||||
|
package com.ccsens.wisdomcar.bean.po; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class PatientWisdomCarExample { |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
protected boolean distinct; |
||||
|
|
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public PatientWisdomCarExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria or() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
oredCriteria.add(criteria); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected Criteria createCriteriaInternal() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
protected abstract static class GeneratedCriteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected GeneratedCriteria() { |
||||
|
super(); |
||||
|
criteria = new ArrayList<Criterion>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getAllCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
if (condition == null) { |
||||
|
throw new RuntimeException("Value for condition cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value, String property) { |
||||
|
if (value == null) { |
||||
|
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
|
if (value1 == null || value2 == null) { |
||||
|
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNull() { |
||||
|
addCriterion("id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNotNull() { |
||||
|
addCriterion("id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdEqualTo(Long value) { |
||||
|
addCriterion("id =", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotEqualTo(Long value) { |
||||
|
addCriterion("id <>", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThan(Long value) { |
||||
|
addCriterion("id >", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("id >=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThan(Long value) { |
||||
|
addCriterion("id <", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("id <=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIn(List<Long> values) { |
||||
|
addCriterion("id in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotIn(List<Long> values) { |
||||
|
addCriterion("id not in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("id between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("id not between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdIsNull() { |
||||
|
addCriterion("patient_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdIsNotNull() { |
||||
|
addCriterion("patient_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdEqualTo(Long value) { |
||||
|
addCriterion("patient_id =", value, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdNotEqualTo(Long value) { |
||||
|
addCriterion("patient_id <>", value, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdGreaterThan(Long value) { |
||||
|
addCriterion("patient_id >", value, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("patient_id >=", value, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdLessThan(Long value) { |
||||
|
addCriterion("patient_id <", value, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("patient_id <=", value, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdIn(List<Long> values) { |
||||
|
addCriterion("patient_id in", values, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdNotIn(List<Long> values) { |
||||
|
addCriterion("patient_id not in", values, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("patient_id between", value1, value2, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPatientIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("patient_id not between", value1, value2, "patientId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdIsNull() { |
||||
|
addCriterion("task_sub_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdIsNotNull() { |
||||
|
addCriterion("task_sub_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdEqualTo(Long value) { |
||||
|
addCriterion("task_sub_id =", value, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdNotEqualTo(Long value) { |
||||
|
addCriterion("task_sub_id <>", value, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdGreaterThan(Long value) { |
||||
|
addCriterion("task_sub_id >", value, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("task_sub_id >=", value, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdLessThan(Long value) { |
||||
|
addCriterion("task_sub_id <", value, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("task_sub_id <=", value, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdIn(List<Long> values) { |
||||
|
addCriterion("task_sub_id in", values, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdNotIn(List<Long> values) { |
||||
|
addCriterion("task_sub_id not in", values, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("task_sub_id between", value1, value2, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andTaskSubIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("task_sub_id not between", value1, value2, "taskSubId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdIsNull() { |
||||
|
addCriterion("car_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdIsNotNull() { |
||||
|
addCriterion("car_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdEqualTo(Long value) { |
||||
|
addCriterion("car_id =", value, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdNotEqualTo(Long value) { |
||||
|
addCriterion("car_id <>", value, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdGreaterThan(Long value) { |
||||
|
addCriterion("car_id >", value, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("car_id >=", value, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdLessThan(Long value) { |
||||
|
addCriterion("car_id <", value, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("car_id <=", value, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdIn(List<Long> values) { |
||||
|
addCriterion("car_id in", values, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdNotIn(List<Long> values) { |
||||
|
addCriterion("car_id not in", values, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("car_id between", value1, value2, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCarIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("car_id not between", value1, value2, "carId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeIsNull() { |
||||
|
addCriterion("start_time is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeIsNotNull() { |
||||
|
addCriterion("start_time is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeEqualTo(Long value) { |
||||
|
addCriterion("start_time =", value, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeNotEqualTo(Long value) { |
||||
|
addCriterion("start_time <>", value, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeGreaterThan(Long value) { |
||||
|
addCriterion("start_time >", value, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("start_time >=", value, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeLessThan(Long value) { |
||||
|
addCriterion("start_time <", value, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("start_time <=", value, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeIn(List<Long> values) { |
||||
|
addCriterion("start_time in", values, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeNotIn(List<Long> values) { |
||||
|
addCriterion("start_time not in", values, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeBetween(Long value1, Long value2) { |
||||
|
addCriterion("start_time between", value1, value2, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andStartTimeNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("start_time not between", value1, value2, "startTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeIsNull() { |
||||
|
addCriterion("end_time is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeIsNotNull() { |
||||
|
addCriterion("end_time is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeEqualTo(Long value) { |
||||
|
addCriterion("end_time =", value, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeNotEqualTo(Long value) { |
||||
|
addCriterion("end_time <>", value, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeGreaterThan(Long value) { |
||||
|
addCriterion("end_time >", value, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("end_time >=", value, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeLessThan(Long value) { |
||||
|
addCriterion("end_time <", value, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("end_time <=", value, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeIn(List<Long> values) { |
||||
|
addCriterion("end_time in", values, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeNotIn(List<Long> values) { |
||||
|
addCriterion("end_time not in", values, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeBetween(Long value1, Long value2) { |
||||
|
addCriterion("end_time between", value1, value2, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andEndTimeNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("end_time not between", value1, value2, "endTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoIsNull() { |
||||
|
addCriterion("is_demo is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoIsNotNull() { |
||||
|
addCriterion("is_demo is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoEqualTo(Byte value) { |
||||
|
addCriterion("is_demo =", value, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoNotEqualTo(Byte value) { |
||||
|
addCriterion("is_demo <>", value, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoGreaterThan(Byte value) { |
||||
|
addCriterion("is_demo >", value, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("is_demo >=", value, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoLessThan(Byte value) { |
||||
|
addCriterion("is_demo <", value, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("is_demo <=", value, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoIn(List<Byte> values) { |
||||
|
addCriterion("is_demo in", values, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoNotIn(List<Byte> values) { |
||||
|
addCriterion("is_demo not in", values, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("is_demo between", value1, value2, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIsDemoNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("is_demo not between", value1, value2, "isDemo"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNull() { |
||||
|
addCriterion("created_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNotNull() { |
||||
|
addCriterion("created_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtEqualTo(Date value) { |
||||
|
addCriterion("created_at =", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("created_at <>", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThan(Date value) { |
||||
|
addCriterion("created_at >", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at >=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThan(Date value) { |
||||
|
addCriterion("created_at <", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at <=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIn(List<Date> values) { |
||||
|
addCriterion("created_at in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("created_at not in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at not between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNull() { |
||||
|
addCriterion("updated_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNotNull() { |
||||
|
addCriterion("updated_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtEqualTo(Date value) { |
||||
|
addCriterion("updated_at =", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("updated_at <>", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThan(Date value) { |
||||
|
addCriterion("updated_at >", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at >=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThan(Date value) { |
||||
|
addCriterion("updated_at <", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at <=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIn(List<Date> values) { |
||||
|
addCriterion("updated_at in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("updated_at not in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNull() { |
||||
|
addCriterion("rec_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNotNull() { |
||||
|
addCriterion("rec_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusEqualTo(Byte value) { |
||||
|
addCriterion("rec_status =", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <>", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThan(Byte value) { |
||||
|
addCriterion("rec_status >", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status >=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThan(Byte value) { |
||||
|
addCriterion("rec_status <", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIn(List<Byte> values) { |
||||
|
addCriterion("rec_status in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("rec_status not in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status not between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusIsNull() { |
||||
|
addCriterion("binding_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusIsNotNull() { |
||||
|
addCriterion("binding_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusEqualTo(Byte value) { |
||||
|
addCriterion("binding_status =", value, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("binding_status <>", value, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusGreaterThan(Byte value) { |
||||
|
addCriterion("binding_status >", value, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("binding_status >=", value, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusLessThan(Byte value) { |
||||
|
addCriterion("binding_status <", value, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("binding_status <=", value, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusIn(List<Byte> values) { |
||||
|
addCriterion("binding_status in", values, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("binding_status not in", values, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("binding_status between", value1, value2, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBindingStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("binding_status not between", value1, value2, "bindingStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criteria extends GeneratedCriteria { |
||||
|
|
||||
|
protected Criteria() { |
||||
|
super(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criterion { |
||||
|
private String condition; |
||||
|
|
||||
|
private Object value; |
||||
|
|
||||
|
private Object secondValue; |
||||
|
|
||||
|
private boolean noValue; |
||||
|
|
||||
|
private boolean singleValue; |
||||
|
|
||||
|
private boolean betweenValue; |
||||
|
|
||||
|
private boolean listValue; |
||||
|
|
||||
|
private String typeHandler; |
||||
|
|
||||
|
public String getCondition() { |
||||
|
return condition; |
||||
|
} |
||||
|
|
||||
|
public Object getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public Object getSecondValue() { |
||||
|
return secondValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isNoValue() { |
||||
|
return noValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isSingleValue() { |
||||
|
return singleValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isBetweenValue() { |
||||
|
return betweenValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isListValue() { |
||||
|
return listValue; |
||||
|
} |
||||
|
|
||||
|
public String getTypeHandler() { |
||||
|
return typeHandler; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.typeHandler = null; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.typeHandler = typeHandler; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this(condition, value, null); |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.typeHandler = typeHandler; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this(condition, value, secondValue, null); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.ccsens.wisdomcar.persist.dao; |
||||
|
|
||||
|
import com.ccsens.wisdomcar.bean.vo.WisdomCarVo; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author whj |
||||
|
*/ |
||||
|
public interface WisdomCarDao { |
||||
|
/** |
||||
|
* 查询空闲平车 |
||||
|
* @param hospitalId 医院ID |
||||
|
* @return 空闲平车 |
||||
|
*/ |
||||
|
List<WisdomCarVo.FreeCar> queryFreeCar(@Param("hospitalId") Long hospitalId); |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.wisdomcar.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.wisdomcar.bean.po.PatientWisdomCar; |
||||
|
import com.ccsens.wisdomcar.bean.po.PatientWisdomCarExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface PatientWisdomCarMapper { |
||||
|
long countByExample(PatientWisdomCarExample example); |
||||
|
|
||||
|
int deleteByExample(PatientWisdomCarExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(PatientWisdomCar record); |
||||
|
|
||||
|
int insertSelective(PatientWisdomCar record); |
||||
|
|
||||
|
List<PatientWisdomCar> selectByExample(PatientWisdomCarExample example); |
||||
|
|
||||
|
PatientWisdomCar selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") PatientWisdomCar record, @Param("example") PatientWisdomCarExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") PatientWisdomCar record, @Param("example") PatientWisdomCarExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(PatientWisdomCar record); |
||||
|
|
||||
|
int updateByPrimaryKey(PatientWisdomCar record); |
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.ccsens.wisdomcar.service; |
||||
|
|
||||
|
import com.ccsens.wisdomcar.bean.dto.ProjectDto; |
||||
|
import com.ccsens.wisdomcar.bean.vo.ProjectVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author whj |
||||
|
*/ |
||||
|
public interface IProjectService { |
||||
|
|
||||
|
/** |
||||
|
* 网页设置结点开始 |
||||
|
* @param param 设置参数 |
||||
|
* @param userId userId |
||||
|
*/ |
||||
|
void start(ProjectDto.Start param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查询称重和剂量 |
||||
|
* @param param param |
||||
|
* @param userId userId |
||||
|
* @return 称重和剂量 |
||||
|
*/ |
||||
|
List<ProjectVo.Record> queryWeight(ProjectDto.Weight param, Long userId); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.ccsens.wisdomcar.service; |
||||
|
|
||||
|
import com.ccsens.wisdomcar.bean.dto.WisdomCarDto; |
||||
|
import com.ccsens.wisdomcar.bean.vo.WisdomCarVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author whj |
||||
|
*/ |
||||
|
public interface IWisdomCarService { |
||||
|
/** |
||||
|
* 查询空闲平车 |
||||
|
* @param param 平车要求,暂无 |
||||
|
* @param userId 用户userId,根据userId查询医院ID |
||||
|
* @return 空闲平车 |
||||
|
*/ |
||||
|
List<WisdomCarVo.FreeCar> queryFreeCar(WisdomCarDto.FreeCar param, Long userId); |
||||
|
} |
||||
@ -0,0 +1,115 @@ |
|||||
|
package com.ccsens.wisdomcar.service; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import com.ccsens.util.CodeEnum; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import com.ccsens.wisdomcar.bean.dto.ProjectDto; |
||||
|
import com.ccsens.wisdomcar.bean.po.*; |
||||
|
import com.ccsens.wisdomcar.bean.vo.ProjectVo; |
||||
|
import com.ccsens.wisdomcar.persist.dao.PatientDataDao; |
||||
|
import com.ccsens.wisdomcar.persist.dao.StepDao; |
||||
|
import com.ccsens.wisdomcar.persist.dao.StepTaskDao; |
||||
|
import com.ccsens.wisdomcar.persist.dao.WisdomCarRecordDao; |
||||
|
import com.ccsens.wisdomcar.persist.mapper.PatientWisdomCarMapper; |
||||
|
import com.ccsens.wisdomcar.util.Constant; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/6/1 21:15 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
||||
|
public class ProjectService implements IProjectService { |
||||
|
@Resource |
||||
|
private StepTaskDao stepTaskDao; |
||||
|
@Resource |
||||
|
private WisdomCarRecordDao wisdomCarRecordDao; |
||||
|
@Resource |
||||
|
private PatientDataDao patientDataDao; |
||||
|
@Resource |
||||
|
private StepDao stepDao; |
||||
|
@Resource |
||||
|
private PatientWisdomCarMapper patientWisdomCarMapper; |
||||
|
@Resource |
||||
|
private Snowflake snowflake; |
||||
|
|
||||
|
@Override |
||||
|
public void start(ProjectDto.Start param, Long userId) { |
||||
|
StepTaskExample taskExample = new StepTaskExample(); |
||||
|
taskExample.createCriteria().andTaskSubIdEqualTo(param.getTaskSubId()); |
||||
|
List<StepTask> stepTasks = stepTaskDao.selectByExample(taskExample); |
||||
|
if (CollectionUtil.isEmpty(stepTasks)) { |
||||
|
log.info("没有找到对应任务的患者信息:{}", param); |
||||
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
||||
|
} |
||||
|
// TODO 待确认,是否处理成已提交不再修改????
|
||||
|
StepTask stepTask = stepTasks.get(0); |
||||
|
PatientDataExample dataExample = new PatientDataExample(); |
||||
|
dataExample.createCriteria().andTaskSubIdEqualTo(param.getTaskSubId()).andStepIdEqualTo(stepTask.getStepId()); |
||||
|
List<PatientData> patientData = patientDataDao.selectByExample(dataExample); |
||||
|
if (CollectionUtil.isNotEmpty(patientData)){ |
||||
|
log.info("taskId:{}, stepId:{}已经存在,不再修改", param.getTaskSubId(), stepTask.getStepId()); |
||||
|
PatientData data = patientData.get(0); |
||||
|
// 未推送
|
||||
|
if (data.getPushStatus() == Constant.PUSH_STATUS_SUCCESS) { |
||||
|
log.info("已推送成功,不处理"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// TODO 异步推送数据 根据结果修改状态
|
||||
|
PatientData updateData = new PatientData(); |
||||
|
updateData.setId(data.getId()); |
||||
|
updateData.setPushStatus(Constant.PUSH_STATUS_SUCCESS); |
||||
|
patientDataDao.updateByPrimaryKeySelective(updateData); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// TODO 判断是否为结束结点
|
||||
|
Step step = stepDao.selectByPrimaryKey(stepTask.getStepId()); |
||||
|
if (true) { |
||||
|
// 修改平车结束时间点
|
||||
|
ProjectVo.BindCar bindCar = stepTaskDao.getBindCarTaskId(param.getTaskSubId()); |
||||
|
if (bindCar == null) { |
||||
|
log.info("出现异常,未找到绑定平车:{}", param.getTaskSubId()); |
||||
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
||||
|
} |
||||
|
PatientWisdomCar patientWisdomCar = new PatientWisdomCar(); |
||||
|
patientWisdomCar.setId(bindCar.getId()); |
||||
|
patientWisdomCar.setEndTime(param.getStartTime()); |
||||
|
patientWisdomCarMapper.updateByPrimaryKeySelective(patientWisdomCar); |
||||
|
} |
||||
|
|
||||
|
PatientData data = new PatientData(); |
||||
|
data.setId(snowflake.nextId()); |
||||
|
data.setUserId(userId); |
||||
|
data.setTaskSubId(param.getTaskSubId()); |
||||
|
data.setStepId(stepTask.getStepId()); |
||||
|
data.setPushStatus(Constant.PUSH_STATUS_NO); |
||||
|
data.setStartTime(param.getStartTime()); |
||||
|
data.setType(Constant.OPERATION_USER); |
||||
|
patientDataDao.insertSelective(data); |
||||
|
// TODO 异步推送数据 根据结果修改状态
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<ProjectVo.Record> queryWeight(ProjectDto.Weight param, Long userId) { |
||||
|
ProjectVo.BindCar bindCar = stepTaskDao.getBindCarTaskId(param.getTaskSubId()); |
||||
|
if (bindCar == null) { |
||||
|
log.info("没有找到绑定的平车信息:{},userId:{}", param, userId); |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
return wisdomCarRecordDao.queryRecent(bindCar.getCarId(), bindCar.getStartTime(), bindCar.getEndTime(), (byte)1,(byte)8,(byte)9,(byte)10); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
package com.ccsens.wisdomcar.service; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import com.ccsens.wisdomcar.bean.dto.WisdomCarDto; |
||||
|
import com.ccsens.wisdomcar.bean.po.HospitalMember; |
||||
|
import com.ccsens.wisdomcar.bean.po.HospitalMemberExample; |
||||
|
import com.ccsens.wisdomcar.bean.vo.WisdomCarVo; |
||||
|
import com.ccsens.wisdomcar.persist.dao.HospitalMemberDao; |
||||
|
import com.ccsens.wisdomcar.persist.dao.WisdomCarDao; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/6/1 21:17 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
||||
|
public class WisdomCarService implements IWisdomCarService { |
||||
|
|
||||
|
@Resource |
||||
|
private WisdomCarDao wisdomcarDao; |
||||
|
@Resource |
||||
|
private HospitalMemberDao hospitalMemberDao; |
||||
|
|
||||
|
@Override |
||||
|
public List<WisdomCarVo.FreeCar> queryFreeCar(WisdomCarDto.FreeCar param, Long userId) { |
||||
|
HospitalMemberExample example = new HospitalMemberExample(); |
||||
|
example.createCriteria().andUserIdEqualTo(userId); |
||||
|
List<HospitalMember> hospitalMembers = hospitalMemberDao.selectByExample(example); |
||||
|
if (CollectionUtil.isEmpty(hospitalMembers)) { |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
Long hospitalId = hospitalMembers.get(0).getHospitalId(); |
||||
|
return wisdomcarDao.queryFreeCar(hospitalId); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.wisdomcar.persist.dao.WisdomCarDao"> |
||||
|
|
||||
|
<select id="queryFreeCar" resultType="com.ccsens.wisdomcar.bean.vo.WisdomCarVo$FreeCar"> |
||||
|
( SELECT id, car_number FROM t_wisdom_car WHERE hospital_id = #{hospitalId} AND rec_status = 0 ) EXCEPT |
||||
|
( |
||||
|
SELECT |
||||
|
c.id, |
||||
|
c.car_number |
||||
|
FROM |
||||
|
t_patient_wisdom_car pc, |
||||
|
t_wisdom_car c |
||||
|
WHERE |
||||
|
pc.car_id = c.id |
||||
|
AND c.hospital_id = #{hospitalId} |
||||
|
AND pc.end_time = 0 |
||||
|
AND pc.start_time >= ( unix_timestamp( ) - 2 * 60 * 60 ) * 1000 |
||||
|
AND pc.rec_status = 0 |
||||
|
AND c.rec_status = 0 |
||||
|
) |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,306 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.wisdomcar.persist.mapper.PatientWisdomCarMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.wisdomcar.bean.po.PatientWisdomCar"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="patient_id" jdbcType="BIGINT" property="patientId" /> |
||||
|
<result column="task_sub_id" jdbcType="BIGINT" property="taskSubId" /> |
||||
|
<result column="car_id" jdbcType="BIGINT" property="carId" /> |
||||
|
<result column="start_time" jdbcType="BIGINT" property="startTime" /> |
||||
|
<result column="end_time" jdbcType="BIGINT" property="endTime" /> |
||||
|
<result column="is_demo" jdbcType="TINYINT" property="isDemo" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
<result column="binding_status" jdbcType="TINYINT" property="bindingStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, patient_id, task_sub_id, car_id, start_time, end_time, is_demo, created_at, updated_at, |
||||
|
rec_status, binding_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCarExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_patient_wisdom_car |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_patient_wisdom_car |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_patient_wisdom_car |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCarExample"> |
||||
|
delete from t_patient_wisdom_car |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCar"> |
||||
|
insert into t_patient_wisdom_car (id, patient_id, task_sub_id, |
||||
|
car_id, start_time, end_time, |
||||
|
is_demo, created_at, updated_at, |
||||
|
rec_status, binding_status) |
||||
|
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{taskSubId,jdbcType=BIGINT}, |
||||
|
#{carId,jdbcType=BIGINT}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, |
||||
|
#{isDemo,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
#{recStatus,jdbcType=TINYINT}, #{bindingStatus,jdbcType=TINYINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCar"> |
||||
|
insert into t_patient_wisdom_car |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="patientId != null"> |
||||
|
patient_id, |
||||
|
</if> |
||||
|
<if test="taskSubId != null"> |
||||
|
task_sub_id, |
||||
|
</if> |
||||
|
<if test="carId != null"> |
||||
|
car_id, |
||||
|
</if> |
||||
|
<if test="startTime != null"> |
||||
|
start_time, |
||||
|
</if> |
||||
|
<if test="endTime != null"> |
||||
|
end_time, |
||||
|
</if> |
||||
|
<if test="isDemo != null"> |
||||
|
is_demo, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
<if test="bindingStatus != null"> |
||||
|
binding_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="patientId != null"> |
||||
|
#{patientId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="taskSubId != null"> |
||||
|
#{taskSubId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="carId != null"> |
||||
|
#{carId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="startTime != null"> |
||||
|
#{startTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="endTime != null"> |
||||
|
#{endTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="isDemo != null"> |
||||
|
#{isDemo,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="bindingStatus != null"> |
||||
|
#{bindingStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCarExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_patient_wisdom_car |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_patient_wisdom_car |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.patientId != null"> |
||||
|
patient_id = #{record.patientId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.taskSubId != null"> |
||||
|
task_sub_id = #{record.taskSubId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.carId != null"> |
||||
|
car_id = #{record.carId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.startTime != null"> |
||||
|
start_time = #{record.startTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.endTime != null"> |
||||
|
end_time = #{record.endTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.isDemo != null"> |
||||
|
is_demo = #{record.isDemo,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.bindingStatus != null"> |
||||
|
binding_status = #{record.bindingStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_patient_wisdom_car |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
patient_id = #{record.patientId,jdbcType=BIGINT}, |
||||
|
task_sub_id = #{record.taskSubId,jdbcType=BIGINT}, |
||||
|
car_id = #{record.carId,jdbcType=BIGINT}, |
||||
|
start_time = #{record.startTime,jdbcType=BIGINT}, |
||||
|
end_time = #{record.endTime,jdbcType=BIGINT}, |
||||
|
is_demo = #{record.isDemo,jdbcType=TINYINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
binding_status = #{record.bindingStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCar"> |
||||
|
update t_patient_wisdom_car |
||||
|
<set> |
||||
|
<if test="patientId != null"> |
||||
|
patient_id = #{patientId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="taskSubId != null"> |
||||
|
task_sub_id = #{taskSubId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="carId != null"> |
||||
|
car_id = #{carId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="startTime != null"> |
||||
|
start_time = #{startTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="endTime != null"> |
||||
|
end_time = #{endTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="isDemo != null"> |
||||
|
is_demo = #{isDemo,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="bindingStatus != null"> |
||||
|
binding_status = #{bindingStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCar"> |
||||
|
update t_patient_wisdom_car |
||||
|
set patient_id = #{patientId,jdbcType=BIGINT}, |
||||
|
task_sub_id = #{taskSubId,jdbcType=BIGINT}, |
||||
|
car_id = #{carId,jdbcType=BIGINT}, |
||||
|
start_time = #{startTime,jdbcType=BIGINT}, |
||||
|
end_time = #{endTime,jdbcType=BIGINT}, |
||||
|
is_demo = #{isDemo,jdbcType=TINYINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
binding_status = #{bindingStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue