LotteryMapper.xml
3.2 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.lottery.dal.LotteryMapper">
<resultMap id="BaseResultMap" type="com.yoho.lottery.dal.model.Lottery">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="start_time" jdbcType="INTEGER" property="startTime" />
<result column="end_time" jdbcType="INTEGER" property="endTime" />
<result column="user_limit" jdbcType="INTEGER" property="userLimit" />
<result column="person_total" jdbcType="INTEGER" property="personTotal" />
<result column="limit_by_flag" jdbcType="VARCHAR" property="limitByFlag" />
<result column="probability" jdbcType="INTEGER" property="probability" />
<result column="pid" jdbcType="INTEGER" property="pid" />
<result column="create_time" jdbcType="INTEGER" property="createTime" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="image" jdbcType="VARCHAR" property="image" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from lottery
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.lottery.dal.model.Lottery">
insert into lottery (id, name, start_time,
end_time, user_limit, person_total,
limit_by_flag, probability, pid,
create_time, status,remark,image)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=INTEGER},
#{endTime,jdbcType=INTEGER}, #{userLimit,jdbcType=INTEGER}, #{personTotal,jdbcType=INTEGER},
#{limitByFlag,jdbcType=VARCHAR}, #{probability,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER},
#{createTime,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{image,jdbcType=VARCHAR})
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.lottery.dal.model.Lottery">
update lottery
set name = #{name,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=INTEGER},
end_time = #{endTime,jdbcType=INTEGER},
user_limit = #{userLimit,jdbcType=INTEGER},
person_total = #{personTotal,jdbcType=INTEGER},
limit_by_flag = #{limitByFlag,jdbcType=VARCHAR},
probability = #{probability,jdbcType=INTEGER},
pid = #{pid,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
image = #{image,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select id, name, start_time, end_time, user_limit, person_total, limit_by_flag, probability,
pid, create_time, status, remark,image
from lottery
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select id, name, start_time, end_time, user_limit, person_total, limit_by_flag, probability,
pid, create_time, status, remark,image
from lottery
</select>
</mapper>