Authored by wangnan

规范dao方法名

... ... @@ -9,6 +9,9 @@ import java.util.List;
* Created by wangnan on 2016/6/30.
*/
public interface BasePinRatioMapper {
int selectCount();
int selectLatestDateId();
List<BasePinRatio> selectBasePinRatio(@Param(value = "sknList") List<Integer> sknList, @Param(value = "dateId") Integer dateId);
... ...
... ... @@ -10,6 +10,8 @@ import java.util.List;
*/
public interface BrokenCodeProductMapper {
int selectCount();
int selectLatestDateId();
List<BrokenCode> selectBrokenCode(@Param(value = "sknList") List<Integer> sknList, @Param(value = "dateId") Integer dateId);
... ...
... ... @@ -29,4 +29,8 @@
select max(date_id) from free_size_product
</select>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
SELECT count(*) FROM free_size_product
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -29,4 +29,8 @@
select max(date_id) from nonfree_size_product
</select>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
SELECT count(*) FROM nonfree_size_product
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -29,6 +29,9 @@ public class BasePinRatioBuilder implements ViewBuilder {
@Override
public void build(List<ProductIndexBO> productIndexBOs, List<Integer> ids, List<Integer> sknList) {
if (basePinRatioMapper.selectCount() == 0) {
return;
}
Map<Integer, BasePinRatio> basePinRatioMap = this.getBasePinRatioMap(sknList);
productIndexBOs.stream().forEach(productIndexBO -> productIndexBO.setBasePinRatio(Optional.ofNullable(basePinRatioMap.get(productIndexBO.getProductSkn()))
.map(BasePinRatio::getBasePinRatio)
... ...
... ... @@ -27,6 +27,9 @@ public class BrokenCodeBuilder implements ViewBuilder {
@Override
public void build(List<ProductIndexBO> productIndexBOs, List<Integer> ids, List<Integer> sknList) {
if (brokenCodeProductMapper.selectCount() == 0) {
return;
}
Map<Integer, BrokenCode> brokenCodesMap = this.getBrokenCodesMap(sknList);
productIndexBOs.stream().forEach(productIndexBO -> productIndexBO.setBreakingRate(Optional.ofNullable(brokenCodesMap.get(productIndexBO.getProductSkn()))
.map(BrokenCode::getBreakingRate)
... ...