package foundation.io.template;
|
|
import foundation.data.entity.Entity;
|
import foundation.persist.NamedSQL;
|
|
public class AuthorizeTemplate {
|
|
private String categoryCode;
|
private String categoryName;
|
private String termCode;
|
private String termName;
|
private String templateName;
|
private String path;
|
|
|
public static AuthorizeTemplate getInstance(String companyId, String buId, String categoryCode, String termCode) throws Exception {
|
NamedSQL namedSQL = NamedSQL.getInstance("getAuthorizeTemplate");
|
namedSQL.setParam("company_id", companyId);
|
namedSQL.setParam("bu_id", buId);
|
namedSQL.setParam("category_code", categoryCode);
|
namedSQL.setParam("term_code", termCode);
|
Entity entity = namedSQL.getEntity();
|
|
if (entity == null) {
|
return null;
|
}
|
|
AuthorizeTemplate template = new AuthorizeTemplate();
|
template.load(entity);
|
|
return template;
|
}
|
|
private void load(Entity entity) {
|
categoryCode = entity.getString("category_code");
|
categoryName = entity.getString("category_name");
|
termCode = entity.getString("term_code");
|
termName = entity.getString("term_name");
|
templateName = entity.getString("name");
|
path = entity.getString("path");
|
}
|
|
public String getTemplateName() {
|
return templateName;
|
}
|
|
public String getCategoryCode() {
|
return categoryCode;
|
}
|
|
public String getCategoryName() {
|
return categoryName;
|
}
|
|
public String getTermCode() {
|
return termCode;
|
}
|
|
public String getTermName() {
|
return termName;
|
}
|
|
public String getPath() {
|
return path;
|
}
|
|
}
|