ActivtyTemplatedFloorMapper.xml
2.49 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
<?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.resource.dal.ActivtyTemplatedFloorMapper" >
<resultMap id="BaseResultMap" type="com.yoho.resource.model.ActivtyTemplatedFloor" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="activty_templated_id" property="activtyTemplatedId" jdbcType="INTEGER" />
<result column="order" property="order" jdbcType="INTEGER" />
<result column="is_del" property="isDel" jdbcType="TINYINT" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.yoho.resource.model.ActivtyTemplatedFloor" extends="BaseResultMap" >
<result column="module_data" property="moduleData" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, activty_templated_id, `order`, is_del
</sql>
<sql id="Blob_Column_List" >
module_data
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from activty_templated_floor
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insertBatch">
insert into activty_templated_floor (activty_templated_id, `order`, module_data)
values
<foreach collection="floors" item="item" separator=",">
(#{item.activtyTemplatedId,jdbcType=INTEGER}, #{item.order,jdbcType=INTEGER}, #{item.moduleData,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yoho.resource.model.ActivtyTemplatedFloor" >
update activty_templated_floor
set activty_templated_id = #{activtyTemplatedId,jdbcType=INTEGER},
`order` = #{order,jdbcType=INTEGER},
is_del = #{isDel,jdbcType=TINYINT},
module_data = #{moduleData,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByTemplateId" parameterType="java.lang.Integer" >
update activty_templated_floor
set
is_del = 1
where activty_templated_id = #{templatedId,jdbcType=INTEGER}
</update>
<select id="selectByTemplatedId" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from activty_templated_floor
where activty_templated_id = #{templatedId,jdbcType=INTEGER} AND is_del = 0 ORDER BY `order` ASC
</select>
</mapper>