Просмотр исходного кода

增加Propertyvalue字段获取

wangyc 7 лет назад
Родитель
Сommit
fa1935da9a

+ 1 - 4
mall-search/src/main/java/com/uas/search/service/impl/JdbcServiceImpl.java

@@ -119,10 +119,7 @@ public class JdbcServiceImpl<T> implements JdbcService{
         String propertyValueSql = "select * from product$propertyvalue left join product$property on product$propertyvalue.pv_propertyid = product$property.pt_id where pv_componentid = ";
         if (!CollectionUtils.isEmpty(components) && needProperties) {
             for (Component component : components) {
-                List<PropertyValue> propertyValues = jdbcTemplate.query(propertyValueSql + component.getId(), new PropertyValue());
-                if (!CollectionUtils.isEmpty(propertyValues)) {
-                    component.setProperties(new HashSet<>(propertyValues));
-                }
+                    component.setProperties(new HashSet<>(jdbcTemplate.query(propertyValueSql + component.getId(), new PropertyValue())));
             }
         }
         return (List<T>) components;