Browse Source

关联已认证设备 SN码列表bugfix

kaick 1 year ago
parent
commit
aca93ae332
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/main/resources/mapper/BannerMapper.xml

+ 7 - 4
src/main/resources/mapper/BannerMapper.xml

@@ -2,15 +2,18 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.mapper.cmMapper.BannerMapper">
     <insert id="addBanner">
-        INSERT INTO cm_brand_banner(`authUserId`, `headPcBanner`, `headAppBanner`, `jumpStatus`, `jumpPcPicture`, `jumpAppPicture`, `jumpLink`)
-        VALUES ( #{authUserId},#{headPcBanner},#{headAppBanner},#{jumpStatus},#{jumpPcPicture},#{jumpAppPicture},#{jumpLink});
+        INSERT INTO cm_brand_banner(`authUserId`, `headPcBanner`, `headAppBanner`, `jumpStatus`, `jumpPcPicture`, `jumpAppPicture`, `jumpLink`,type)
+        VALUES ( #{authUserId},#{headPcBanner},#{headAppBanner},#{jumpStatus},#{jumpPcPicture},#{jumpAppPicture},#{jumpLink},1);
     </insert>
     <update id="setBanner">
     UPDATE `cm_brand_banner` SET  `headPcBanner` = #{headPcBanner}, `headAppBanner` = #{headAppBanner},
     `jumpStatus` = #{jumpStatus},
     `jumpPcPicture` = #{jumpPcPicture}, `jumpAppPicture` = #{jumpAppPicture},
     `jumpLink` = #{jumpLink}
-    WHERE `authUserId` = #{authUserId};
+    WHERE `authUserId` = #{authUserId}
+        <if test="id != null">
+             and id = #{id}
+        </if>
     </update>
     <delete id="deleteBanner">
         delete from cm_brand_banner where authUserId = #{authUserId}
@@ -18,6 +21,6 @@
     <select id="geteBanner" resultType="com.caimei.model.po.CmBrandBannerPo">
         SELECT id,`authUserId`, `headPcBanner`, `headAppBanner`, `jumpStatus`, `jumpPcPicture`, `jumpAppPicture`, `jumpLink`
         FROM cm_brand_banner
-        where authUserId=#{authUserId} LIMIT 0,1
+        where type=1 and authUserId=#{authUserId} LIMIT 0,1
     </select>
 </mapper>