package com.landtool.lanbase.modules.res.service.impl; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.landtool.lanbase.modules.res.dao.Res_CatalogMapper; import com.landtool.lanbase.modules.res.entity.Res_Catalog; import com.landtool.lanbase.modules.res.entity.Res_MainInfo; import com.landtool.lanbase.modules.res.entity.UserDefined.CatlogJoinActionrecord; import com.landtool.lanbase.modules.res.redis.ResCatalogRedis; import com.landtool.lanbase.modules.res.service.ResCatalogService; @Service("resCatalogService") public class ResCatalogServiceImpl implements ResCatalogService { @Autowired private Res_CatalogMapper resCatalogMapper; @Autowired private ResCatalogRedis resCatalogRedis; @Override public Res_Catalog selectByPrimaryKey(Integer catlogid) { Res_Catalog catalog=resCatalogRedis.get(catlogid); if(catalog==null){ catalog = resCatalogMapper.selectByPrimaryKey(catlogid); resCatalogRedis.saveOrUpdate(catalog); } return catalog; } @Override public List selectResCatalogToParentid(int parentid) { return resCatalogMapper.selectResCatalogToParentid(parentid); } @Override public List selectFilterResCatalogToParentid(Res_MainInfo info) { return resCatalogMapper.selectFilterResCatalogToParentid(info); } @Override public List getYWJCMuLuTree(int id) { return resCatalogMapper.getYWJCMuLuTree(id); } @Override public Res_MainInfo selectResMainInfoToCatlogid(int catlogid) { return resCatalogMapper.selectResMainInfoToCatlogid(catlogid); } @Override public int selectResCatalogIsExistsSon(int parentId,String spcStatus) { return resCatalogMapper.selectResCatalogIsExistsSon(parentId,spcStatus); } @Override public int selectResCatalogIsExistsSon(int parentId) { return resCatalogMapper.selectResCatalogIsExistsSon(parentId,null); } @Override public Res_Catalog getResCatalogInfoById(int catlogId) { return selectByPrimaryKey(catlogId); } @Override public String getMaxOrderId(int id) { return resCatalogMapper.getMaxOrderId(id); } @Override public int insertSelective(Res_Catalog record) { int result=resCatalogMapper.insertSelective(record); if(result>0) resCatalogRedis.saveOrUpdate(record); return result; } @Override public String getMaxId() { return resCatalogMapper.getMaxId(); } @Override public String getMaxCATLOGCODE(int id) { return resCatalogMapper.getMaxCATLOGCODE(id); } @Override public int updateByPrimaryKeySelective(Res_Catalog record) { resCatalogRedis.saveOrUpdate(record); return resCatalogMapper.updateByPrimaryKeySelective(record); } @Override public int deleteByPrimaryKey(int id) { resCatalogRedis.delete(id); return resCatalogMapper.deleteByPrimaryKey(id); } @Override public String getMinOrderId(int id) {return resCatalogMapper.getMinOrderId(id);} @Override public String getMinCATLOGCODE(int id) {return resCatalogMapper.getMinCATLOGCODE(id);} @Override public String getMaxOrderIdFromMainIndex(int id) {return resCatalogMapper.getMaxOrderIdFromMainIndex(id);} @Override public String getMinOrderIdFromMainIndex(int id) {return resCatalogMapper.getMinOrderIdFromMainIndex(id);} @Override public String getMaxCATLOGCODEFromMainIndex(int id) {return resCatalogMapper.getMaxCATLOGCODEFromMainIndex(id);} @Override public String getMinCATLOGCODEFromMainIndex(int id) {return resCatalogMapper.getMinCATLOGCODEFromMainIndex(id);} @Override public List SelectMuLuCount(String isDiTuFuwu) { Map paramMap = new HashMap(); paramMap.put("isDiTuFuwu", isDiTuFuwu); return resCatalogMapper.SelectMuLuCount(paramMap); } /** * 资源目录--左侧面板--资源目录树 * @param map * @return */ @Override public List getMuLuTreeData(Map map) { return resCatalogMapper.getMuLuTreeData(map); } /** * 资源目录--左侧面板--资源类型目录树 * @param map * @return */ @Override public List getResourceClassTreeData(Map map) { return resCatalogMapper.getResourceClassTreeData(map); } @Override public List getParentCatalogsById(int id){ return resCatalogMapper.getParentCatalogsById(id); } @Override public List selectMuLuZiYuanList(int parentId) { return resCatalogMapper.selectMuLuZiYuanList(parentId); } @Override public int selectMuLuZiYuanCount(int parentId) { return resCatalogMapper.selectMuLuZiYuanCount(parentId); } @Override public List getMuLuTreeDataByResourceType(Map map) { return resCatalogMapper.getMuLuTreeDataByResourceType(map); } @Override public List selectResCatalogExistsSon() { return resCatalogMapper.selectResCatalogExistsSon(); } }