Authored by mali

二手库存优化

... ... @@ -11,4 +11,6 @@ public interface SecondhandFlawMapper {
List<SecondhandFlaw> selectByIds(@Param("ids") String ids);
List<SecondhandFlaw> selectBatchByIds(@Param("idList") List<Integer> idList);
List<SecondhandFlaw> selectAllFlaw();
}
\ No newline at end of file
... ...
... ... @@ -32,4 +32,9 @@
</select>
<select id="selectAllFlaw" resultMap="BaseResultMap">
select id, type, name, attr, order_by
from secondhand_flaw limit 1000
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -142,8 +142,8 @@ public class SecondhandProductService implements ISecondhandProductService{
Map<Integer, Product> productMap = productList.stream().collect(Collectors.toMap(Product::getId, Function.identity()));
//查询secondhand_flaw
List<String> flawIdStrList = infoList.stream().map(SecondhandInfo::getFlawId).collect(Collectors.toList());
List<SecondhandFlaw> flawList = secondhandFlawMapper.selectBatchByIds(getFlawIdList(flawIdStrList));
//List<String> flawIdStrList = infoList.stream().map(SecondhandInfo::getFlawId).collect(Collectors.toList());
List<SecondhandFlaw> flawList = secondhandFlawMapper.selectAllFlaw();
Map<Integer, String> flawMap = flawList.stream().collect(Collectors.toMap(SecondhandFlaw::getId, SecondhandFlaw::getName));
//查询goods_images
... ...