GoodsInfoMapper.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="org.springblade.modules.mall.mapper.GoodsInfoMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="goodsInfoResultMap" type="org.springblade.modules.mall.entity.GoodsInfo">
  6. <id column="id" property="id"/>
  7. <result column="goods_no" property="goodsNo"/>
  8. <result column="goods_name" property="goodsName"/>
  9. <result column="goods_cover" property="goodsCover"/>
  10. <result column="goods_lable" property="goodsLable"/>
  11. <result column="origin" property="origin"/>
  12. <result column="goods_category_id" property="goodsCategoryId"/>
  13. <result column="brand_id" property="brandId"/>
  14. <result column="is_sale" property="isSale"/>
  15. <result column="sale_time" property="saleTime"/>
  16. <result column="is_recom" property="isRecom"/>
  17. <result column="is_hot" property="isHot"/>
  18. <result column="is_new" property="isNew"/>
  19. <result column="is_free_shipping" property="isFreeShipping"/>
  20. <result column="free_price" property="freePrice"/>
  21. <result column="total_stock" property="totalStock"/>
  22. <result column="total_sales" property="totalSales"/>
  23. <result column="total_views" property="totalViews"/>
  24. <result column="unit" property="unit"/>
  25. <result column="business_type" property="businessType"/>
  26. <result column="is_partner" property="isPartner"/>
  27. <result column="third_id" property="thirdId"/>
  28. <result column="source" property="source"/>
  29. <result column="is_delete" property="isDelete"/>
  30. <result column="create_user_id" property="createUserId"/>
  31. <result column="create_time" property="createTime"/>
  32. <result column="update_user_id" property="updateUserId"/>
  33. <result column="update_time" property="updateTime"/>
  34. </resultMap>
  35. <select id="selectGoodsInfoPage" resultMap="goodsInfoResultMap">
  36. select * from biz_goods_info where is_deleted = 0
  37. </select>
  38. <select id="activityGoods" resultType="org.springblade.modules.mall.entity.GoodsInfo">
  39. SELECT gi.* FROM biz_activities_goods ag JOIN biz_goods_info gi on ag.goods_info_id = gi.id
  40. WHERE gi.is_delete = 0 and gi.is_activity = 1 and gi.is_sale = 1 and ag.is_delete = 0
  41. <if test="@cn.hutool.core.util.StrUtil@isNotBlank(activityDate)">
  42. and ag.activity_date = #{activityDate}
  43. </if>
  44. ORDER BY gi.sort
  45. </select>
  46. </mapper>