LotteryPrizeMapper.xml
2.9 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
<?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.LotteryPrizeMapper">
<resultMap id="BaseResultMap" type="com.yoho.lottery.dal.model.LotteryPrize">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="lottery_id" jdbcType="INTEGER" property="lotteryId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="prize_id" jdbcType="INTEGER" property="prizeId" />
<result column="prize_name" jdbcType="VARCHAR" property="prizeName" />
<result column="prize_remark" jdbcType="VARCHAR" property="prizeRemark" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="create_time" jdbcType="INTEGER" property="createTime" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from lottery_prize
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.lottery.dal.model.LotteryPrize">
insert into lottery_prize (id, lottery_id, user_id,
user_name, prize_id, prize_name,
prize_remark, order_code, create_time
)
values (#{id,jdbcType=INTEGER}, #{lotteryId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER},
#{userName,jdbcType=VARCHAR}, #{prizeId,jdbcType=INTEGER}, #{prizeName,jdbcType=VARCHAR},
#{prizeRemark,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}
)
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.lottery.dal.model.LotteryPrize">
update lottery_prize
set lottery_id = #{lotteryId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
user_name = #{userName,jdbcType=VARCHAR},
prize_id = #{prizeId,jdbcType=INTEGER},
prize_name = #{prizeName,jdbcType=VARCHAR},
prize_remark = #{prizeRemark,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select id, lottery_id, user_id, user_name, prize_id, prize_name, prize_remark, order_code,
create_time
from lottery_prize
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select id, lottery_id, user_id, user_name, prize_id, prize_name, prize_remark, order_code,
create_time
from lottery_prize
</select>
<select id="selectPrize" resultMap="BaseResultMap">
select user_name, prize_id, prize_name,prize_remark
from lottery_prize where lottery_id=#{lotteryId,jdbcType=INTEGER} order by id desc limit #{startIndex,jdbcType=INTEGER}, #{length,jdbcType=INTEGER}
</select>
</mapper>