IMStoreAccountOrderCheckingMapper.xml
5.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?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.sibu.orderHelper.integral.web.dao.IMWebStoreAccountOrderCheckingDao">
<sql id="column">
order_checking_id,
supplier_id,
supplier_name,
settle_start_date,
settle_end_date,
business_money,
reality_business_money,
coupon_money,
refund_money,
service_charge,
receivable_service_charge,
discount_rate,
profits,
audit_status,
create_sys_user_id,
create_dt,
audit_sys_user_id,
audit_dt,
affirm_sys_user_id,
affirm_dt,
deduction_vb,
deduction_vb_price,
lose_dt,
refund_vb_price,
refund_vb
</sql>
<resultMap type="com.sibu.orderHelper.integral.model.StoreAccountOrderChecking" id="accountOrderChecking">
<id column="order_checking_id" property="orderCheckingId" />
<result column="supplier_id" property="supplierId" />
<result column="supplier_name" property="supplierName"></result>
<result column="settle_start_date" property="settleStartDate" />
<result column="settle_end_date" property="settleEndDate" />
<result column="business_money" property="businessMoney" />
<result column="reality_business_money" property="realityBusinessMoney" />
<result column="coupon_money" property="couponMoney" />
<result column="refund_money" property="refundMoney" />
<result column="service_charge" property="serviceCharge" />
<result column="receivable_service_charge" property="receivableServiceCharge" />
<result column="discount_rate" property="discountRate" />
<result column="profits" property="profits" />
<result column="audit_status" property="auditStatus" />
<result column="create_sys_user_id" property="createSysUserId" />
<result column="create_dt" property="createDt" />
<result column="audit_sys_user_id" property="auditSysUserId" />
<result column="audit_dt" property="auditDt" />
<result column="deduction_vb_price" property="deductionVbPrice" />
<result column="deduction_vb" property="deductionVb" />
<result column="affirm_sys_user_id" property="affirmSysUserId" />
<result column="affirm_dt" property="affirmDt" />
<result column="lose_dt" property="loseDt" />
<result column="refund_vb_price" property="refundVbPrice" />
<result column="refund_vb" property="refundVb" />
</resultMap>
<resultMap type="com.sibu.orderHelper.integral.model.ExportExcelAccountOrderChecking" id="exportAccountOrderChecking">
<id column="order_checking_id" property="orderCheckingId" />
<result column="supplier_id" property="supplierId" />
<result column="supplier_name" property="supplierName"></result>
<result column="settle_start_date" property="settleStartDate" />
<result column="settle_end_date" property="settleEndDate" />
<result column="business_money" property="businessMoney" />
<result column="reality_business_money" property="realityBusinessMoney" />
<result column="coupon_money" property="couponMoney" />
<result column="refund_money" property="refundMoney" />
<result column="service_charge" property="serviceCharge" />
<result column="receivable_service_charge" property="receivableServiceCharge" />
<result column="discount_rate" property="discountRate" />
<result column="profits" property="profits" />
<result column="audit_status" property="auditStatus" />
<result column="create_sys_user_id" property="createSysUserId" />
<result column="create_dt" property="createDt" />
<result column="audit_sys_user_id" property="auditSysUserId" />
<result column="audit_dt" property="auditDt" />
<result column="deduction_vb_price" property="deductionVbPrice" />
<result column="deduction_vb" property="deductionVb" />
<result column="affirm_sys_user_id" property="affirmSysUserId" />
<result column="affirm_dt" property="affirmDt" />
<result column="lose_dt" property="loseDt" />
<result column="refund_vb_price" property="refundVbPrice" />
<result column="refund_vb" property="refundVb" />
</resultMap>
<!-- 对账单列表查询-->
<select id="listAccountOrder" parameterType="map" resultMap="accountOrderChecking">
select <include refid="column"></include>
from acc_order_checking acc
where 1=1
and acc.supplier_id = #{supplierId}
and acc.audit_status in(3,4,5)
<if test="auditStatus !=null and auditStatus!=''">
and acc.audit_status = #{auditStatus}
</if>
<if test="settleStartDate != null and settleStartDate !=''">
and acc.settle_end_date >= #{settleStartDate}
</if>
<if test="settleEndDate != null and settleEndDate != ''">
<![CDATA[
and acc.settle_end_date <= #{settleEndDate}
]]>
</if>
limit ${pageNow}, ${pageSize}
</select>
<!-- 查询对账单数量 -->
<select id="countAccountOrder" parameterType="map" resultType="int">
select count(1) as number
from acc_order_checking acc
where 1=1
and acc.supplier_id = #{supplierId}
and acc.audit_status in(3,4,5)
<if test="auditStatus !=null and auditStatus!=''">
and acc.audit_status = #{auditStatus}
</if>
<if test="settleStartDate != null and settleStartDate !=''">
and acc.settle_end_date >= #{settleStartDate}
</if>
<if test="settleEndDate != null and settleEndDate != ''">
<![CDATA[
and acc.settle_end_date <= #{settleEndDate}
]]>
</if>
</select>
<!-- 确认对账单 -->
<update id="passOrder" parameterType="map">
UPDATE acc_order_checking acc
<trim prefix="SET" suffixOverrides=",">
audit_status = 4,affirm_dt=now(),
</trim>
WHERE order_checking_id = #{orderCheckingId} and acc.supplier_id = #{supplierId}
</update>
<!-- 通过id导出对账单-->
<select id="exportAccountOrderById" resultMap="exportAccountOrderChecking">
select <include refid="column"></include>
from acc_order_checking
where 1=1
<if test="orderCheckingId !=null and orderCheckingId!=''">
and order_checking_id = #{orderCheckingId}
</if>
<if test="supplierId !=null and supplierId!=''">
and supplier_id = #{supplierId}
</if>
</select>
</mapper>