InBoxAttrMapper.xml
1.47 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
<?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.yohoufo.dal.user.IInBoxAttrDao">
<resultMap id="BaseResultMap" type="com.yohoufo.dal.user.model.InBoxAttr">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="inbox_id" property="inboxId" jdbcType="INTEGER"/>
<result column="uid" property="uid" jdbcType="INTEGER"/>
<result column="json_content" property="jsonContent" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, inbox_id, uid, json_content
</sql>
<insert id="insert" parameterType="com.yohoufo.dal.user.model.InBoxAttr">
INSERT INTO inbox_attr (inbox_id, uid, json_content)
values
(#{inboxId},#{uid},#{jsonContent})
</insert>
<select id="selectInboxAttrList" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM inbox_attr where uid = #{uid}
<if test="inboxIdList != null and inboxIdList.size()>0">
and inbox_id in
<foreach item="item" index="index" collection="inboxIdList"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<update id="updateJsonContent">
update inbox_attr set json_content=#{jsonContent}
where inbox_id=#{inboxId} and uid=#{uid}
</update>
</mapper>