|
|
@@ -21,6 +21,18 @@
|
|
|
<result property="couponValue" column="couponValue"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap id="CouponReportOrderDtoMap" type="org.springblade.salesPart.coupon.dto.CouponReportOrderDto">
|
|
|
+ <id property="id" column="id"/>
|
|
|
+ <result property="orderNo" column="ord_no"/>
|
|
|
+ <result property="customerId" column="customer_id"/>
|
|
|
+ <result property="customerName" column="customer_name"/>
|
|
|
+ <result property="numberRows" column="number_rows"/>
|
|
|
+ <result property="goodsTotalNum" column="goods_total_num"/>
|
|
|
+ <result property="totalMoney" column="total_money"/>
|
|
|
+ <result property="redPacketAmount" column="red_packet_amount"/>
|
|
|
+ <result property="businessDate" column="busines_date"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
|
|
|
<insert id="saveBatch">
|
|
|
INSERT INTO tire_user_coupon (
|
|
|
@@ -145,4 +157,30 @@
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+ <select id="getCouponReportOrderList" resultMap="CouponReportOrderDtoMap">
|
|
|
+ SELECT DISTINCT
|
|
|
+ po.id,
|
|
|
+ po.ord_no,
|
|
|
+ po.customer_id,
|
|
|
+ po.customer_name,
|
|
|
+ po.number_rows,
|
|
|
+ po.goods_total_num,
|
|
|
+ po.total_money,
|
|
|
+ po.busines_date
|
|
|
+ FROM
|
|
|
+ tire_user_coupon u
|
|
|
+ INNER JOIN pjpf_order po ON u.order_id = po.id
|
|
|
+ WHERE
|
|
|
+ u.acquire_time IS NOT NULL
|
|
|
+ AND u.STATUS = 1
|
|
|
+ <if test="checkType == 1">
|
|
|
+ AND po.returns_status = '无'
|
|
|
+ </if>
|
|
|
+ <if test="checkType == 0">
|
|
|
+ AND po.returns_status != '无'
|
|
|
+ </if>
|
|
|
+ and u.tenant_id = #{tenantId}
|
|
|
+ and po.tenant_id = #{tenantId}
|
|
|
+ and u.corps_id = #{customerId}
|
|
|
+ </select>
|
|
|
</mapper>
|