SellerWalletDetailMapper.xml
2.84 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
<?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.yoho.order.dal.SellerWalletDetailMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.SellerWalletDetail" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="wallet_id" property="walletId" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="type" property="type" jdbcType="TINYINT" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="is_batch" property="isBatch" jdbcType="INTEGER" />
<result column="attach_value" property="attachValue" jdbcType="VARCHAR" />
<result column="avail_amount" property="availAmount" jdbcType="DECIMAL" />
<result column="lock_amount" property="lockAmount" jdbcType="DECIMAL" />
<result column="is_set" property="isSet" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, wallet_id, uid, order_code, amount, type, create_time, update_time,is_batch,attach_value,avail_amount,lock_amount,is_set
</sql>
<select id="selectUserBreakRulesCount" resultType="java.lang.Integer" >
select
count(id)
from seller_wallet_detail
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (31,32,33,34)
</select>
<select id="selectMerchantInfoCount" resultType="java.lang.Integer" >
select count(*) from seller_wallet_detail
where is_batch = 0 <include refid="condi" />
</select>
<select id="selectMerchantInfo" resultMap="BaseResultMap">
select * from seller_wallet_detail
where is_batch = 0 <include refid="condi" /> order by id desc limit #{start},#{rows}
</select>
<select id="selectById" resultMap="BaseResultMap">
select * from seller_wallet_detail
where id = #{id,jdbcType=INTEGER}
</select>
<sql id="condi">
<if test="uids != null">
and uid in
<foreach collection="uids" item="uid" open="(" close=")" separator=",">
#{uid}
</foreach>
</if>
<if test="startTime != null and startTime > 0">
and create_time >= #{startTime,jdbcType=INTEGER}
</if>
<if test="endTime != null and endTime > 0">
and create_time <= #{endTime,jdbcType=INTEGER}
</if>
<if test="orderCode != null and orderCode != ''">
and order_code=#{orderCode}
</if>
<if test="stateList != null and stateList.size()>0">
and type in
<foreach collection="stateList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</sql>
</mapper>