Commit 7509682e authored by shiyu's avatar shiyu

短信8

parent 7162d735
......@@ -42,5 +42,10 @@ public class DistributorShareRecordRequestDto extends BaseRequestDto implements
*/
private Date createTime;
/**
* 分享类型
*/
private Integer type;
}
......@@ -31,7 +31,7 @@ public class DistributorShareRecordDaoImpl implements DistributorShareRecordDao
@Override
public List<DistributorShareRecord> findMaxPriceRecord(DistributorShareRecordRequestDto dto) {
List<DistributorShareRecord> distributorShareRecords = distributorShareRecordMapper.findMaxPriceRecord(dto.getDistributorId());
List<DistributorShareRecord> distributorShareRecords = distributorShareRecordMapper.findMaxPriceRecord(dto.getDistributorId(), dto.getType());
return distributorShareRecords;
}
......
......@@ -72,5 +72,5 @@ public interface DistributorShareRecordMapper {
* @param distributorId
* @return
*/
List<DistributorShareRecord> findMaxPriceRecord(@Param("distributorId") long distributorId);
List<DistributorShareRecord> findMaxPriceRecord(@Param("distributorId") long distributorId, @Param("type") int type);
}
\ No newline at end of file
......@@ -374,9 +374,9 @@
FROM distributor_share_record d
JOIN
(SELECT item_id, MAX(price) as max_amount
FROM distributor_share_record where `distributor_id` = #{distributorId} AND enabled =1
FROM distributor_share_record where `distributor_id` = #{distributorId} AND `type` = #{type} AND enabled =1
GROUP BY item_id) t
ON d.item_id = t.item_id AND price = t.max_amount where d.distributor_id = #{distributorId};
ON d.item_id = t.item_id AND price = t.max_amount where d.distributor_id = #{distributorId} AND d.type = #{type};
</select>
</mapper>
\ No newline at end of file
......@@ -262,6 +262,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
DistributorShareRecordRequestDto distributorShareRecordRequestDto = new DistributorShareRecordRequestDto();
distributorShareRecordRequestDto.setDistributorId(sellerId);
distributorShareRecordRequestDto.setType(dto.getType());
List<DistributorShareRecord> distributorShareRecordList = distributorShareRecordDao.findMaxPriceRecord(distributorShareRecordRequestDto);
Map<Long, DistributorShareRecord> map = distributorShareRecordList.stream().collect(Collectors.toMap(DistributorShareRecord::getItemId, Function.identity(), (k1, k2) -> k1));
List<Long> itemIds = distributorShareRecordList.stream().map(DistributorShareRecord::getItemId).collect(Collectors.toList());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment