Browse Source

Merge branch 'master' of ssh://192.168.8.213:10022/miaxis/zzjs

Althars123 4 years ago
parent
commit
72af3a3430

+ 13 - 0
zzjs-admin/src/main/java/com/miaxis/pc/controller/carousel/CarouselChartInfoController.java

@@ -58,6 +58,19 @@ public class CarouselChartInfoController extends BaseController{
         return carouselChartInfoService.saveCarouselChartInfo(carouselChartInfo);
     }
 
+    /**
+     * 获取轮播图详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('carousel:carousel:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取轮播图详细信息")
+    public Response<CarouselChartInfoVo> getCarouselChartInfo(
+            @ApiParam(name = "id", value = "轮播图id", required = true)
+            @PathVariable("id") Long id
+    ) {
+        return carouselChartInfoService.getCarouselChartById(id);
+    }
+
     /**
      * 修改轮播图
      */

+ 9 - 1
zzjs-service/src/main/java/com/miaxis/carousel/mapper/CarouselChartInfoMapper.java

@@ -1,9 +1,11 @@
 package com.miaxis.carousel.mapper;
 
-import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.miaxis.carousel.domain.CarouselChartInfo;
 import com.miaxis.carousel.vo.CarouselChartInfoVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 轮播图Mapper接口
@@ -20,4 +22,10 @@ public interface CarouselChartInfoMapper extends BaseMapper<CarouselChartInfo> {
      */
     List<CarouselChartInfoVo> selectCarouselChartInfoList(CarouselChartInfo carouselChartInfo);
 
+    /**
+     * 获取轮播图详细信息
+     * @param id
+     * @return
+     */
+    CarouselChartInfoVo getCarouselChartById(@Param("id") Long id);
 }

+ 10 - 3
zzjs-service/src/main/java/com/miaxis/carousel/service/ICarouselChartInfoService.java

@@ -1,11 +1,12 @@
 package com.miaxis.carousel.service;
 
-import java.util.List;
-import com.miaxis.carousel.domain.CarouselChartInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.carousel.domain.CarouselChartInfo;
 import com.miaxis.carousel.vo.CarouselChartInfoVo;
 import com.miaxis.common.core.domain.Response;
 
+import java.util.List;
+
 /**
  * 轮播图Service接口
  *
@@ -36,6 +37,13 @@ public interface ICarouselChartInfoService extends IService<CarouselChartInfo>{
      */
     Response<Integer> updateCarouselChartInfoById(CarouselChartInfo carouselChartInfo);
 
+    /**
+     * 获取轮播图详细信息
+     * @param id
+     * @return
+     */
+    Response<CarouselChartInfoVo> getCarouselChartById(Long id);
+
     /**
      * 删除轮播图(伪删除)
      * @param ids
@@ -49,5 +57,4 @@ public interface ICarouselChartInfoService extends IService<CarouselChartInfo>{
      * @return
      */
     List<CarouselChartInfoVo> getCarouselChartList();
-
 }

+ 14 - 4
zzjs-service/src/main/java/com/miaxis/carousel/service/impl/CarouselChartInfoServiceImpl.java

@@ -88,6 +88,16 @@ public class CarouselChartInfoServiceImpl extends ServiceImpl<CarouselChartInfoM
         }
     }
 
+    /**
+     * 获取轮播图详细信息
+     * @param id
+     * @return
+     */
+    @Override
+    public Response<CarouselChartInfoVo> getCarouselChartById(Long id) {
+        return Response.success(carouselChartInfoMapper.getCarouselChartById(id));
+    }
+
     /**
      * 删除轮播图(伪删除)
      * @param ids
@@ -123,10 +133,10 @@ public class CarouselChartInfoServiceImpl extends ServiceImpl<CarouselChartInfoM
                 infoVos.add(carouselChartInfoVo);
             }
         }else {
-        //数据库获取(此处可不做查询,防止缓存挂掉)
-        CarouselChartInfo carouselChartInfo = new CarouselChartInfo();
-        carouselChartInfo.setStatus(0);//启用状态
-        infoVos = carouselChartInfoMapper.selectCarouselChartInfoList(carouselChartInfo);
+            //数据库获取(此处可不做查询!)
+            CarouselChartInfo carouselChartInfo = new CarouselChartInfo();
+            carouselChartInfo.setStatus(0);//启用状态
+            infoVos = carouselChartInfoMapper.selectCarouselChartInfoList(carouselChartInfo);
         }
         return infoVos;
     }

+ 14 - 0
zzjs-service/src/main/resources/mapper/carousel/CarouselChartInfoMapper.xml

@@ -37,4 +37,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+    <select id="getCarouselChartById" resultType="com.miaxis.carousel.vo.CarouselChartInfoVo">
+        select
+        ci.id,
+        ci.file_id as fileId,
+        ci.picture_name as pictureName,
+        ci.jump_url as jumpUrl,
+        ci.jump_url_type as jumpUrlType,
+        f.file_url as fileUrl,
+        ci.status
+        from carousel_chart_info ci
+        LEFT JOIN file_info f on f.file_id = ci.file_id
+        where ci.id = #{id}
+    </select>
+
 </mapper>