|
|
@@ -27,6 +27,9 @@
|
|
|
,t.trade_desc
|
|
|
,t.activity_ids
|
|
|
,t.activity_item_ids
|
|
|
+ ,t.integral
|
|
|
+ ,t.coupon_use_id
|
|
|
+ ,t.staff_name
|
|
|
</sql>
|
|
|
|
|
|
<resultMap type="com.dk.oauth.entity.Trade" id="ResultMap">
|
|
|
@@ -83,6 +86,7 @@
|
|
|
<result column="receiptStatusName" property="receiptStatusName"/>
|
|
|
<result column="integral" property="integral"/>
|
|
|
<result column="staff_name" property="staffName"/>
|
|
|
+ <result column="coupon_name" property="couponName"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
|
@@ -99,7 +103,12 @@
|
|
|
AND t.trade_status = #{tradeStatus}
|
|
|
</if>
|
|
|
<if test="receiptStatus != null and receiptStatus != ''">
|
|
|
- AND t.receipt_status = #{receiptStatus}
|
|
|
+ <if test="receiptStatus == '开票状态-未开票'">
|
|
|
+ AND (t.receipt_status = #{receiptStatus} OR t.receipt_status IS NULL)
|
|
|
+ </if>
|
|
|
+ <if test="receiptStatus != '开票状态-未开票'">
|
|
|
+ AND t.receipt_status = #{receiptStatus}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="tradeNo != null and tradeNo != ''">
|
|
|
AND t.trade_no = #{tradeNo}
|
|
|
@@ -144,11 +153,13 @@
|
|
|
,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n} ) AS "tradeTypeName"
|
|
|
,sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n} ) AS "tradeStatusName"
|
|
|
,sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n} ) AS "receiptStatusName"
|
|
|
+ ,tmc.coupon_name
|
|
|
FROM dkic_a.t_cp_trade t
|
|
|
left join sys.t_grade g on t.buy_grade_code = g.grade_code
|
|
|
LEFT JOIN sys.t_data_kind tdk1 ON tdk1.kind_code = t.trade_type
|
|
|
LEFT JOIN sys.t_data_kind tdk2 ON tdk2.kind_code = t.trade_status
|
|
|
LEFT JOIN sys.t_data_kind tdk3 ON tdk3.kind_code = t.receipt_status
|
|
|
+ LEFT JOIN dkic_a.t_mst_coupon tmc ON tmc.coupon_id = t.coupon_use_id
|
|
|
<include refid="Condition"/>
|
|
|
order by t.trade_time desc
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|