Prechádzať zdrojové kódy

供应商落地页后台

kaick 1 rok pred
rodič
commit
629535fb79

+ 19 - 6
src/main/java/com/caimei365/user/controller/CmBrandLandingApi.java

@@ -21,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
@@ -46,22 +47,34 @@ public class CmBrandLandingApi {
     /**
      * 查询供应商落地页资料
      *
+     * @return source 1PC端,2小程序
      * @return Map(userPo, clubPo)
      * @return banner > banner管理
      * @return landing.type 1成功案例,2视频列表,3文章列表
      */
     @ApiOperation("查询供应商落地页资料")
     @GetMapping("/info")
-    public ResponseJson<Map<String, Object>> getShopUserInfo() {
+    public ResponseJson<Map<String, Object>> getShopUserInfo(Integer source) {
+        if(source==null){
+            return ResponseJson.error("source异常", null);
+        }
+        CmBrandBanner cmBrandBanner = new CmBrandBanner().setType("2");
+        CmBrandLanding landing = new CmBrandLanding().setType("1,2,3");
+        if(source==1){
+            cmBrandBanner.setPcStatus("1");
+            landing.setPcStatus("1");
+        }
+        if(source==2){
+            cmBrandBanner.setAppStatus("1");
+            landing.setAppStatus("1");
+        }
         HashMap<String, Object> map = new HashMap(2);
-        List<CmBrandBanner> cmBrandBanners = cmBrandBannerService.selectCmBrandBannerList(new CmBrandBanner()
-                .setType("2")
-                .setDelFlag("0"));
-        List<CmBrandLanding> cmBrandLandings = cmBrandLandingService.selectCmBrandLandingList(new CmBrandLanding()
-                .setDelFlag("0"));
+        List<CmBrandBanner> cmBrandBanners = cmBrandBannerService.selectCmBrandBannerList(cmBrandBanner);
+        List<CmBrandLanding> cmBrandLandings = cmBrandLandingService.selectCmBrandLandingList(landing);
         cmBrandLandings.forEach(cmBrandLanding -> {
             CmBrandFiles cmBrandFiles = new CmBrandFiles();
             cmBrandFiles.setId(cmBrandLanding.getVideo());
+            cmBrandFiles.setType("1");
             cmBrandLanding.setCmBrandFiles(cmBrandLanding.getVideo() == null ? null :
                     cmBrandFilesService.selectCmBrandFilesList(cmBrandFiles));
         });

+ 9 - 4
src/main/resources/mapper/CmBrandBannerMapper.xml

@@ -31,9 +31,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCmBrandBannerList" parameterType="com.caimei365.user.model.po.CmBrandBanner" resultMap="CmBrandBannerResult">
         <include refid="selectCmBrandBannerVo"/>
-        <where>
+        <where>delFlag=0
             <if test="authUserId != null "> and authUserId = #{authUserId}</if>
-            <if test="type != null "> and type = #{type}</if>
+            <if test="type != null and type != ''">
+                and type in
+                <foreach item="typeIn" collection="type.split(',')" open="(" separator="," close=")">
+                    #{typeIn}
+                </foreach>
+            </if>
             <if test="headPcBanner != null  and headPcBanner != ''"> and headPcBanner = #{headPcBanner}</if>
             <if test="headAppBanner != null  and headAppBanner != ''"> and headAppBanner = #{headAppBanner}</if>
             <if test="jumpStatus != null "> and jumpStatus = #{jumpStatus}</if>
@@ -54,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCmBrandBannerById" parameterType="String" resultMap="CmBrandBannerResult">
         <include refid="selectCmBrandBannerVo"/>
-        where id = #{id}
+        where id = #{id} and delFlag=0
     </select>
 
     <insert id="insertCmBrandBanner" parameterType="com.caimei365.user.model.po.CmBrandBanner" useGeneratedKeys="true" keyProperty="id">
@@ -133,4 +138,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>

+ 8 - 3
src/main/resources/mapper/CmBrandFilesMapper.xml

@@ -24,9 +24,14 @@
 
     <select id="selectCmBrandFilesList" parameterType="com.caimei365.user.model.po.CmBrandFiles" resultMap="CmBrandFilesResult">
         <include refid="selectCmBrandFilesVo"/>
-        <where>
+        <where>delFlag=0
             <if test="id != null "> and id = #{id}</if>
-            <if test="type != null "> and type = #{type}</if>
+            <if test="type != null and type != ''">
+                and type in
+                <foreach item="typeIn" collection="type.split(',')" open="(" separator="," close=")">
+                    #{typeIn}
+                </foreach>
+            </if>
             <if test="superId != null  and superId != ''"> and superId = #{superId}</if>
             <if test="fileName != null  and fileName != ''"> and fileName like concat('%', #{fileName}, '%')</if>
             <if test="ossName != null  and ossName != ''"> and ossName like concat('%', #{ossName}, '%')</if>
@@ -99,4 +104,4 @@
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>

+ 12 - 7
src/main/resources/mapper/CmBrandLandingMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.user.mapper.CmBrandLandingMapper">
-    
+
     <resultMap type="com.caimei365.user.model.po.CmBrandLanding" id="CmBrandLandingResult">
         <result property="id"    column="id"    />
         <result property="authUserId"    column="authUserId"    />
@@ -31,9 +31,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCmBrandLandingList" parameterType="com.caimei365.user.model.po.CmBrandLanding" resultMap="CmBrandLandingResult">
         <include refid="selectCmBrandLandingVo"/>
-        <where>  
+        <where>  delFlag=0
             <if test="authUserId != null "> and authUserId = #{authUserId}</if>
-            <if test="type != null "> and type = #{type}</if>
+            <if test="type != null and type != ''">
+                and type in
+                <foreach item="typeIn" collection="type.split(',')" open="(" separator="," close=")">
+                    #{typeIn}
+                </foreach>
+            </if>
             <if test="headPcBanner != null  and headPcBanner != ''"> and headPcBanner = #{headPcBanner}</if>
             <if test="headAppBanner != null  and headAppBanner != ''"> and headAppBanner = #{headAppBanner}</if>
             <if test="jumpStatus != null "> and jumpStatus = #{jumpStatus}</if>
@@ -51,12 +56,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="addTime != null "> and addTime = #{addTime}</if>
         </where>
     </select>
-    
+
     <select id="selectCmBrandLandingById" parameterType="String" resultMap="CmBrandLandingResult">
         <include refid="selectCmBrandLandingVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertCmBrandLanding" parameterType="com.caimei365.user.model.po.CmBrandLanding" useGeneratedKeys="true" keyProperty="id">
         insert into cm_brand_landing
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -128,9 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteCmBrandLandingByIds" parameterType="String">
-        delete from cm_brand_landing where id in 
+        delete from cm_brand_landing where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>