package com.goafanti.common.dao;

import com.goafanti.common.model.ExpenseAccount;
import com.goafanti.common.model.FinanceCount;
import com.goafanti.expenseAccount.bo.InputExpenseAccount;
import com.goafanti.expenseAccount.bo.MainExpenseAccount;
import com.goafanti.expenseAccount.bo.OutExpenseAccount;
import com.goafanti.expenseAccount.bo.OutMyEAStatistics;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface ExpenseAccountMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ExpenseAccount record);

    int insertSelective(ExpenseAccount record);

    ExpenseAccount selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ExpenseAccount record);

    int updateByPrimaryKey(ExpenseAccount record);

    OutExpenseAccount selectByid(Integer id);

    OutExpenseAccount selectByaidAndPrid(InputExpenseAccount in);

    OutExpenseAccount selectByCheckNo(String checkNo);

    List<OutExpenseAccount> selectByaidAndType(@Param("aid") String aid,@Param("depId")String depId, @Param("type")Integer type,
                                               @Param("id")Integer id);

    List<OutMyEAStatistics> selectStatistics(@Param("name") String name, @Param("depId") String depId,
                                             @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("lander") String lander);

    List<ExpenseAccount> selectByDebitId(Integer debitId);


    List<ExpenseAccount> selectByCheckNoNot();


    List<FinanceCount> selectCountByFinance(String id);

    List<ExpenseAccount> selectByIds(List<String> split);

    void updateByIds(@Param("list") List<ExpenseAccount> list, @Param("status") Integer status);

    MainExpenseAccount selectByMainId(Integer id);

    void updateByMainId(@Param("id") Integer id, @Param("status") Integer status);

    List<ExpenseAccount> selectListByMainId(Integer id);

    int selectCountByIdsAndType(@Param("list") List<String> list, @Param("type") Integer type);

    List<ExpenseAccount> selectAllMain();

    void updateSonByDetId(Integer id);

    void updateMainByDetId(Integer id);

    void updateDeleteDebitId(Integer id);

    List<MainExpenseAccount> selectSonByMainIds(List<Integer> list);

    void updateSonByMainId(Integer id);

    MainExpenseAccount selectbySonId(Integer id);

    Integer selectDeleteIdBySonId(Integer integer);

    void updateSonTypeOther(@Param("id") Integer id, @Param("types") String types);

    void updateRemoveOrderNo(ExpenseAccount ea);

    List<ExpenseAccount> selectByOrderNo(String orderNo);

    List<BigDecimal> getOrderNoNotCountAmount(String orderNo);

    List<BigDecimal> getUidNotCountAmount(String uid);
}
