Search in sources :

Example 1 with CatalogMapper

use of com.cas.sim.tis.mapper.CatalogMapper in project TeachingInSimulation by ScOrPiOzzy.

the class CatalogServiceImpl method findCatalogsByParentId.

@Override
public List<Catalog> findCatalogsByParentId(Integer rid) {
    Condition condition = new Condition(Catalog.class);
    Criteria criteria = condition.createCriteria();
    criteria.andEqualTo("rid", rid);
    criteria.andEqualTo("del", 0);
    CatalogMapper catalogMapper = (CatalogMapper) mapper;
    catalogMapper.selectByCondition(condition);
    List<Catalog> catalogs = null;
    try {
        catalogs = catalogMapper.selectByCondition(condition);
        LOG.debug("查询到子节点数量:{}", catalogs.size());
    } catch (Exception e) {
        LOG.error("查询ID{}下子节点失败!", rid);
        catalogs = Collections.emptyList();
    }
    return catalogs;
}
Also used : Condition(tk.mybatis.mapper.entity.Condition) CatalogMapper(com.cas.sim.tis.mapper.CatalogMapper) Criteria(tk.mybatis.mapper.entity.Example.Criteria) Catalog(com.cas.sim.tis.entity.Catalog)

Aggregations

Catalog (com.cas.sim.tis.entity.Catalog)1 CatalogMapper (com.cas.sim.tis.mapper.CatalogMapper)1 Condition (tk.mybatis.mapper.entity.Condition)1 Criteria (tk.mybatis.mapper.entity.Example.Criteria)1