| | |
| | | )A |
| | | </select> |
| | | |
| | | |
| | | |
| | | <sql id="SELECT_HONGBAO_STATE"> |
| | | <if test="state != null and state == 1"> <!-- 未到账 --> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2) |
| | | </if> |
| | | <if test="state != null and state == 2"> <!-- 已到账 --> |
| | | AND v2.hb_state = 3 |
| | | </if> |
| | | <if test="state != null and state == 3"> <!-- 红包已失效 --> |
| | | AND v2.hb_state =4 |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="listQueryByUid" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT hb.`hb_money` AS totalMoney, |
| | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |