提交 69cd683f authored 作者: aiqingguo's avatar aiqingguo

修改dao返回值

上级 f5bbe8dd
...@@ -23,7 +23,7 @@ public interface IntegralRecordDao extends BaseDao<IntegraRecordMapper, Integral ...@@ -23,7 +23,7 @@ public interface IntegralRecordDao extends BaseDao<IntegraRecordMapper, Integral
Integer sumIntegral(@Param("statisticsId") Integer statisticsId); Integer sumIntegral(@Param("statisticsId") Integer statisticsId);
IntegralRecord selectByStatisticsIdAndType(@Param("statisticsId") Integer statisticsId, @Param("type") Integer type); IntegralRecord selectByStatisticsIdAndType(@Param("statisticsId") Integer statisticsId, @Param("type") Integer type);
int sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList); Integer sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList);
Integer sumByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId, Integer sumByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId,
@Param("type") Integer type, @Param("type") Integer type,
......
...@@ -43,7 +43,7 @@ public class IntegralRecordDaoImpl extends BaseDaoImpl<IntegraRecordMapper, Inte ...@@ -43,7 +43,7 @@ public class IntegralRecordDaoImpl extends BaseDaoImpl<IntegraRecordMapper, Inte
} }
@Override @Override
public int sumByStatisticsIdAndTypes(Integer statisticsId, List<Integer> typeList) { public Integer sumByStatisticsIdAndTypes(Integer statisticsId, List<Integer> typeList) {
return baseMapper.sumByStatisticsIdAndTypes(statisticsId, typeList); return baseMapper.sumByStatisticsIdAndTypes(statisticsId, typeList);
} }
......
...@@ -34,7 +34,7 @@ public interface IntegraRecordMapper extends BaseMapper<IntegralRecord> { ...@@ -34,7 +34,7 @@ public interface IntegraRecordMapper extends BaseMapper<IntegralRecord> {
" type in <foreach collection='list' item='item' open='(' separator=',' close=')'>#{item}</foreach> " + " type in <foreach collection='list' item='item' open='(' separator=',' close=')'>#{item}</foreach> " +
" and statistics_id = #{statisticsId}" + " and statistics_id = #{statisticsId}" +
"</script>") "</script>")
int sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList); Integer sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList);
@Select("select sum(integral) from integral_record where statistics_id = #{statisticsId} and type = #{type} and create_time >= #{beginTime} and create_time < #{endTime}") @Select("select sum(integral) from integral_record where statistics_id = #{statisticsId} and type = #{type} and create_time >= #{beginTime} and create_time < #{endTime}")
Integer sumByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId, Integer sumByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId,
......
...@@ -82,7 +82,8 @@ public class IntegralRecordServiceImpl implements IntegralRecordService { ...@@ -82,7 +82,8 @@ public class IntegralRecordServiceImpl implements IntegralRecordService {
IntegralStatistics statistics = integralStatisticsDao.selectByTruckNoAndStatisticsDate(truckNo, statisticsDate).orNull(); IntegralStatistics statistics = integralStatisticsDao.selectByTruckNoAndStatisticsDate(truckNo, statisticsDate).orNull();
if (statistics == null) {return;} if (statistics == null) {return;}
int sum = integralRecordDao.sumByStatisticsIdAndTypes(statistics.getId(), Arrays.asList(IntegralRecordEnum.Type.ORDER_CHILD_PLATFORM_COMPENSATION.getValue())); Integer sum = integralRecordDao.sumByStatisticsIdAndTypes(statistics.getId(), Arrays.asList(IntegralRecordEnum.Type.ORDER_CHILD_PLATFORM_COMPENSATION.getValue()));
if (sum == null) {sum = 0;}
if (sum > ruleInfo.getPlatformCompensationRule().getIntegralCancelLimit()){ if (sum > ruleInfo.getPlatformCompensationRule().getIntegralCancelLimit()){
log.info("平台补偿超上限,本次无效, truckNo:{}, type:{}, integral:{}, remark:{}", truckNo, type, integral, remark); log.info("平台补偿超上限,本次无效, truckNo:{}, type:{}, integral:{}, remark:{}", truckNo, type, integral, remark);
return; return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论