diff --git a/configs b/configs index 940b8339b..14eb3d5ff 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 940b8339b74c296bb48992643e83be28f084d952 +Subproject commit 14eb3d5ffab421208f131d98edbd05de135fe1a7 diff --git a/pom.xml b/pom.xml index e6708f154..aaf1ad641 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ opensrp-server-core jar - 2.12.15-SNAPSHOT + 2.12.16-SNAPSHOT opensrp-server-core OpenSRP Server Core module https://github.com/OpenSRP/opensrp-server-core diff --git a/src/main/java/org/opensrp/domain/ActionTemplate.java b/src/main/java/org/opensrp/domain/ActionTemplate.java new file mode 100644 index 000000000..cdb41f030 --- /dev/null +++ b/src/main/java/org/opensrp/domain/ActionTemplate.java @@ -0,0 +1,64 @@ +package org.opensrp.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import org.smartregister.domain.Condition; +import org.smartregister.domain.DynamicValue; +import org.smartregister.domain.Trigger; + +import java.io.Serializable; +import java.util.Set; + +@Getter +@Setter +@AllArgsConstructor +public class ActionTemplate implements Serializable { + private static final long serialVersionUID = 1L; + private String identifier; + private int prefix; + private String title; + private String description; + private String code; + private PeriodTemplate timingPeriod; + private String reason; + private String goalId; + private ActionTemplate.SubjectConcept subjectCodableConcept; + private String taskTemplate; + private Set trigger; + private Set condition; + private String definitionUri; + private Set dynamicValue; + private ActionTemplate.ActionType type; + + public ActionTemplate() { + this.type = ActionTemplate.ActionType.CREATE; + } + + @Getter + @Setter + @AllArgsConstructor + public static class SubjectConcept implements Serializable { + private String text; + + + } + + public static enum ActionType { + @JsonProperty("create") + @SerializedName("create") + CREATE, + @JsonProperty("update") + @SerializedName("update") + UPDATE, + @JsonProperty("remove") + @SerializedName("remove") + REMOVE, + @JsonProperty("fire-event") + @SerializedName("fire-event") + FIRE_EVENT; + + } +} diff --git a/src/main/java/org/opensrp/domain/GoalTemplate.java b/src/main/java/org/opensrp/domain/GoalTemplate.java new file mode 100644 index 000000000..8cf41b5b7 --- /dev/null +++ b/src/main/java/org/opensrp/domain/GoalTemplate.java @@ -0,0 +1,27 @@ +package org.opensrp.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.io.Serializable; +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class GoalTemplate implements Serializable { + + private static final long serialVersionUID = 1L; + private String id; + private String description; + private String priority; + @JsonProperty("target") + @SerializedName("target") + private List targets; + +} diff --git a/src/main/java/org/opensrp/domain/PeriodTemplate.java b/src/main/java/org/opensrp/domain/PeriodTemplate.java new file mode 100644 index 000000000..b48d81eb1 --- /dev/null +++ b/src/main/java/org/opensrp/domain/PeriodTemplate.java @@ -0,0 +1,26 @@ +package org.opensrp.domain; + +import java.io.Serializable; + +public class PeriodTemplate implements Serializable { + + private static final long serialVersionUID = 1L; + private String start; + private String end; + + public String getStart() { + return start; + } + + public void setStart(String start) { + this.start = start; + } + + public String getEnd() { + return end; + } + + public void setEnd(String end) { + this.end = end; + } +} diff --git a/src/main/java/org/opensrp/domain/PlanTemplate.java b/src/main/java/org/opensrp/domain/PlanTemplate.java new file mode 100644 index 000000000..21d4e08aa --- /dev/null +++ b/src/main/java/org/opensrp/domain/PlanTemplate.java @@ -0,0 +1,102 @@ +package org.opensrp.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.smartregister.domain.Jurisdiction; +import org.smartregister.domain.PlanDefinition; + +import java.io.Serializable; +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class PlanTemplate implements Serializable { + + private static final long serialVersionUID = 1L; + @JsonProperty + private String identifier; + @JsonProperty + private String description; + @JsonProperty + private String version; + @JsonProperty + private String name; + @JsonProperty + private String title; + @JsonProperty + private String status; + @JsonProperty + private String date; + @JsonProperty + private PeriodTemplate effectivePeriod; + @JsonProperty + private List useContext; + @JsonProperty + private List jurisdiction; + private Long serverVersion; + @JsonProperty("goal") + @SerializedName("goal") + private List goals; + @JsonProperty("action") + @SerializedName("action") + private List actions; + @JsonProperty + private boolean experimental; + + public int compareTo(PlanDefinition o) { + return this.getName().equals(o.getName()) ? this.getName().compareTo(o.getIdentifier()) : this.getName().compareTo(o.getName()); + } + + public static enum PlanStatus { + @SerializedName("draft") + DRAFT("draft"), + @SerializedName("active") + ACTIVE("active"), + @SerializedName("retired") + RETIRED("retired"), + @SerializedName("complete") + COMPLETED("complete"), + @SerializedName("unknown") + UNKNOWN("unknown"); + + private final String value; + + private PlanStatus(String value) { + this.value = value; + } + + public String value() { + return this.value; + } + + public static PlanTemplate.PlanStatus from(String value) { + PlanTemplate.PlanStatus[] var1 = values(); + int var2 = var1.length; + + for(int var3 = 0; var3 < var2; ++var3) { + PlanTemplate.PlanStatus c = var1[var3]; + if (c.value.equals(value)) { + return c; + } + } + + throw new IllegalArgumentException(value); + } + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class UseContext implements Serializable { + private String code; + private String valueCodableConcept; + + } +} diff --git a/src/main/java/org/opensrp/domain/TargetTemplate.java b/src/main/java/org/opensrp/domain/TargetTemplate.java new file mode 100644 index 000000000..b82240376 --- /dev/null +++ b/src/main/java/org/opensrp/domain/TargetTemplate.java @@ -0,0 +1,61 @@ +package org.opensrp.domain; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.io.Serializable; +import java.util.AbstractMap; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class TargetTemplate implements Serializable { + private static final long serialVersionUID = 1L; + private String measure; + private TargetTemplate.Detail detail; + private String due; + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + static class DetailCodableConcept { + private String text; + + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + static class MeasureRange implements Serializable { + private TargetTemplate.Measure high; + private TargetTemplate.Measure low; + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + static class Measure implements Serializable { + private float value; + private String comparator; + private String unit; + + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + static class Detail implements Serializable { + private TargetTemplate.Measure detailQuantity; + private TargetTemplate.MeasureRange detailRange; + private AbstractMap.SimpleEntry detailCodableConcept; + + } + +} diff --git a/src/main/java/org/opensrp/domain/Template.java b/src/main/java/org/opensrp/domain/Template.java new file mode 100644 index 000000000..ece96fddd --- /dev/null +++ b/src/main/java/org/opensrp/domain/Template.java @@ -0,0 +1,49 @@ +package org.opensrp.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.io.Serializable; + +public class Template implements Serializable { + private static final long serialVersionUID = 1L; + @JsonProperty + private Integer templateId; + @JsonProperty + private PlanTemplate template; + @JsonProperty + private String type; + @JsonProperty + private int version; + + public Integer getTemplateId() { + return templateId; + } + + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + public PlanTemplate getTemplate() { + return template; + } + + public void setTemplate(PlanTemplate template) { + this.template = template; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } +} diff --git a/src/main/java/org/opensrp/domain/postgres/PlanProcessingStatus.java b/src/main/java/org/opensrp/domain/postgres/PlanProcessingStatus.java new file mode 100644 index 000000000..e083a5fe3 --- /dev/null +++ b/src/main/java/org/opensrp/domain/postgres/PlanProcessingStatus.java @@ -0,0 +1,236 @@ +package org.opensrp.domain.postgres; + +import java.util.Date; + +public class PlanProcessingStatus { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.plan_processing_status.id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.plan_processing_status.plan_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + private Long planId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.plan_processing_status.event_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + private Long eventId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.plan_processing_status.template_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + private Long templateId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.plan_processing_status.status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + private Integer status; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.plan_processing_status.date_created + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + private Date dateCreated; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.plan_processing_status.date_edited + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + private Date dateEdited; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.plan_processing_status.id + * + * @return the value of core.plan_processing_status.id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.plan_processing_status.id + * + * @param id the value for core.plan_processing_status.id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.plan_processing_status.plan_id + * + * @return the value of core.plan_processing_status.plan_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Long getPlanId() { + return planId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.plan_processing_status.plan_id + * + * @param planId the value for core.plan_processing_status.plan_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setPlanId(Long planId) { + this.planId = planId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.plan_processing_status.event_id + * + * @return the value of core.plan_processing_status.event_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Long getEventId() { + return eventId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.plan_processing_status.event_id + * + * @param eventId the value for core.plan_processing_status.event_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setEventId(Long eventId) { + this.eventId = eventId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.plan_processing_status.template_id + * + * @return the value of core.plan_processing_status.template_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Long getTemplateId() { + return templateId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.plan_processing_status.template_id + * + * @param templateId the value for core.plan_processing_status.template_id + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.plan_processing_status.status + * + * @return the value of core.plan_processing_status.status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Integer getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.plan_processing_status.status + * + * @param status the value for core.plan_processing_status.status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.plan_processing_status.date_created + * + * @return the value of core.plan_processing_status.date_created + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.plan_processing_status.date_created + * + * @param dateCreated the value for core.plan_processing_status.date_created + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.plan_processing_status.date_edited + * + * @return the value of core.plan_processing_status.date_edited + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.plan_processing_status.date_edited + * + * @param dateEdited the value for core.plan_processing_status.date_edited + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } +} \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/PlanProcessingStatusExample.java b/src/main/java/org/opensrp/domain/postgres/PlanProcessingStatusExample.java new file mode 100644 index 000000000..6ea3f7039 --- /dev/null +++ b/src/main/java/org/opensrp/domain/postgres/PlanProcessingStatusExample.java @@ -0,0 +1,722 @@ +package org.opensrp.domain.postgres; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class PlanProcessingStatusExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public PlanProcessingStatusExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("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 IllegalArgumentException("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 IllegalArgumentException("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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andPlanIdIsNull() { + addCriterion("plan_id is null"); + return (Criteria) this; + } + + public Criteria andPlanIdIsNotNull() { + addCriterion("plan_id is not null"); + return (Criteria) this; + } + + public Criteria andPlanIdEqualTo(Long value) { + addCriterion("plan_id =", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotEqualTo(Long value) { + addCriterion("plan_id <>", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdGreaterThan(Long value) { + addCriterion("plan_id >", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdGreaterThanOrEqualTo(Long value) { + addCriterion("plan_id >=", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdLessThan(Long value) { + addCriterion("plan_id <", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdLessThanOrEqualTo(Long value) { + addCriterion("plan_id <=", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdIn(List values) { + addCriterion("plan_id in", values, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotIn(List values) { + addCriterion("plan_id not in", values, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdBetween(Long value1, Long value2) { + addCriterion("plan_id between", value1, value2, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotBetween(Long value1, Long value2) { + addCriterion("plan_id not between", value1, value2, "planId"); + return (Criteria) this; + } + + public Criteria andEventIdIsNull() { + addCriterion("event_id is null"); + return (Criteria) this; + } + + public Criteria andEventIdIsNotNull() { + addCriterion("event_id is not null"); + return (Criteria) this; + } + + public Criteria andEventIdEqualTo(Long value) { + addCriterion("event_id =", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdNotEqualTo(Long value) { + addCriterion("event_id <>", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdGreaterThan(Long value) { + addCriterion("event_id >", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdGreaterThanOrEqualTo(Long value) { + addCriterion("event_id >=", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdLessThan(Long value) { + addCriterion("event_id <", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdLessThanOrEqualTo(Long value) { + addCriterion("event_id <=", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdIn(List values) { + addCriterion("event_id in", values, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdNotIn(List values) { + addCriterion("event_id not in", values, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdBetween(Long value1, Long value2) { + addCriterion("event_id between", value1, value2, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdNotBetween(Long value1, Long value2) { + addCriterion("event_id not between", value1, value2, "eventId"); + return (Criteria) this; + } + + public Criteria andTemplateIdIsNull() { + addCriterion("template_id is null"); + return (Criteria) this; + } + + public Criteria andTemplateIdIsNotNull() { + addCriterion("template_id is not null"); + return (Criteria) this; + } + + public Criteria andTemplateIdEqualTo(Long value) { + addCriterion("template_id =", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdNotEqualTo(Long value) { + addCriterion("template_id <>", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdGreaterThan(Long value) { + addCriterion("template_id >", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdGreaterThanOrEqualTo(Long value) { + addCriterion("template_id >=", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdLessThan(Long value) { + addCriterion("template_id <", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdLessThanOrEqualTo(Long value) { + addCriterion("template_id <=", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdIn(List values) { + addCriterion("template_id in", values, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdNotIn(List values) { + addCriterion("template_id not in", values, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdBetween(Long value1, Long value2) { + addCriterion("template_id between", value1, value2, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdNotBetween(Long value1, Long value2) { + addCriterion("template_id not between", value1, value2, "templateId"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.plan_processing_status + * + * @mbg.generated do_not_delete_during_merge Sat Sep 11 11:04:03 EAT 2021 + */ + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.plan_processing_status + * + * @mbg.generated Sat Sep 11 11:04:03 EAT 2021 + */ + 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); + } + } +} \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/Template.java b/src/main/java/org/opensrp/domain/postgres/Template.java new file mode 100644 index 000000000..ab5dc0de7 --- /dev/null +++ b/src/main/java/org/opensrp/domain/postgres/Template.java @@ -0,0 +1,236 @@ +package org.opensrp.domain.postgres; + +import java.util.Date; + +public class Template { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.template.id + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.template.template_id + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + private Integer templateId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.template.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + private Object template; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.template.type + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + private String type; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.template.version + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + private Integer version; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.template.date_created + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + private Date dateCreated; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.template.date_edited + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + private Date dateEdited; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.template.id + * + * @return the value of core.template.id + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.template.id + * + * @param id the value for core.template.id + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.template.template_id + * + * @return the value of core.template.template_id + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Integer getTemplateId() { + return templateId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.template.template_id + * + * @param templateId the value for core.template.template_id + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.template.template + * + * @return the value of core.template.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Object getTemplate() { + return template; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.template.template + * + * @param template the value for core.template.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setTemplate(Object template) { + this.template = template; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.template.type + * + * @return the value of core.template.type + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public String getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.template.type + * + * @param type the value for core.template.type + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setType(String type) { + this.type = type; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.template.version + * + * @return the value of core.template.version + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Integer getVersion() { + return version; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.template.version + * + * @param version the value for core.template.version + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setVersion(Integer version) { + this.version = version; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.template.date_created + * + * @return the value of core.template.date_created + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.template.date_created + * + * @param dateCreated the value for core.template.date_created + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.template.date_edited + * + * @return the value of core.template.date_edited + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.template.date_edited + * + * @param dateEdited the value for core.template.date_edited + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } +} \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/TemplateExample.java b/src/main/java/org/opensrp/domain/postgres/TemplateExample.java new file mode 100644 index 000000000..6f0f3b519 --- /dev/null +++ b/src/main/java/org/opensrp/domain/postgres/TemplateExample.java @@ -0,0 +1,766 @@ +package org.opensrp.domain.postgres; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class TemplateExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public TemplateExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + protected abstract static class GeneratedCriteria { + protected List templateCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + templateCriteria = new ArrayList<>(); + } + + public List getTemplateCriteria() { + return templateCriteria; + } + + protected void addTemplateCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + templateCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.TemplateTypeHandler")); + allCriteria = null; + } + + protected void addTemplateCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + templateCriteria.add(new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.TemplateTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 + || templateCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(templateCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andTemplateIdIsNull() { + addCriterion("template_id is null"); + return (Criteria) this; + } + + public Criteria andTemplateIdIsNotNull() { + addCriterion("template_id is not null"); + return (Criteria) this; + } + + public Criteria andTemplateIdEqualTo(Integer value) { + addCriterion("template_id =", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdNotEqualTo(Integer value) { + addCriterion("template_id <>", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdGreaterThan(Integer value) { + addCriterion("template_id >", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdGreaterThanOrEqualTo(Integer value) { + addCriterion("template_id >=", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdLessThan(Integer value) { + addCriterion("template_id <", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdLessThanOrEqualTo(Integer value) { + addCriterion("template_id <=", value, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdIn(List values) { + addCriterion("template_id in", values, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdNotIn(List values) { + addCriterion("template_id not in", values, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdBetween(Integer value1, Integer value2) { + addCriterion("template_id between", value1, value2, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIdNotBetween(Integer value1, Integer value2) { + addCriterion("template_id not between", value1, value2, "templateId"); + return (Criteria) this; + } + + public Criteria andTemplateIsNull() { + addCriterion("template is null"); + return (Criteria) this; + } + + public Criteria andTemplateIsNotNull() { + addCriterion("template is not null"); + return (Criteria) this; + } + + public Criteria andTemplateEqualTo(Object value) { + addTemplateCriterion("template =", value, "template"); + return (Criteria) this; + } + + public Criteria andTemplateNotEqualTo(Object value) { + addTemplateCriterion("template <>", value, "template"); + return (Criteria) this; + } + + public Criteria andTemplateGreaterThan(Object value) { + addTemplateCriterion("template >", value, "template"); + return (Criteria) this; + } + + public Criteria andTemplateGreaterThanOrEqualTo(Object value) { + addTemplateCriterion("template >=", value, "template"); + return (Criteria) this; + } + + public Criteria andTemplateLessThan(Object value) { + addTemplateCriterion("template <", value, "template"); + return (Criteria) this; + } + + public Criteria andTemplateLessThanOrEqualTo(Object value) { + addTemplateCriterion("template <=", value, "template"); + return (Criteria) this; + } + + public Criteria andTemplateIn(List values) { + addTemplateCriterion("template in", values, "template"); + return (Criteria) this; + } + + public Criteria andTemplateNotIn(List values) { + addTemplateCriterion("template not in", values, "template"); + return (Criteria) this; + } + + public Criteria andTemplateBetween(Object value1, Object value2) { + addTemplateCriterion("template between", value1, value2, "template"); + return (Criteria) this; + } + + public Criteria andTemplateNotBetween(Object value1, Object value2) { + addTemplateCriterion("template not between", value1, value2, "template"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andVersionIsNull() { + addCriterion("version is null"); + return (Criteria) this; + } + + public Criteria andVersionIsNotNull() { + addCriterion("version is not null"); + return (Criteria) this; + } + + public Criteria andVersionEqualTo(Integer value) { + addCriterion("version =", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotEqualTo(Integer value) { + addCriterion("version <>", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThan(Integer value) { + addCriterion("version >", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThanOrEqualTo(Integer value) { + addCriterion("version >=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThan(Integer value) { + addCriterion("version <", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThanOrEqualTo(Integer value) { + addCriterion("version <=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionIn(List values) { + addCriterion("version in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotIn(List values) { + addCriterion("version not in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionBetween(Integer value1, Integer value2) { + addCriterion("version between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotBetween(Integer value1, Integer value2) { + addCriterion("version not between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.template + * + * @mbg.generated do_not_delete_during_merge Fri Oct 08 06:04:03 EAT 2021 + */ + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.template + * + * @mbg.generated Fri Oct 08 06:04:03 EAT 2021 + */ + 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); + } + } +} \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/EventsRepository.java b/src/main/java/org/opensrp/repository/EventsRepository.java index 91db455f3..8ad0cdb6d 100644 --- a/src/main/java/org/opensrp/repository/EventsRepository.java +++ b/src/main/java/org/opensrp/repository/EventsRepository.java @@ -104,5 +104,9 @@ Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, * @return true if exists else false */ boolean checkEventExists(@NonNull String caseNumber, @NonNull String flag); + + Event findByDbId(Long id, boolean includeArchived); + + org.opensrp.domain.postgres.Event getDbEventByIdentifier(String identifier); } diff --git a/src/main/java/org/opensrp/repository/PlanProcessingStatusRepository.java b/src/main/java/org/opensrp/repository/PlanProcessingStatusRepository.java new file mode 100644 index 000000000..ef96abbd3 --- /dev/null +++ b/src/main/java/org/opensrp/repository/PlanProcessingStatusRepository.java @@ -0,0 +1,18 @@ +package org.opensrp.repository; + +import org.opensrp.domain.postgres.PlanProcessingStatus; + +import java.util.List; + +public interface PlanProcessingStatusRepository extends BaseRepository { + + PlanProcessingStatus getByPrimaryKey(Long id); + + PlanProcessingStatus getByEventId(Long eventId); + + List getByStatus(Integer status); + + void addPlanProcessingStatus(String eventIdentifier, int status); + + void updatePlanProcessingStatus(PlanProcessingStatus planProcessingStatus, String eventIdentifier, String planIdentifier, int status); +} diff --git a/src/main/java/org/opensrp/repository/TemplateRepository.java b/src/main/java/org/opensrp/repository/TemplateRepository.java new file mode 100644 index 000000000..189d4f12f --- /dev/null +++ b/src/main/java/org/opensrp/repository/TemplateRepository.java @@ -0,0 +1,16 @@ +package org.opensrp.repository; + +import org.opensrp.domain.Template; + +import java.util.List; + +public interface TemplateRepository extends BaseRepository