TActivityAbcbankDiscountSMapper.xml
4.74 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
<?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.bill.mapper.smapper.TActivityAbcbankDiscountSMapper">
<resultMap id="BaseResultMap" type="com.zteits.bill.domain.TActivityAbcbankDiscount">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="disc_no" jdbcType="VARCHAR" property="discNo" />
<result column="disc_name" jdbcType="VARCHAR" property="discName" />
<result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="pay_type" jdbcType="INTEGER" property="payType" />
<result column="day_limit_num" jdbcType="INTEGER" property="dayLimitNum" />
<result column="month_limit_num" jdbcType="INTEGER" property="monthLimitNum" />
<result column="all_limit_fee" jdbcType="BIGINT" property="allLimitFee" />
<result column="residue_limit_fee" jdbcType="BIGINT" property="residueLimitFee" />
<result column="order_min_fee" jdbcType="BIGINT" property="orderMinFee" />
<result column="order_max_fee" jdbcType="BIGINT" property="orderMaxFee" />
<result column="order_fee" jdbcType="BIGINT" property="orderFee" />
<result column="disc_type" jdbcType="INTEGER" property="discType" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="disc_state" jdbcType="INTEGER" property="discState" />
<result column="auditor_status" jdbcType="INTEGER" property="auditorStatus" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="data_state" jdbcType="INTEGER" property="dataState" />
<result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
<result column="create_name" jdbcType="VARCHAR" property="createName" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="modify_emp_id" jdbcType="VARCHAR" property="modifyEmpId" />
<result column="modify_name" jdbcType="VARCHAR" property="modifyName" />
<result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
<result column="no_pass_pay_switch" jdbcType="INTEGER" property="noPassPaySwitch" />
<result column="app_pay_switch" jdbcType="INTEGER" property="appPaySwitch" />
<result column="h5_pay_switch" jdbcType="INTEGER" property="h5PaySwitch" />
</resultMap>
<sql id="Base_Column_List">
id, disc_no, disc_name, begin_time, end_time, pay_type, day_limit_num, month_limit_num,
all_limit_fee, residue_limit_fee, order_min_fee, order_max_fee, order_fee, disc_type,
org_id, disc_state, auditor_status, remarks,
data_state, create_emp_id, create_name, create_date, modify_emp_id, modify_name,
modify_date, no_pass_pay_switch, app_pay_switch, h5_pay_switch
</sql>
<select id="queryUseActivityAbcbankDiscountInfo" parameterType="com.zteits.clouds.api.dto.bill.param.TActivityAbcbankDiscountRequest"
resultType="com.zteits.bill.domain.TActivityAbcbankDiscount">
select
t.id as id,
t.disc_no as discNo,
t.disc_name as discName,
t.begin_time as beginTime,
t.end_time as endTime,
t.pay_type as payType,
t.day_limit_num as dayLimitNum,
t.month_limit_num as monthLimitNum,
t.all_limit_fee as allLimitFee,
t.residue_limit_fee as residueLimitFee,
t.order_min_fee as orderMinFee,
t.order_max_fee as orderMaxFee,
t.order_fee as orderFee,
t.disc_type as discType,
t.org_id as orgId,
t.disc_state as discState,
t.auditor_status as auditorStatus,
t.remarks as remarks
from t_activity_Abcbank_discount t
left join t_activity_abcbank_discount_desc d on t.disc_no = d.disc_no
where t.data_state = 1
and t.disc_state = 1
and t.auditor_status = 2
<![CDATA[and t.begin_time <= #{nowTime}]]>
<![CDATA[and t.end_time >=#{nowTime}]]>
and t.pay_type = #{payType}
and d.recharge_amount = #{payFee}
and t.org_id = #{orgId}
and t.residue_limit_fee >= (#{payFee} - t.order_fee)* d.subsidy_disc/100
Group by t.disc_no
</select>
<update id="upateAbcbankDiscountResidueFee" parameterType="com.zteits.clouds.api.dto.bill.param.TActivityAbcbankDiscountRequest">
update t_activity_Abcbank_discount
set residue_limit_fee = residue_limit_fee - #{payFee},
modify_date = #{nowTime}
where disc_no = #{discNo}
</update>
<update id="setTActivityAbcbankDiscountFalse" parameterType="com.zteits.clouds.api.dto.bill.param.TActivityAbcbankDiscountRequest">
update
t_activity_Abcbank_discount
set
end_time = #{endTime},
disc_state = 2
WHERE
disc_state in(0 ,1)
</update>
</mapper>