OrderVipcardSmapper.xml
6.02 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
<?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.zteits.order.mapper.smapper.OrderVipcardSmapper" >
<resultMap id="BaseResultMap" type="com.zteits.order.domain.OrderVipcard">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" />
<result column="order_type" jdbcType="INTEGER" property="orderType" />
<result column="order_state" jdbcType="INTEGER" property="orderState" />
<result column="terminal_source" jdbcType="INTEGER" property="terminalSource" />
<result column="order_dicount_fee" jdbcType="BIGINT" property="orderDicountFee" />
<result column="order_act_fee" jdbcType="BIGINT" property="orderActFee" />
<result column="order_total_fee" jdbcType="BIGINT" property="orderTotalFee" />
<result column="data_state" jdbcType="INTEGER" property="dataState" />
<result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
<result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="modfiy_emp_id" jdbcType="VARCHAR" property="modfiyEmpId" />
<result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
<result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="qeual_type" jdbcType="INTEGER" property="qeualType" />
<result column="diff_type" jdbcType="INTEGER" property="diffType" />
<result column="diff_compare_date" jdbcType="TIMESTAMP" property="diffCompareDate" />
<result column="trade_service_fee" jdbcType="BIGINT" property="tradeServiceFee" />
<result column="platform_service_fee" jdbcType="BIGINT" property="platformServiceFee" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
</resultMap>
<sql id="Base_Column_List" >
id, order_id, order_type, order_state, terminal_source, order_dicount_fee, order_act_fee,
order_total_fee, data_state, create_emp_id, create_emp_name, create_date, modfiy_emp_id,
modfiy_emp_name, modfiy_date, remark, qeual_type, diff_type, diff_compare_date, trade_service_fee,
platform_service_fee, org_id, org_name
</sql>
<!-- 通过会员卡订单ID or 主键查询会员卡对象 -->
<select id="queryOrderVipcardByOrderIdOrId" resultMap="BaseResultMap" parameterType="com.zteits.clouds.api.dto.order.vipcardorder.param.OrderVipcardQueryByOrderIdReq" >
select
<include refid="Base_Column_List" />
from order_vipcard
where 1=1
<if test="id != null ">
and id = #{id,jdbcType=BIGINT}
</if>
<if test="orderId != null and orderId !='' ">
and order_id = #{orderId,jdbcType=VARCHAR}
</if>
<choose>
<when test="dataState != null">
and data_state = #{dataState,jdbcType=INTEGER}
</when>
<otherwise>
and data_state = 1
</otherwise>
</choose>
</select>
<!-- 通过订单Id修改会员卡 -->
<update id="updateOrderVipCardByOrderId" parameterType="com.zteits.order.domain.OrderVipcard" >
update order_vipcard
<set >
<if test="orderType != null" >
order_type = #{orderType,jdbcType=INTEGER},
</if>
<if test="orderState != null" >
order_state = #{orderState,jdbcType=INTEGER},
</if>
<if test="terminalSource != null" >
terminal_source = #{terminalSource,jdbcType=INTEGER},
</if>
<if test="orderDicountFee != null" >
order_dicount_fee = #{orderDicountFee,jdbcType=BIGINT},
</if>
<if test="orderActFee != null" >
order_act_fee = #{orderActFee,jdbcType=BIGINT},
</if>
<if test="orderTotalFee != null" >
order_total_fee = #{orderTotalFee,jdbcType=BIGINT},
</if>
<if test="dataState != null" >
data_state = #{dataState,jdbcType=INTEGER},
</if>
<if test="createEmpId != null" >
create_emp_id = #{createEmpId,jdbcType=VARCHAR},
</if>
<if test="createEmpName != null" >
create_emp_name = #{createEmpName,jdbcType=VARCHAR},
</if>
<if test="createDate != null" >
create_date = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="modfiyEmpId != null" >
modfiy_emp_id = #{modfiyEmpId,jdbcType=VARCHAR},
</if>
<if test="modfiyEmpName != null" >
modfiy_emp_name = #{modfiyEmpName,jdbcType=VARCHAR},
</if>
<if test="modfiyDate != null" >
modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
</if>
<if test="remark != null" >
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="qeualType != null">
qeual_type = #{qeualType,jdbcType=INTEGER},
</if>
<if test="diffType != null">
diff_type = #{diffType,jdbcType=INTEGER},
</if>
<if test="diffCompareDate != null">
diff_compare_date = #{diffCompareDate,jdbcType=TIMESTAMP},
</if>
<if test="tradeServiceFee != null">
trade_service_fee = #{tradeServiceFee,jdbcType=BIGINT},
</if>
<if test="platformServiceFee != null">
platform_service_fee = #{platformServiceFee,jdbcType=BIGINT},
</if>
</set>
where order_id = #{orderId,jdbcType=VARCHAR}
</update>
<!--查询未对账的会员卡订单数据-->
<select id="queryVipCardForList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from order_vipcard
where 1=1
AND DATE_FORMAT(create_date,'%Y-%m-%d') =#{createTime}
AND qeual_type = 0 /**平账类型 -1:帐未平, 0:未开始平账 1:账已平*/
and data_state = 1
and order_state in(40,50) /**订单状态 10:待核算、20:待支付、30:支付中,40:已支付、50:已完成*/
<if test="modId != null and modId >=0">
and id%#{threadNum}=#{modId}
</if>
</select>
</mapper>