Authored by Lixiaodi

bug修改

... ... @@ -79,10 +79,12 @@
limit #{page.startIndex}, #{page.pageSize}
</select>
<select id="selectAllSizeBySortId" resultMap="sizeMap">
select id, size_name
from size where sort_id = #{sortId}
from size where 1=1
<if test="sortId != null and sortId >0 ">
and sort_id = #{sortId}
</if>
</select>
<select id="selectByIdList" resultMap="sizeMap">
... ...
... ... @@ -6,6 +6,9 @@ import com.yohobuy.ufo.model.common.ApiResponse;
import com.yohobuy.ufo.model.common.PageResponseBO;
import com.yohobuy.ufo.model.request.productcolor.ProductColorRequestBo;
import com.yohobuy.ufo.model.response.productcolor.ProductColorResponsetBo;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -44,7 +47,7 @@ public class ProductColorController {
}
@RequestMapping(value = "/getAllColor", method = RequestMethod.GET)
public ApiResponse<ProductColorResponsetBo> getAllColor() {
public ApiResponse<List<ProductColorResponsetBo>> getAllColor() {
LOGGER.info("getAllColor ");
return new ApiResponse<>(productColorService.getAllColor());
}
... ...
package com.yoho.ufo.service;
import java.util.List;
import com.yohobuy.ufo.model.common.PageResponseBO;
import com.yohobuy.ufo.model.request.productcolor.ProductColorRequestBo;
import com.yohobuy.ufo.model.response.productcolor.ProductColorResponsetBo;
... ... @@ -32,6 +34,6 @@ public interface IProductColorService {
*/
PageResponseBO<ProductColorResponsetBo> getProductColorPageList(ProductColorRequestBo productColorRequestBo);
ProductColorResponsetBo getAllColor();
List<ProductColorResponsetBo> getAllColor();
}
... ...
... ... @@ -15,6 +15,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
... ... @@ -55,9 +56,14 @@ public class ProductColorServiceImpl implements IProductColorService {
}
@Override
public ProductColorResponsetBo getAllColor() {
public List<ProductColorResponsetBo> getAllColor() {
LOGGER.info("getAllColor");
return OrikaUtils.map(ufoProductColorMapper.selectAllColor(), ProductColorResponsetBo.class);
List<ProductColorResponsetBo> result = new ArrayList<>();
List<ProductColor> colorList = ufoProductColorMapper.selectAllColor();
for(ProductColor color : colorList) {
result.add(OrikaUtils.map(color, ProductColorResponsetBo.class));
}
return result;
}
@Override
... ...