Prechádzať zdrojové kódy

bugfix:1408 推荐喜欢套餐

qxy 1 mesiac pred
rodič
commit
9a8cd0b23d

+ 6 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeGroupBuyMainVo.java

@@ -27,6 +27,12 @@ public class LifeGroupBuyMainVo extends LifeGroupBuyMain {
     @ApiModelProperty(value = "商家名称")
     private String storeName;
 
+    @ApiModelProperty(value = "商家评分")
+    private String scoreAvg;
+
+    @ApiModelProperty(value = "团购图片url")
+    private String imagePaths;
+
     @ApiModelProperty(value = "商家手机号")
     private String phone;
 

+ 60 - 0
alien-entity/src/main/java/shop/alien/mapper/LifeGroupBuyMainMapper.java

@@ -1,5 +1,7 @@
 package shop.alien.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,9 +10,14 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
+import org.apache.poi.ss.formula.functions.T;
 import shop.alien.entity.store.LifeGroupBuyMain;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import shop.alien.entity.store.vo.LifeGroupBuyMainVo;
 import shop.alien.entity.store.vo.LifeGroupBuyThaliVo;
 
+import java.util.List;
+
 /**
 * @author youch
 * @description 针对表【life_group_buy_main(团购主表)】的数据库操作Mapper
@@ -46,6 +53,59 @@ public interface LifeGroupBuyMainMapper extends BaseMapper<LifeGroupBuyMain> {
             @Param("buyCount") int buyCount,
             @Param("soldOutStatus") int soldOutStatus
     );
+
+    @Select("SELECT\n" +
+            "    g.id AS id,\n" +
+            "    g.group_no AS group_no,\n" +
+            "    g.group_type AS group_type,\n" +
+            "    g.status AS status,\n" +
+            "    g.approval_comments AS approval_comments,\n" +
+            "    g.store_id AS store_id,\n" +
+            "    g.image_id AS image_id,\n" +
+            "    g.group_name AS group_name,\n" +
+            "    g.start_time_type AS start_time_type,\n" +
+            "    g.start_time_value AS start_time_value,\n" +
+            "    g.end_time AS end_time,\n" +
+            "    g.inventory_num AS inventory_num,\n" +
+            "    g.quota_type AS quota_type,\n" +
+            "    g.quota_value AS quota_value,\n" +
+            "    g.original_price AS original_price,\n" +
+            "    g.preferential_price AS preferential_price,\n" +
+            "    g.effective_date_type AS effective_date_type,\n" +
+            "    g.effective_date_value AS effective_date_value,\n" +
+            "    g.disable_date_type AS disable_date_type,\n" +
+            "    g.disable_date_value AS disable_date_value,\n" +
+            "    g.write_off AS write_off,\n" +
+            "    g.reservation_rules AS reservation_rules,\n" +
+            "    g.use_rules AS use_rules,\n" +
+            "    g.applicable_num AS applicable_num,\n" +
+            "    g.other_rules AS other_rules,\n" +
+            "    g.invoice_type AS invoice_type,\n" +
+            "    g.invoice_describe AS invoice_describe,\n" +
+            "    g.insured_flag AS insured_flag,\n" +
+            "    g.insured_price AS insured_price,\n" +
+            "    g.coupon_id AS coupon_id,\n" +
+            "    g.delete_flag AS delete_flag,\n" +
+            "    g.created_time AS created_time,\n" +
+            "    g.updated_time AS updated_time,\n" +
+            "    g.created_user_id AS created_user_id,\n" +
+            "    g.updated_user_id AS updated_user_id,\n" +
+            "    s.store_name AS store_name,\n" +
+            "    s.score_avg AS scoreAvg,\n" +
+            "    IFNULL(GROUP_CONCAT(img.img_url SEPARATOR ','), '') AS imagePaths\n" +
+            "FROM\n" +
+            "    life_group_buy_main g\n" +
+            "LEFT JOIN store_info s \n" +
+            "    ON g.store_id = s.id \n" +
+            "    AND s.delete_flag = 0 \n" +
+            "LEFT JOIN store_img img \n" +
+            "    ON FIND_IN_SET(img.id, g.image_id) > 0 \n" +
+            "    AND img.delete_flag = 0\t\t \n" +
+            "WHERE\n" +
+            "    g.delete_flag = 0\n" +
+            "GROUP BY\n" +
+            "    g.id")
+    List<LifeGroupBuyMainVo> getLifeGroupInfo(@Param(Constants.WRAPPER) LambdaQueryWrapper<LifeGroupBuyMainVo> queryWrapper);
 }