package com.xmomen.module.advice.service;

import com.xmomen.framework.mybatis.page.Page;
import com.xmomen.module.advice.model.AdviceQuery;
import com.xmomen.module.advice.model.AdviceModel;
import com.xmomen.module.advice.entity.Advice;
import org.apache.ibatis.exceptions.TooManyResultsException;

import java.io.Serializable;
import java.util.List;

public interface AdviceService {

    // 新增快报
    public AdviceModel createAdvice(AdviceModel adviceModel);

    // 新增快报实体对象
    public Advice createAdvice(Advice advice);

    // 批量新增快报
    List<AdviceModel> createAdvices(List<AdviceModel> adviceModels);

    // 更新快报
    public void updateAdvice(AdviceModel adviceModel);

    // 更新快报实体对象
    public void updateAdvice(Advice advice);

    // 批量删除快报
    public void deleteAdvice(String[] ids);

    // 删除快报
    public void deleteAdvice(String id);

    // 查询快报领域分页对象（带参数条件）
    public Page<AdviceModel> getAdviceModelPage(int limit, int offset, AdviceQuery adviceQuery);

    // 查询快报领域分页对象（无参数条件）
    public Page<AdviceModel> getAdviceModelPage(int limit, int offset);

    // 查询快报领域集合对象（带参数条件）
    public List<AdviceModel> getAdviceModelList(AdviceQuery adviceQuery);

    // 查询快报领域集合对象（无参数条件）
    public List<AdviceModel> getAdviceModelList();

    // 查询快报实体对象
    public Advice getOneAdvice(String id);

    // 根据主键查询单个对象
    public AdviceModel getOneAdviceModel(String id);

    // 根据查询参数查询单个对象（此方法只用于提供精确查询单个对象，若结果数超过1，则会报错）
    public AdviceModel getOneAdviceModel(AdviceQuery adviceQuery) throws TooManyResultsException;
}
