Przeglądaj źródła

Merge branch 'dev' into 'mp-server-test'

优化

See merge request quanshu/mp-server!949
jiang hao 2 lat temu
rodzic
commit
9184156338

+ 9 - 1
mp-service/src/main/resources/mapper/admin/TicketAwardsPrizeMapper.xml

@@ -44,25 +44,33 @@
             case t1.prize_type
                 when 'goods' then if(t2.title is not null, t2.title, t1.title)
                 when 'coupon' then if(t3.title is not null, t3.title, t1.title)
+                when 'coupon_pkg' then if(t4.title is not null, t4.title, t1.title)
+                else t1.title
             end as title,
 
             case t1.prize_type
                 when 'goods' then if(t2.pic_url is not null, t2.pic_url, t1.pic_url)
                 when 'coupon' then if(t3.pic_url is not null, t3.pic_url, t1.pic_url)
+                when 'coupon_pkg' then if(t4.pic_url is not null, t4.pic_url, t1.pic_url)
+                else t1.pic_url
             end as pic_url,
 
             case t1.prize_type
                 when 'goods' then if(t2.value is not null, t2.value, t1.value)
                 when 'coupon' then if(t3.discount is not null, t3.discount, t1.value)
+                when 'coupon_pkg' then if(t4.face_price is not null, t4.face_price, t1.value)
+                else t1.value
             end as value,
 
             case t1.prize_type
                 when 'goods' then if(t2.cost is not null, t2.cost, 0)
+                else 0
             end as cost,
             t1.*
         from mp_ticket_awards_prize t1
             left join mp_goods t2 on t1.ref_id = t2.goods_id
             left join mp_coupon t3 on t1.ref_id = t3.coupon_id
-            ${ew.customSqlSegment}
+            left join mp_coupon_pkg t4 on t1.ref_id = t4.id
+        ${ew.customSqlSegment}
     </select>
 </mapper>

+ 17 - 18
mp-service/src/main/resources/mapper/admin/TicketBoxGoodsMapper.xml

@@ -22,30 +22,29 @@
     <select id="listByQueryWrapper" resultType="com.qs.mp.admin.domain.vo.TicketBoxGoodsVO">
         select
             case t1.type
-            when 'goods' then if(t2.title is not null, t2.title, t1.title)
-            when 'coupon' then if(t3.title is not null, t3.title, t1.title)
-            when 'coupon_pkg' then if(t4.title is not null, t4.title, t1.title)
-            else t1.title
-        end as title,
+                when 'goods' then if(t2.title is not null, t2.title, t1.title)
+                when 'coupon' then if(t3.title is not null, t3.title, t1.title)
+                when 'coupon_pkg' then if(t4.title is not null, t4.title, t1.title)
+                else t1.title
+            end as title,
 
             case t1.type
-            when 'goods' then if(t2.pic_url is not null, t2.pic_url, t1.pic_url)
-            when 'coupon' then if(t3.pic_url is not null, t3.pic_url, t1.pic_url)
-            when 'coupon_pkg' then if(t4.pic_url is not null, t4.pic_url, t1.pic_url)
-            else t1.pic_url
-        end as pic_url,
+                when 'goods' then if(t2.pic_url is not null, t2.pic_url, t1.pic_url)
+                when 'coupon' then if(t3.pic_url is not null, t3.pic_url, t1.pic_url)
+                when 'coupon_pkg' then if(t4.pic_url is not null, t4.pic_url, t1.pic_url)
+                else t1.pic_url
+            end as pic_url,
 
             case t1.type
-            when 'goods' then if(t2.value is not null, t2.value, t1.value)
-            when 'coupon' then if(t3.discount is not null, t3.discount, t1.value)
-            when 'coupon_pkg' then if(t4.face_price is not null, t4.face_price, t1.value)
-            else t1.value
-
-        end as value,
+                when 'goods' then if(t2.value is not null, t2.value, t1.value)
+                when 'coupon' then if(t3.discount is not null, t3.discount, t1.value)
+                when 'coupon_pkg' then if(t4.face_price is not null, t4.face_price, t1.value)
+                else t1.value
+            end as value,
 
             case t1.type
-            when 'goods' then if(t2.cost is not null, t2.cost, 0)
-            else 0
+                when 'goods' then if(t2.cost is not null, t2.cost, 0)
+                else 0
             end as cost,
 
            t1.*