suochencheng 6 rokov pred
rodič
commit
d3ee084395

+ 58 - 16
src/main/java/com/izouma/awesomeadmin/dao/HomeAdMapper.xml

@@ -17,15 +17,17 @@
         <result column="title" property="title" jdbcType="VARCHAR"/>
         <result column="subtitle" property="subtitle" jdbcType="VARCHAR"/>
         <result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
-        <result column="path_url" property="pathUrl" jdbcType="VARCHAR"/>
+        <result column="product_id" property="productId" jdbcType="INTEGER"/>
         <result column="remark" property="remark" jdbcType="VARCHAR"/>
         <result column="rank" property="rank" jdbcType="INTEGER"/>
+        <result column="image2_url" property="image2Url" jdbcType="VARCHAR"/>
+        <result column="product2_id" property="product2Id" jdbcType="INTEGER"/>
         <!--generatedEnd-->
     </resultMap>
 
     <sql id="Base_Column_List">
         <!--generatedStart-->
-        id, del_flag, update_time, update_user, create_time, create_user, user_id, mini_id, store_id, status_flag, type_flag, title, subtitle, image_url, path_url, remark, rank        <!--generatedEnd-->
+        id, del_flag, update_time, update_user, create_time, create_user, user_id, mini_id, store_id, status_flag, type_flag, title, subtitle, image_url, product_id, remark, rank, image2_url, product2_id        <!--generatedEnd-->
     </sql>
 
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
@@ -87,8 +89,8 @@
             <if test="imageUrl!= null">
                 image_url,
             </if>
-            <if test="pathUrl!= null">
-                path_url,
+            <if test="productId!= null">
+                product_id,
             </if>
             <if test="remark!= null">
                 remark,
@@ -96,6 +98,12 @@
             <if test="rank!= null">
                 rank,
             </if>
+            <if test="image2Url!= null">
+                image2_url,
+            </if>
+            <if test="product2Id!= null">
+                product2_id,
+            </if>
             <!--generatedEnd-->
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -142,8 +150,8 @@
             <if test="imageUrl != null">
                 #{imageUrl,jdbcType=VARCHAR},
             </if>
-            <if test="pathUrl != null">
-                #{pathUrl,jdbcType=VARCHAR},
+            <if test="productId != null">
+                #{productId,jdbcType=INTEGER},
             </if>
             <if test="remark != null">
                 #{remark,jdbcType=VARCHAR},
@@ -151,6 +159,12 @@
             <if test="rank != null">
                 #{rank,jdbcType=INTEGER},
             </if>
+            <if test="image2Url != null">
+                #{image2Url,jdbcType=VARCHAR},
+            </if>
+            <if test="product2Id != null">
+                #{product2Id,jdbcType=INTEGER},
+            </if>
             <!--generatedEnd-->
         </trim>
     </insert>
@@ -201,8 +215,8 @@
             <if test="imageUrl != null">
                 image_url= #{imageUrl,jdbcType=VARCHAR},
             </if>
-            <if test="pathUrl != null">
-                path_url= #{pathUrl,jdbcType=VARCHAR},
+            <if test="productId != null">
+                product_id= #{productId,jdbcType=INTEGER},
             </if>
             <if test="remark != null">
                 remark= #{remark,jdbcType=VARCHAR},
@@ -210,6 +224,12 @@
             <if test="rank != null">
                 rank= #{rank,jdbcType=INTEGER},
             </if>
+            <if test="image2Url != null">
+                image2_url= #{image2Url,jdbcType=VARCHAR},
+            </if>
+            <if test="product2Id != null">
+                product2_id= #{product2Id,jdbcType=INTEGER},
+            </if>
             <!--generatedEnd-->
         </set>
         WHERE
@@ -271,8 +291,8 @@
             <if test="record.imageUrl != null and !&quot;&quot;.equals(record.imageUrl)">
                 AND image_url = #{record.imageUrl}
             </if>
-            <if test="record.pathUrl != null and !&quot;&quot;.equals(record.pathUrl)">
-                AND path_url = #{record.pathUrl}
+            <if test="record.productId != null and !&quot;&quot;.equals(record.productId)">
+                AND product_id = #{record.productId}
             </if>
             <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
                 AND remark = #{record.remark}
@@ -280,6 +300,12 @@
             <if test="record.rank != null and !&quot;&quot;.equals(record.rank)">
                 AND rank = #{record.rank}
             </if>
+            <if test="record.image2Url != null and !&quot;&quot;.equals(record.image2Url)">
+                AND image2_url = #{record.image2Url}
+            </if>
+            <if test="record.product2Id != null and !&quot;&quot;.equals(record.product2Id)">
+                AND product2_id = #{record.product2Id}
+            </if>
             <!--generatedEnd-->
             <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
                 <trim prefix="and (" suffix=")" prefixOverrides="OR">
