dev
parent
c0a396a84b
commit
d57eef3c6e
@ -1,7 +1,62 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.GoodsMsg; |
||||
import com.hfkj.model.goods.JdGoodsModel; |
||||
import com.hfkj.model.order.OrderCouponModel; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface GoodsMsgMapperExt { |
||||
|
||||
|
||||
@Select("<script>" + |
||||
" SELECT" + |
||||
" a.goods_type_parent_name as goodsTypeParentName," + |
||||
" a.goods_type_name as goodsTypeName," + |
||||
" a.goods_brand_name as goodsBrandName," + |
||||
" a.title as title," + |
||||
" a.list_img as listImg," + |
||||
" b.sale_price as salePrice, " + |
||||
" b.third_price as thirdPrice," + |
||||
" b.original_price as originalPrice," + |
||||
" a.third_id as thirdId" + |
||||
" FROM" + |
||||
" goods_msg a join goods_specs b on a.id = b.goods_id where a.type = 1 and a.child_type=1 and a.status = 1" + |
||||
" <if test='param.goodsTypeParent != null'> and a.goods_type_parent = #{param.goodsTypeParent} </if>" + |
||||
" <if test='param.title != null'> and b.title like concat('%',#{param.title},'%') </if>" + |
||||
" <if test='param.goodsType != null'> and a.goods_type = #{param.goodsType} </if>" + |
||||
" <if test='param.goodsBrand != null'> and a.goods_brand = #{param.goodsBrand} </if>" + |
||||
" <if test='param.salePriceS != null'><![CDATA[ and b.sale_price >= #{param.salePriceS} ]]></if>" + |
||||
" <if test='param.salePriceE != null'><![CDATA[ and b.sale_price <= #{param.salePriceE} ]]></if>" + |
||||
" ORDER BY b.sale_price asc" + |
||||
"</script>") |
||||
List<JdGoodsModel> getJdGoodsList(@Param("param") Map<String,Object> param); |
||||
|
||||
@Select("<script>" + |
||||
" SELECT" + |
||||
" id ," + |
||||
" title as title," + |
||||
" title as title," + |
||||
" list_img as listImg," + |
||||
" third_id as thirdId," + |
||||
" sale_num as saleNum" + |
||||
" FROM" + |
||||
" goods_msg where status = 1 " + |
||||
" <if test='param.goodsTypeParent != null'> and goods_type_parent = #{param.goodsTypeParent} </if>" + |
||||
" <if test='param.title != null'> and title like concat('%',#{param.title},'%') </if>" + |
||||
" <if test='param.goodsType != null'> and goods_type = #{param.goodsType} </if>" + |
||||
" <if test='param.goodsBrand != null'> and goods_brand = #{param.goodsBrand} </if>" + |
||||
" <if test='param.time != 1'>ORDER BY update_time desc</if>" + |
||||
" <if test='param.time == 1'>ORDER BY create_time desc</if>" + |
||||
" <if test='param.saleNum == 2'>, sale_num desc</if>" + |
||||
" <if test='param.limit != null'>limit #{param.limit}</if>" + |
||||
"</script>") |
||||
List<GoodsMsg> getGoodsListCrest(@Param("param") Map<String,Object> param); |
||||
|
||||
} |
@ -1,7 +1,27 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.GoodsMsg; |
||||
import com.hfkj.entity.GoodsSpecs; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface GoodsSpecsMapperExt { |
||||
|
||||
|
||||
|
||||
@Select("<script>" + |
||||
" SELECT" + |
||||
" goods_id as goodsId ," + |
||||
" sale_price as salePrice," + |
||||
" original_price as originalPrice" + |
||||
" FROM" + |
||||
" goods_specs where status = 1 " + |
||||
"</script>") |
||||
List<GoodsSpecs> getGoodsSpecsCrest(); |
||||
} |
@ -0,0 +1,58 @@ |
||||
package com.hfkj.model.goods; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @ClassName JdGoodsModel |
||||
* @Author Sum1Dream |
||||
* @Description 京东商品 |
||||
* @Date 2024/9/29 上午10:50 |
||||
**/ |
||||
@Data |
||||
public class JdGoodsModel { |
||||
|
||||
@ColumnWidth(50) |
||||
@ExcelProperty("一级分类") |
||||
public String goodsTypeParentName; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("二级分类") |
||||
public String goodsTypeName; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("品牌名称") |
||||
public String goodsBrandName; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("商品名称") |
||||
public String title; |
||||
|
||||
@ColumnWidth(40) |
||||
@ExcelProperty("列表图") |
||||
public String listImg; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty("售卖价格") |
||||
public BigDecimal salePrice; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("京东价") |
||||
public BigDecimal thirdPrice; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty({"原价"}) |
||||
public BigDecimal originalPrice; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty({"sku编码"}) |
||||
public String thirdId; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty({"销量"}) |
||||
public String saleNum; |
||||
|
||||
} |
Loading…
Reference in new issue