xuhy
2023-10-19 78851285202a040f8ddf998c067cd462874c1cb9
ManagementTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserCouponRecordMapper.xml
@@ -70,55 +70,6 @@
            and c.state=#{state}
        </if>
    </select>
    <select id="getListt" resultType="map">
        SELECT
        c.id,
        c.money,
        c.fullMoney,
        c.expirationTime,
        c.insertTime,
        c.companyId,
        c.state,
        c.couponUseType,
        c.couponType,
        c.userId,
        c.couponId,
        c.couponActivityId,
        c.activityType,
        u.nickName,
        u.phone,
        if(a.id is null, if(b.id is null, if(d.id is null, if(e.id is null, '', e.endServiceTime), d.endServiceTime), b.endServiceTime), a.endServiceTime) as useTime
        FROM
        t_user_coupon_record c
        LEFT JOIN t_user u ON c.userId = u.id
        left join t_order_private_car a on (a.couponId = c.id)
        left join t_order_taxi b on (b.couponId = c.id)
        left join t_order_cross_city d on (d.couponId = c.id)
        left join t_order_logistics e on (e.couponId = c.id)
        WHERE 1=1
        <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
            and (c.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
        </if>
        <if test="userName != null and userName !=''">
            and u.nickName like CONCAT('%',#{userName},'%')
        </if>
        <if test="activityType != null and activityType !=''">
            and c.activityType=#{activityType}
        </if>
        <if test="userPhone != null and userPhone !=''">
            and u.phone like CONCAT('%',#{userPhone},'%')
        </if>
        <if test="couponActivityId != null and couponActivityId !=''">
            and c.couponActivityId=#{couponActivityId}
        </if>
        <if test="state != null and state !=''">
            and c.state=#{state}
        </if>
    </select>
    <select  id="getRedList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
        SELECT
            c.id,
@@ -156,47 +107,6 @@
            and c.state=#{state}
        </if>
    </select>
    <select  id="getRedListt" resultType="map">
        SELECT
        c.id,
        c.money,
        c.expirationTime,
        c.insertTime,
        c.companyId,
        c.state,
        c.userId,
        c.redPacketActivityId,
        u.nickName,
        u.phone,
        if(a.id is null, if(b.id is null, if(d.id is null, if(e.id is null, '', e.endServiceTime), d.endServiceTime), b.endServiceTime), a.endServiceTime) as useTime
        FROM
        t_user_red_packet_record c
        LEFT JOIN t_user u ON c.userId = u.id
        left join t_order_private_car a on (a.redPacketId = c.id)
        left join t_order_taxi b on (b.redPacketId = c.id)
        left join t_order_cross_city d on (d.redPacketId = c.id)
        left join t_order_logistics e on (e.redPacketId = c.id)
        WHERE 1=1
        <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
            and (c.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
        </if>
        <if test="userName != null and userName !=''">
            and u.nickName like CONCAT('%',#{userName},'%')
        </if>
        <if test="userPhone != null and userPhone !=''">
            and u.phone like CONCAT('%',#{userPhone},'%')
        </if>
        <if test="couponActivityId != null and couponActivityId !=''">
            and c.redPacketActivityId=#{couponActivityId}
        </if>
        <if test="state != null and state !=''">
            and c.state=#{state}
        </if>
    </select>
    <select id="getCouponStatic" resultType="map">
        SELECT
            IFNULL(SUM(money), 0) money,