BlackUserMapper.xml
1.85 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
<?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.BlackUserMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.BlackUser" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="black_type" property="blackType" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="reason" property="reason" jdbcType="VARCHAR" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, black_type, create_time, reason, update_time, status
</sql>
<select id="selectByUid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from black_user
where uid = #{uid,jdbcType=INTEGER}
</select>
<delete id="deleteByUid">
delete from black_user
where uid = #{uid,jdbcType=INTEGER}
</delete>
<delete id="deleteByUidsAndBlackType">
delete from black_user
where uid in
<foreach collection="uids" item="uid" open="(" close=")" separator=",">
#{uid,jdbcType=INTEGER}
</foreach>
and black_type = #{blackType,jdbcType=INTEGER}
</delete>
<insert id="insert">
insert into black_user (uid, black_type, create_time, reason, update_time, status)
values
<foreach collection="records" item="record" separator=",">
(#{record.uid,jdbcType=INTEGER}, #{record.blackType,jdbcType=INTEGER}, #{record.createTime,jdbcType=INTEGER},
#{record.reason,jdbcType=VARCHAR}, #{record.updateTime,jdbcType=INTEGER}, #{record.status,jdbcType=INTEGER})
</foreach>
</insert>
</mapper>