@@ -0,0 +1,81 @@ | |||
package cc.smtweb.system.bpm.web.sys.user.dept; | |||
import cc.smtweb.framework.core.annotation.SwTable; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
/** | |||
* Created by 1 at 2022-07-27 09:35:05 | |||
* 实体【[部门表](SYS_DEPT)】的Entity类 | |||
*/ | |||
@SwTable("SYS_DEPT") | |||
public class Dept extends DefaultEntity { | |||
public static final String ENTITY_NAME = "SYS_DEPT"; | |||
public Dept() { | |||
super(ENTITY_NAME); | |||
} | |||
/** 主键 */ | |||
public long getId() { | |||
return getLong("dpt_id"); | |||
} | |||
/** 主键 */ | |||
public void setId(long dpt_id) { | |||
put("dpt_id", dpt_id); | |||
} | |||
/** 编码 */ | |||
public String getCode() { | |||
return getStr("dpt_code"); | |||
} | |||
/** 编码 */ | |||
public void setCode(String dpt_code) { | |||
put("dpt_code", dpt_code); | |||
} | |||
/** 名称 */ | |||
public String getName() { | |||
return getStr("dpt_name"); | |||
} | |||
/** 名称 */ | |||
public void setName(String dpt_name) { | |||
put("dpt_name", dpt_name); | |||
} | |||
/** 部门性质 */ | |||
public long getType() { | |||
return getLong("dpt_type"); | |||
} | |||
/** 部门性质 */ | |||
public void setType(long dpt_type) { | |||
put("dpt_type", dpt_type); | |||
} | |||
/** 所属机构 */ | |||
public long getPtId() { | |||
return getLong("dpt_pt_id"); | |||
} | |||
/** 所属机构 */ | |||
public void setPtId(long dpt_pt_id) { | |||
put("dpt_pt_id", dpt_pt_id); | |||
} | |||
/** 状态 */ | |||
public int getStatu() { | |||
return getInt("dpt_statu"); | |||
} | |||
/** 状态 */ | |||
public void setStatu(int dpt_statu) { | |||
put("dpt_statu", dpt_statu); | |||
} | |||
/** 备注 */ | |||
public String getRemark() { | |||
return getStr("dpt_remark"); | |||
} | |||
/** 备注 */ | |||
public void setRemark(String dpt_remark) { | |||
put("dpt_remark", dpt_remark); | |||
} | |||
} |
@@ -0,0 +1,39 @@ | |||
package cc.smtweb.system.bpm.web.sys.user.dept; | |||
import cc.smtweb.framework.core.annotation.SwCache; | |||
import cc.smtweb.framework.core.cache.AbstractEntityCache; | |||
import cc.smtweb.framework.core.cache.CacheManager; | |||
import java.util.Set; | |||
/** | |||
* Created by 1 at 2022-07-27 09:35:05 | |||
* 实体【[部门表](SYS_DEPT)】的缓存类 | |||
*/ | |||
@SwCache(ident = "SYS_DEPT", title = "部门表") | |||
public class DeptCache extends AbstractEntityCache<Dept> { | |||
//缓存key:按编码 | |||
public final static String mk_code = "code"; | |||
//缓存key:按机构 | |||
public final static String mk_p = "p"; | |||
public static DeptCache getInstance() { | |||
return CacheManager.getIntance().getCache(DeptCache.class); | |||
} | |||
public DeptCache() { | |||
//缓存key:按编码 | |||
regMap(mk_code, "dpt_code"); | |||
//缓存key:按机构 | |||
regList(mk_p, "dpt_pt_id"); | |||
} | |||
//缓存key:按编码 | |||
public final Dept getByCode(String key) { | |||
return getByKey(mk_code, key); | |||
} | |||
//缓存key:按机构 | |||
public final Set<Dept> getByP(String key) { | |||
return getListByKey(mk_p, key); | |||
} | |||
} |
@@ -4,9 +4,6 @@ import cc.smtweb.framework.core.annotation.SwCache; | |||
import cc.smtweb.framework.core.cache.AbstractEntityCache; | |||
import cc.smtweb.framework.core.cache.CacheManager; | |||
import java.util.ArrayList; | |||
import java.util.Comparator; | |||
import java.util.List; | |||
import java.util.Set; | |||
/** | |||
@@ -27,16 +24,10 @@ public class PartyCache extends AbstractEntityCache<Party> { | |||
public PartyCache() { | |||
//缓存key:按父ID | |||
regList(mk_pr, "pt_parent_id"); | |||
//缓存key:按编码 | |||
regList(mk_code, "pt_code"); | |||
} | |||
//缓存key:按父ID | |||
public final Set<Party> getByPr(String key) { | |||
return getListByKey(mk_pr, key); | |||
} | |||
//缓存key:按编码 | |||
public final Set<Party> getByCode(String key) { | |||
return getListByKey(mk_code, key); | |||
} | |||
} |