Mapper.java
public interface FinanceAccountDetailMapper extends Mapper<FinanceAccountDetailDO> {
Long selectFinanceSummarize(DaoSummarizeQueryDTO daoSummarizeQueryDTO);
List<FinanceAccountDetailDO> selectFinanceAccountDetailByCondition(DaoFinanceDetailQueryDTO daoFinanceDetailQueryDTO);
Long countFinanceAccountDetailByCondition(DaoFinanceDetailQueryDTO daoFinanceDetailQueryDTO);
}
service
/**
* 根据id集合查询流水列表
*
* @param ids
* @return
*/
@Override
public List<FinanceAccountDetailDO> selectFinanceDetailByIds(List<Long> ids) {
LOGGER.info("ids = {}", ids);
if (CollectionUtils.isEmpty(ids)) {
throw new BusinessException(AuthBusinessError.SYS_REQUEST_PARAMETER_ERROR, "ids不能为空");
}
Example ex = new Example(FinanceAccountDetailDO.class);
Example.Criteria c = ex.createCriteria();
c.andIn("id", ids);
List<FinanceAccountDetailDO> financeAccountDetails = financeAccountDetailMapper.selectByExample(ex);
LOGGER.info("financeAccountDetails = {}", financeAccountDetails);
return financeAccountDetails;
}
依赖:
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.1.5</version>
</dependency>