1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- package com.qxgmat.service.inline;
- import com.github.pagehelper.Page;
- import com.nuliji.tools.AbstractService;
- import com.nuliji.tools.exception.ParameterException;
- import com.nuliji.tools.exception.SystemException;
- import com.nuliji.tools.mybatis.Example;
- import com.qxgmat.data.dao.StatDayMapper;
- import com.qxgmat.data.dao.entity.StatDay;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.stereotype.Service;
- import javax.annotation.Resource;
- import java.util.Collection;
- import java.util.List;
- @Service
- public class StatDayService extends AbstractService {
- private static final Logger logger = LoggerFactory.getLogger(SettingService.class);
- @Resource
- private StatDayMapper statDayMapper;
- public StatDay add(StatDay day){
- int result = insert(statDayMapper, day);
- day = one(statDayMapper, day.getId());
- if(day == null){
- throw new SystemException("统计添加失败");
- }
- return day;
- }
- public StatDay edit(StatDay setting){
- StatDay in = one(statDayMapper, setting.getId());
- if(in == null){
- throw new ParameterException("统计不存在");
- }
- int result = update(statDayMapper, setting);
- return setting;
- }
- public boolean delete(Number id){
- StatDay in = one(statDayMapper, id);
- if(in == null){
- throw new ParameterException("统计不存在");
- }
- int result = delete(statDayMapper, id);
- return result > 0;
- }
- public StatDay get(Number id){
- StatDay in = one(statDayMapper, id);
- if(in == null){
- throw new ParameterException("统计不存在");
- }
- return in;
- }
- public Page<StatDay> select(int page, int pageSize){
- return select(statDayMapper, page, pageSize);
- }
- public List<StatDay> select(Collection ids){
- return select(statDayMapper, ids);
- }
- }
|