@@ -290,8 +316,10 @@
                     OR title LIKE concat('%',#{record.searchKey},'%')
                     OR subtitle LIKE concat('%',#{record.searchKey},'%')
                     OR image_url LIKE concat('%',#{record.searchKey},'%')
-                    OR path_url LIKE concat('%',#{record.searchKey},'%')
+                    OR product_id LIKE concat('%',#{record.searchKey},'%')
                     OR remark LIKE concat('%',#{record.searchKey},'%')
+                    OR image2_url LIKE concat('%',#{record.searchKey},'%')
+                    OR product2_id LIKE concat('%',#{record.searchKey},'%')
                     <!--generatedEnd-->
                 </trim>
             </if>
@@ -387,8 +415,8 @@
             <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
                 AND image_url = #{imageUrl}
             </if>
-            <if test="pathUrl != null and !&quot;&quot;.equals(pathUrl)">
-                AND path_url = #{pathUrl}
+            <if test="productId != null and !&quot;&quot;.equals(productId)">
+                AND product_id = #{productId}
             </if>
             <if test="remark != null and !&quot;&quot;.equals(remark)">
                 AND remark = #{remark}
@@ -396,6 +424,12 @@
             <if test="rank != null and !&quot;&quot;.equals(rank)">
                 AND rank = #{rank}
             </if>
+            <if test="image2Url != null and !&quot;&quot;.equals(image2Url)">
+                AND image2_url = #{image2Url}
+            </if>
+            <if test="product2Id != null and !&quot;&quot;.equals(product2Id)">
+                AND product2_id = #{product2Id}
+            </if>
             <!--generatedEnd-->
             <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
                 <trim prefix="and (" suffix=")" prefixOverrides="OR">
@@ -406,8 +440,10 @@
                     OR title LIKE concat('%',#{searchKey},'%')
                     OR subtitle LIKE concat('%',#{searchKey},'%')
                     OR image_url LIKE concat('%',#{searchKey},'%')
-                    OR path_url LIKE concat('%',#{searchKey},'%')
+                    OR product_id LIKE concat('%',#{searchKey},'%')
                     OR remark LIKE concat('%',#{searchKey},'%')
+                    OR image2_url LIKE concat('%',#{searchKey},'%')
+                    OR product2_id LIKE concat('%',#{searchKey},'%')
                     <!--generatedEnd-->
                 </trim>
             </if>
@@ -499,8 +535,8 @@
             <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
                 AND image_url = #{imageUrl}
             </if>
-            <if test="pathUrl != null and !&quot;&quot;.equals(pathUrl)">
-                AND path_url = #{pathUrl}
+            <if test="productId != null and !&quot;&quot;.equals(productId)">
+                AND product_id = #{productId}
             </if>
             <if test="remark != null and !&quot;&quot;.equals(remark)">
                 AND remark = #{remark}
@@ -508,6 +544,12 @@
             <if test="rank != null and !&quot;&quot;.equals(rank)">
                 AND rank = #{rank}
             </if>
+            <if test="image2Url != null and !&quot;&quot;.equals(image2Url)">
+                AND image2_url = #{image2Url}
+            </if>
+            <if test="product2Id != null and !&quot;&quot;.equals(product2Id)">
+                AND product2_id = #{product2Id}
+            </if>
             <!--generatedEnd-->
         </where>
         LIMIT 1

+ 21 - 5
src/main/java/com/izouma/awesomeadmin/model/HomeAd.java

@@ -23,9 +23,11 @@ public class HomeAd{
     private String title;
     private String subtitle;
     private String imageUrl;
-    private String pathUrl;
+    private Integer productId;
     private String remark;
     private Integer rank;
+    private String image2Url;
+    private Integer product2Id;
 
     private String idStr;
 
@@ -141,12 +143,12 @@ public class HomeAd{
     public void setImageUrl(String imageUrl){
         this.imageUrl = imageUrl;
     }
-    public String getPathUrl(){
-        return this.pathUrl;
+    public Integer getProductId(){
+        return this.productId;
     }
 
-    public void setPathUrl(String pathUrl){
-        this.pathUrl = pathUrl;
+    public void setProductId(Integer productId){
+        this.productId = productId;
     }
     public String getRemark(){
         return this.remark;
@@ -162,6 +164,20 @@ public class HomeAd{
     public void setRank(Integer rank){
         this.rank = rank;
     }
+    public String getImage2Url(){
+        return this.image2Url;
+    }
+
+    public void setImage2Url(String image2Url){
+        this.image2Url = image2Url;
+    }
+    public Integer getProduct2Id(){
+        return this.product2Id;
+    }
+
+    public void setProduct2Id(Integer product2Id){
+        this.product2Id = product2Id;
+    }
 
     public String getSearchKey() {
         return searchKey;

+ 7 - 5
src/main/java/com/izouma/awesomeadmin/web/HomeAdController.java

@@ -100,10 +100,10 @@ public class HomeAdController {
         String sheetName = "home_ad";
         String titleName = "首页广告数据表";
         String fileName = "首页广告表";
-        int columnNumber = 17;
-        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
-        String[] columnName = {  "ID" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "用户Id" ,   "小程序" ,   "店铺" ,   "状态" ,   "类型" ,   "标题" ,   "子标题" ,   "图片" ,   "地址" ,   "备注" ,   "排序"  };
-        String[][] dataList = new String[homeAds.size()][17];
+        int columnNumber = 19;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "ID" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "用户Id" ,   "小程序" ,   "店铺" ,   "状态" ,   "类型" ,   "标题" ,   "子标题" ,   "图片1" ,   "商品1" ,   "备注" ,   "排序" ,   "图片2" ,   "商品2"  };
+        String[][] dataList = new String[homeAds.size()][19];
 
         for (int i = 0; i < homeAds.size(); i++) {
                         dataList[i][0] = String.valueOf(homeAds.get(i).getId());
@@ -120,9 +120,11 @@ public class HomeAdController {
                         dataList[i][11] = String.valueOf(homeAds.get(i).getTitle());
                         dataList[i][12] = String.valueOf(homeAds.get(i).getSubtitle());
                         dataList[i][13] = String.valueOf(homeAds.get(i).getImageUrl());
-                        dataList[i][14] = String.valueOf(homeAds.get(i).getPathUrl());
+                        dataList[i][14] = String.valueOf(homeAds.get(i).getProductId());
                         dataList[i][15] = String.valueOf(homeAds.get(i).getRemark());
                         dataList[i][16] = String.valueOf(homeAds.get(i).getRank());
+                        dataList[i][17] = String.valueOf(homeAds.get(i).getImage2Url());
+                        dataList[i][18] = String.valueOf(homeAds.get(i).getProduct2Id());
                     }
 
         ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 20 - 6
src/main/vue/src/pages/HomeAd.vue


+ 46 - 10
src/main/vue/src/pages/HomeAds.vue

@@ -103,7 +103,7 @@
                                             <el-table-column
                                 v-if="isColumnShow('imageUrl')"
                                 prop="imageUrl"
-                                label="图片"
+                                label="图片1"
                                 min-width="100">
                             <template slot-scope="{row}">
                                 <img :src="row.imageUrl" @click="showImg(row.imageUrl)" style="width: 100px;height: 100px;vertical-align: middle;" />
@@ -112,9 +112,9 @@
                         </el-table-column>
                                                                 
                                             <el-table-column
-                                v-if="isColumnShow('pathUrl')"
-                                prop="pathUrl"
-                                label="地址"
+                                v-if="isColumnShow('productId')"
+                                prop="productId"
+                                label="商品1"
                                 min-width="100">
                         </el-table-column>
                                                                 
@@ -131,6 +131,24 @@
                                 label="排序"
                                 min-width="100">
                         </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('image2Url')"
+                                prop="image2Url"
+                                label="图片2"
+                                min-width="100">
+                            <template slot-scope="{row}">
+                                <img :src="row.image2Url" @click="showImg(row.image2Url)" style="width: 100px;height: 100px;vertical-align: middle;" />
+                            </template>
+
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('product2Id')"
+                                prop="product2Id"
+                                label="商品2"
+                                min-width="100">
+                        </el-table-column>
                                                             <el-table-column
                     label="操作"
                     align="center"
@@ -315,13 +333,13 @@
                                 show: true
                             },
                                                                                                 {
-                                label: '图片',
+                                label: '图片1',
                                 value: 'imageUrl',
                                 show: true
                             },
                                                                                                 {
-                                label: '地址',
-                                value: 'pathUrl',
+                                label: '商品1',
+                                value: 'productId',
                                 show: true
                             },
                                                                                                 {
@@ -333,6 +351,16 @@
                                 label: '排序',
                                 value: 'rank',
                                 show: true
+                            },
+                                                                                                {
+                                label: '图片2',
+                                value: 'image2Url',
+                                show: true
+                            },
+                                                                                                {
+                                label: '商品2',
+                                value: 'product2Id',
+                                show: true
                             },
                                                             ],
                 multipleMode: false,
@@ -375,12 +403,12 @@
                                 value: 'subtitle'
                             },
                                                                                                 {
-                                label: '图片',
+                                label: '图片1',
                                 value: 'image_url'
                             },
                                                                                                 {
-                                label: '地址',
-                                value: 'path_url'
+                                label: '商品1',
+                                value: 'product_id'
                             },
                                                                                                 {
                                 label: '备注',
@@ -389,6 +417,14 @@
                                                                                                 {
                                 label: '排序',
                                 value: 'rank'
+                            },
+                                                                                                {
+                                label: '图片2',
+                                value: 'image2_url'
+                            },
+                                                                                                {
+                                label: '商品2',
+                                value: 'product2_id'
                             },
                                                             ],
                 advancedQuerySearchKey: '',

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov