コード例 #1
0
  @Override
  @Transactional(
      readOnly = false,
      propagation = Propagation.REQUIRED,
      rollbackFor = {Exception.class})
  public String delete(Criteria example) {
    Integer id = example.getAsInteger("id");

    int result = worshipsMapper.deleteByPrimaryKey(id);

    return result > 0 ? "01" : "00";
  }
コード例 #2
0
  @Override
  @Transactional(
      readOnly = false,
      propagation = Propagation.REQUIRED,
      rollbackFor = {Exception.class})
  public String saveWorship(Criteria example) {
    Worship worship = (Worship) example.get("worship");

    int result = 0;
    if (worship.getId() == null) {
      result = worshipsMapper.insert(worship);
    } else {
      result = worshipsMapper.updateByPrimaryKey(worship);
    }

    return result > 0 ? "01" : "00";
  }