Пример #1
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";
  }
Пример #2
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";
  }
Пример #3
0
 @Override
 public List<Worship> selectByExample(Criteria example) {
   return worshipsMapper.selectByExample(example);
 }
Пример #4
0
 @Override
 public int countByExample(Criteria example) {
   return worshipsMapper.countByExample(example);
 }