package com.goafanti.expenseAccount.service.impl; import com.goafanti.common.dao.TOrderNewMapper; import com.goafanti.common.utils.LoggerUtils; import com.goafanti.expenseAccount.bo.ExpenseCountsInput; import com.goafanti.expenseAccount.service.ExpenseCountsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; @Service public class ExpenseCountsServiceImpl implements ExpenseCountsService { @Autowired private TOrderNewMapper tOrderNewMapper; @Override @Cacheable(value = "getCounts#300", key = "'getCounts:key='+#in.startTime+#in.endTime+#in.depId+#in.contactNo+#in.targetType") public Object getCounts(ExpenseCountsInput in) { if (in.getTargetType()==null)in.setTargetType(1); if (in.getTargetType()==1){ return tOrderNewMapper.selectExpenseCount(in); }else { return tOrderNewMapper.selectExpenseDepCount(in); } } @Override @CacheEvict(value = "getCounts#300",allEntries = true) public Object getCountsClear() { LoggerUtils.debug(getClass(),"报销统计缓存清除。"); return 1; } }