GoodsMapper.xml 981 B

123456789101112131415161718192021222324
  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="com.chelvc.cloud.vehicle.server.dao.GoodsMapper">
  4. <select id="listMerchantSimpleGoods" resultType="com.chelvc.cloud.vehicle.api.dto.GoodsDTO">
  5. select id, name, logo, original_price, special_price, score, sale
  6. from `goods`
  7. <where>
  8. merchant_id = #{merchantId}
  9. <if test="param.offset != null">
  10. and id > #{param.offset}
  11. </if>
  12. <if test="param.type != null">
  13. and type = #{param.type}
  14. </if>
  15. </where>
  16. limit #{param.size}
  17. </select>
  18. <select id="listMerchantGoodsCategoryTypes" resultType="com.chelvc.cloud.vehicle.api.constant.CategoryType">
  19. select distinct type
  20. from `goods`
  21. where merchant_id = #{merchantId} and status = 'ONLINE'
  22. </select>
  23. </mapper>