Exemplo n.º 1
0
 @Override
 public Map getAllInfo() {
   SqlSession session = util.getSqlsession();
   company cp = new company();
   cp.setId("1");
   company cy = (company) session.selectOne("company.selectOneById", cp);
   Map mp = new HashMap();
   mp.put("company", cy);
   List pc = session.selectList("productClass.selectList");
   mp.put("productclass", pc);
   List tm = session.selectList("team.selectList");
   List bc = session.selectList("brochure.selectList");
   mp.put("team", tm);
   mp.put("brochure", bc);
   return mp;
 }
Exemplo n.º 2
0
 @Override
 public Map getInfo() {
   SqlSession session = util.getSqlsession();
   Map mk = new HashMap();
   company x = new company();
   x.setId("1");
   company m = (company) session.selectOne("company.selectOneById", x);
   m.setContent(Utils.getContent(m.getContent()));
   List nw = null;
   int ncount = ((Integer) session.selectOne("news.selectCount")).intValue();
   if (ncount >= 7) {
     mk.put("index", Integer.valueOf(ncount - 7));
     mk.put("count", Integer.valueOf(ncount));
     nw = session.selectList("news.selectListByPage", mk);
   } else {
     nw = session.selectList("news.selectList");
   }
   List lk = session.selectList("link.selectList");
   List kn = null;
   int kcount = ((Integer) session.selectOne("knowledge.selectCount")).intValue();
   if (kcount >= 7) {
     mk.put("index", Integer.valueOf(kcount - 7));
     mk.put("count", Integer.valueOf(kcount));
     kn = session.selectList("knowledge.selectListByPage", mk);
   } else {
     kn = session.selectList("knowledge.selectList");
   }
   List tm = session.selectList("team.selectList");
   List pt = session.selectList("product.selectList");
   List bc = session.selectList("brochure.selectList");
   Map mp = new HashMap();
   mp.put("company", m);
   mp.put("news", nw);
   mp.put("link", lk);
   mp.put("knowledge", kn);
   mp.put("team", tm);
   mp.put("product", pt);
   mp.put("brochure", bc);
   return mp;
 }