| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?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.ylx.giftCard.mapper.GiftCardOrderMapper">
- <select id="selectAdminGiftCardOrderPage" resultType="com.ylx.giftCard.domain.vo.GiftCardOrderPageVO">
- SELECT
- gco.id,
- gco.order_no AS orderId,
- gco.order_no AS orderNo,
- gco.gift_card_name AS giftCardName,
- gco.pay_amount AS payAmount,
- gco.user_name AS userName,
- gco.user_phone AS userPhone,
- gco.create_time AS orderTime,
- gco.commission_amount AS commissionAmount,
- mt.te_phone AS merchantAccount,
- gco.merchant_name AS merchantName,
- gco.merchant_nick_name AS merchantNickName
- FROM gift_card_order gco
- LEFT JOIN ma_technician mt ON mt.id = gco.merchant_id
- <where>
- <if test="dto.userName != null and dto.userName != ''">
- AND gco.user_name LIKE CONCAT('%', #{dto.userName}, '%')
- </if>
- <if test="dto.merchantName != null and dto.merchantName != ''">
- AND gco.merchant_name LIKE CONCAT('%', #{dto.merchantName}, '%')
- </if>
- <if test="dto.startTime != null and dto.startTime != ''">
- AND gco.create_time >= #{dto.startTime}
- </if>
- <if test="dto.endTime != null and dto.endTime != ''">
- AND gco.create_time <= #{dto.endTime}
- </if>
- </where>
- ORDER BY
- gco.create_time DESC
- </select>
- <select id="selectAdminGiftCardOrderExportList" resultType="com.ylx.giftCard.domain.vo.GiftCardOrderExportVO">
- SELECT
- gco.id AS orderId,
- gco.gift_card_name AS giftCardName,
- gco.pay_amount AS payAmount,
- gco.user_name AS userName,
- gco.user_phone AS userPhone,
- gco.create_time AS orderTime,
- gco.commission_amount AS commissionAmount,
- mt.te_phone AS merchantAccount,
- gco.merchant_name AS merchantName,
- gco.merchant_nick_name AS merchantNickName
- FROM gift_card_order gco
- LEFT JOIN ma_technician mt ON mt.id = gco.merchant_id
- <where>
- <if test="dto.userName != null and dto.userName != ''">
- AND gco.user_name LIKE CONCAT('%', #{dto.userName}, '%')
- </if>
- <if test="dto.merchantName != null and dto.merchantName != ''">
- AND gco.merchant_name LIKE CONCAT('%', #{dto.merchantName}, '%')
- </if>
- <if test="dto.startTime != null and dto.startTime != ''">
- AND gco.create_time >= #{dto.startTime}
- </if>
- <if test="dto.endTime != null and dto.endTime != ''">
- AND gco.create_time <= #{dto.endTime}
- </if>
- </where>
- ORDER BY
- gco.create_time DESC
- </select>
- <select id="selectPcPurchaseShoppingFundsDetail" resultType="com.ylx.giftCard.domain.vo.UserShoppingFundsDetailItemVO">
- SELECT
- gco.order_no AS orderNo,
- gco.gift_card_name AS giftCardName,
- gco.pay_amount AS orderAmount,
- gco.create_time AS orderTime
- FROM gift_card_order gco
- <where>
- gco.user_id = #{dto.userId}
- AND gco.status = 1
- <if test="dto.startTime != null and dto.startTime != ''">
- AND gco.create_time >= #{dto.startTime}
- </if>
- <if test="dto.endTime != null and dto.endTime != ''">
- AND gco.create_time <= #{dto.endTime}
- </if>
- </where>
- ORDER BY
- gco.create_time DESC
- </select>
- <select id="selectPcPurchaseShoppingFundsSummary" resultType="com.ylx.giftCard.domain.vo.UserShoppingFundsSummaryVO">
- SELECT
- COALESCE(SUM(gco.pay_amount), 0) AS totalAmount,
- COUNT(1) AS totalCount
- FROM gift_card_order gco
- <where>
- gco.user_id = #{dto.userId}
- AND gco.status = 1
- <if test="dto.startTime != null and dto.startTime != ''">
- AND gco.create_time >= #{dto.startTime}
- </if>
- <if test="dto.endTime != null and dto.endTime != ''">
- AND gco.create_time <= #{dto.endTime}
- </if>
- </where>
- </select>
- </mapper>
|