Commit c8dff18e authored by neo's avatar neo

[dev] fix query result sql alias to entity properties

parent 37cd797e
......@@ -113,7 +113,7 @@ public interface CellDataMapper extends MyVatMapper {
@Select("<script>" +
"SELECT " +
" r.period, c.cell_template_id, data " +
" r.period, c.cell_template_id as cellTemplateId, data " +
"FROM " +
" cell_data c, " +
" report r " +
......
......@@ -7,6 +7,27 @@ public class PCTEntity {
Long cellTemplateId;
BigDecimal data;
public PCTEntity() {
}
public PCTEntity(String pctStr) {
String[] pct = pctStr.split(":");
this.period = Integer.parseInt(pct[0]);
this.cellTemplateId = Long.parseLong(pct[1]);
}
@Override
public int hashCode() {
return (period + "" + cellTemplateId).hashCode();
}
@Override
public boolean equals(Object obj) {
PCTEntity target = (PCTEntity) obj;
return period.intValue() == target.period.intValue()
&& cellTemplateId.longValue() == target.cellTemplateId.longValue();
}
public Integer getPeriod() {
return period;
}
......@@ -30,22 +51,4 @@ public class PCTEntity {
public void setData(BigDecimal data) {
this.data = data;
}
public PCTEntity(String pctStr) {
String[] pct = pctStr.split(":");
this.period = Integer.parseInt(pct[0]);
this.cellTemplateId = Long.parseLong(pct[1]);
}
@Override
public int hashCode() {
return (period + "" + cellTemplateId).hashCode();
}
@Override
public boolean equals(Object obj) {
PCTEntity target = (PCTEntity) obj;
return period.intValue() == target.period.intValue()
&& cellTemplateId.longValue() == target.cellTemplateId.longValue();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment