| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.gree.mall.miniapp.commonmapper.AppMapper">
- <select id="queryShoppingCartList" resultType="com.gree.mall.miniapp.bean.order.ShoppingCartList">
- SELECT
- a.*,
- b.price,
- c.goods_name,
- b.spec_value,
- b.org_price,
- b.price * num AS 'totalPrice', c.img_url 'goodsImg',
- IFNULL(d.stock_qty, 0) AS stock_qty
- FROM shopping_cart a
- JOIN goods_spec b ON a.goods_spec_id = b.goods_spec_id
- JOIN goods c ON c.goods_id = a.goods_id
- LEFT JOIN goods_material_storage d ON b.goods_code = d.goods_material_id
- WHERE a.user_id = #{userId}
- <if test="storageId != null and storageId != ''">
- AND a.storage_id = #{storageId}
- </if>
- </select>
- <select id="orderStatusCount" resultType="com.gree.mall.miniapp.bean.order.OrderStatusBean">
- select sum(if(order_status = 'NOPAY', 1, 0)) noPay,
- sum(if(order_status in ('YFH','DFH'), 1, 0)) yfh,
- sum(if(order_status = 'DFH', 1, 0)) dfh,
- sum(if(order_status in ('REFUND'), 1, 0)) sh,
- sum(if(order_status = 'OVER' and comment_goods=0, 1, 0)) ywc
- from order_info
- where user_id = #{userId}
- </select>
- <select id="queryNewGoods" resultType="com.gree.mall.miniapp.bean.goods.GoodsNewBean">
- select
- a.*
- <if test="objId != null and objId != ''">
- ,b.obj_id
- </if>
- from goods a
- <if test="objId != null and objId != ''">
- join goods_news_category_goods b on a.goods_id = b.goods_id
- </if>
- where
- a.company_wechat_id = #{companyWechatId} and a.del=0 and a.status=1
- <if test="objId != null and objId != ''">
- and b.obj_id = #{objId}
- </if>
- <if test="type != null and type != ''">
- and b.type = #{type}
- </if>
- <if test="sort != null and sort==0">
- order by a.sort_num
- </if>
- <if test="sort != null and sort==1">
- order by a.sold_num desc
- </if>
- <if test="sort != null and sort==2">
- order by goods_price asc
- </if>
- <if test="sort != null and sort==3">
- order by goods_price desc
- </if>
- <if test="sort != null and sort==4">
- order by a.create_time desc
- </if>
- </select>
- </mapper>
|