@Override
 public void deleteTableRule(String ruleId) throws BusinessException {
   Assert.notNull(ruleId, "表整合规则ruleId不允许为空");
   Map<String, Object> params = Constants.MAP();
   params.put("ruleId", ruleId);
   // 1. 删除整合日志
   this.dataInteLog.delete(params);
   // 2. 删除整合字段相关规则
   this.columnInteRuleDao.delete(params);
   // 3. 删除表整合规则
   this.delete(params);
 }
Exemplo n.º 2
0
  public Pager<T> findByPager(String key, Pager<T> pager, Map<String, Object> params) {

    if (pager.isReload()) { // 如果总条数发生变化,请重新加载
      Map<String, Object> cparams = Constants.MAP();
      cparams.putAll(params);
      int total = (Integer) this.getSqlSession().selectOne(this.sqlKey(key + "Count"), cparams);
      pager.setTotal(total);
      pager.setReload(false);
    }
    if (pager.getCurrent() > pager.getTotalPage() && pager.getTotal() > 0) {
      pager.setCurrent(pager.getCurrent() - 1);
    }

    int sno = pager.getCurrent() * pager.getLimit() + 1;
    int eno = (pager.getCurrent() + 1) * pager.getLimit();

    params.put("sno", sno); // 查询开始条数
    params.put("eno", eno); // 查询结束条数

    List<T> dataList = this.getSqlSession().selectList(this.sqlKey(key), params);

    pager.setData(dataList);
    return pager;
  }