List of usage examples for org.apache.ibatis.session SqlSession selectList
<E> List<E> selectList(String statement, Object parameter);
From source file:com.skt.adcas.lte.action.DownLinkByNMSStatsAction.java
public String selectCellTrafficStats() { this.log.debug("selectCellTrafficStats Start"); SqlSession session = null; try {/* w w w . jav a 2s . c o m*/ parseParam(); this.log.debug("###################### "); session = SqlSessionManager.getSqlSession().openSession(); //this.param.put("BTS_NM_CMS",BTS_NM_CMS); this.log.debug( "###################### ?? =" + "DownLinkByNMSStats.selectCellTrafficStats"); this.rows = session.selectList("DownLinkByNMSStats.selectCellTrafficStats", param); this.log.debug("###################### "); if (this.rows.size() > 0) { this.msg = "?."; } else { this.msg = " ."; } this.status = "SUCCESS"; } catch (Exception e) { this.msg = "? ?. ?? ?.\n\n" + e.getMessage(); this.status = "ERROR"; this.error = true; if (session != null) { session.rollback(); } e.printStackTrace(); } finally { if (session != null) { session.close(); } } this.log.debug("selectCellTrafficStats End"); return SUCCESS; }
From source file:com.skt.adcas.lte.action.DownLinkByQMSAction.java
public String selectCellTraffic() { this.log.debug("selectCellTraffic Start"); SqlSession session = null; try {//from w ww. j a v a 2s. com parseParam(); session = SqlSessionManager.getSqlSession().openSession(); this.log.debug("###################### ?? =" + "DownLinkByQMS.selectCellTraffic" + VIEWTYPE); this.rows = session.selectList("DownLinkByQMS.selectCellTraffic" + VIEWTYPE, param); this.log.debug("###################### "); if (this.rows.size() > 0) { this.msg = "?."; } else { this.msg = " ."; } this.status = "SUCCESS"; } catch (Exception e) { this.msg = "? ?. ?? ?.\n\n" + e.getMessage(); this.status = "ERROR"; this.error = true; if (session != null) { session.rollback(); } e.printStackTrace(); } finally { if (session != null) { session.close(); } } this.log.debug("selectCellTraffic End"); return SUCCESS; }
From source file:com.skt.adcas.lte.action.DownLinkByQMSStatsAction.java
public String selectCellTrafficStats() { this.log.debug("selectCellTrafficStats Start"); SqlSession session = null; try {/*from ww w . j a v a 2 s . c o m*/ parseParam(); this.log.debug("###################### "); session = SqlSessionManager.getSqlSession().openSession(); //this.param.put("BTS_NM_CMS",BTS_NM_CMS); this.log.debug( "###################### ?? =" + "DownLinkByQMSStats.selectCellTrafficStats"); this.rows = session.selectList("DownLinkByQMSStats.selectCellTrafficStats", param); this.log.debug("###################### "); if (this.rows.size() > 0) { this.msg = "?."; } else { this.msg = " ."; } this.status = "SUCCESS"; } catch (Exception e) { this.msg = "? ?. ?? ?.\n\n" + e.getMessage(); this.status = "ERROR"; this.error = true; if (session != null) { session.rollback(); } e.printStackTrace(); } finally { if (session != null) { session.close(); } } this.log.debug("selectCellTrafficStats End"); return SUCCESS; }
From source file:com.skt.adcas.lte.action.DownLinkBySTDAction.java
public String selectCellTraffic() { this.log.debug("selectCellTraffic Start"); SqlSession session = null; try {// w w w . ja v a2 s . c o m parseParam(); session = SqlSessionManager.getSqlSession().openSession(); //this.param.put("BTS_NM_CMS",BTS_NM_CMS); this.log.debug("###################### ?? =" + "DownLinkBySTD.selectCellTraffic" + VIEWTYPE); this.rows = session.selectList("DownLinkBySTD.selectCellTraffic" + VIEWTYPE, param); this.log.debug("###################### "); if (this.rows.size() > 0) { this.msg = "?."; } else { this.msg = " ."; } this.status = "SUCCESS"; } catch (Exception e) { this.msg = "? ?. ?? ?.\n\n" + e.getMessage(); this.status = "ERROR"; this.error = true; if (session != null) { session.rollback(); } e.printStackTrace(); } finally { if (session != null) { session.close(); } } this.log.debug("selectCellTraffic End"); return SUCCESS; }
From source file:com.skt.adcas.lte.action.DownLinkBySTDStatsAction.java
public String selectCellTrafficStats() { this.log.debug("selectCellTrafficStats Start"); SqlSession session = null; try {/*from w w w . j a v a 2 s. co m*/ parseParam(); this.log.debug("###################### "); session = SqlSessionManager.getSqlSession().openSession(); //this.param.put("BTS_NM_CMS",BTS_NM_CMS); this.log.debug( "###################### ?? =" + "DownLinkBySTDStats.selectCellTrafficStats"); this.rows = session.selectList("DownLinkBySTDStats.selectCellTrafficStats", param); this.log.debug("###################### "); if (this.rows.size() > 0) { this.msg = "?."; } else { this.msg = " ."; } this.status = "SUCCESS"; } catch (Exception e) { this.msg = "? ?. ?? ?.\n\n" + e.getMessage(); this.status = "ERROR"; this.error = true; if (session != null) { session.rollback(); } e.printStackTrace(); } finally { if (session != null) { session.close(); } } this.log.debug("selectCellTrafficStats End"); return SUCCESS; }
From source file:com.sycros.SCWebConsole.business.dao.LicenseBzDaoImpl.java
License:Open Source License
@Override public List<LicenseBzVo> selectLicenseList(SqlSession sqlSession, LicenseBzDto licenseBzDto) throws Exception { // TODO Auto-generated method stub return sqlSession.selectList("com.sycros.SCWebConsole.business.business-mapper.selectLicenseList", licenseBzDto);//from w w w .ja v a2 s . c o m }
From source file:com.tiamaes.mybatis.test.basic.TestNamespaceMap.java
License:Open Source License
/** * Mapper?PageHelper.startPage??Mapper?? *//*from ww w . java2s . c om*/ @Test public void testMapperWithStartPage() { SqlSession sqlSession = MybatisHelper.getSqlSession(); try { //?110?count PageHelper.startPage(1, 10); Map<String, Object> map = new HashMap<String, Object>(); map.put("countryname", "c"); List<Country> list = sqlSession.selectList("selectLike", map); assertEquals(30, list.get(0).getId()); assertEquals(10, list.size()); assertEquals(39, ((Pagination<?>) list).getTotal()); PageHelper.startPage(1, 10); map.put("countryname", "China"); map.put("countrycode", "CN"); list = sqlSession.selectList("selectByMap", map); assertEquals(35, list.get(0).getId()); assertEquals(1, list.size()); assertEquals(1, ((Pagination<?>) list).getTotal()); } finally { sqlSession.close(); } }
From source file:com.tiamaes.mybatis.test.rowbounds.RowBoundsTest.java
License:Open Source License
@Test public void testNamespaceWithRowBounds3() { SqlSession sqlSession = MybatisRowBoundsHelper.getSqlSession(); try {//from w ww. ja va2 s.co m //?010? PageHelper.startPage(1, 10); List<Country> list = sqlSession.selectList("selectIf", null); assertEquals(10, list.size()); assertEquals(183, ((Pagination<?>) list).getTotal()); //?? assertEquals(1, list.get(0).getId()); assertEquals(10, list.get(list.size() - 1).getId()); Map<String, Object> map = new HashMap<String, Object>(); map.put("id", 10); //?1010? PageHelper.startPage(10, 10); list = sqlSession.selectList("selectIf", map); assertEquals(10, list.size()); assertEquals(173, ((Pagination<?>) list).getTotal()); //?? assertEquals(101, list.get(0).getId()); assertEquals(110, list.get(list.size() - 1).getId()); IdBean country = new IdBean(); //?1010? PageHelper.startPage(10, 10); list = sqlSession.selectList("selectIf", country); assertEquals(10, list.size()); assertEquals(183, ((Pagination<?>) list).getTotal()); //?? assertEquals(91, list.get(0).getId()); assertEquals(100, list.get(list.size() - 1).getId()); } finally { sqlSession.close(); } }
From source file:com.tianjunwei.lazy.LazyMainTeacher.java
License:Apache License
public static void main(String[] args) throws IOException { //mybatis?/*from ww w . j a va 2 s . co m*/ String resource = "learn/mybatis-config.xml"; InputStream is = LazyMainTeacher.class.getClassLoader().getResourceAsStream(resource); //sqlSession SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(is); SqlSession session = sessionFactory.openSession(); String statement = "com.tianjunwei.lazy.entity.Teacher.getTeacher";//sql //usersql Teacher teacher = (Teacher) session.selectList(statement, 1).get(0); session.commit(true); System.out.println(teacher.getName()); List<User> users = teacher.getUsers(); System.err.println(users.get(3).getAge()); System.err.println(teacher.getClass()); System.in.read(); }
From source file:com.tmc.server.app.emp.License.java
public void selectById(SqlSession sqlSession, ServiceRequest request, ServiceResult result) { Long licenseId = request.getLong("licenseId"); List<AbstractDataModel> list = sqlSession.selectList(mapperName + ".selectById", licenseId); result.setRetrieveResult(1, "select ok", list); }