无关风月
2024-08-20 9f88b12d16c83963dad8fb8f79d9eeba2c311518
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
<?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.stylefeng.guns.modular.system.dao.CouponMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Coupon">
        <id column="id" property="id" />
        <result column="couponName" property="couponName" />
        <result column="timeType" property="timeType" />
        <result column="grantType" property="grantType" />
        <result column="startTime" property="startTime" />
        <result column="endTime" property="endTime" />
        <result column="afterDay" property="afterDay" />
        <result column="needClockIn" property="needClockIn" />
        <result column="buyCourseId" property="buyCourseId" />
        <result column="money" property="money" />
        <result column="reduction" property="reduction" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, couponName, timeType, grantType, startTime, endTime, afterDay, needClockIn, buyCourseId, money, reduction
    </sql>
    <select id="getList" resultType="com.stylefeng.guns.modular.system.model.CouponReceive">
        select t1.* from t_coupon_receive t1
        where t1.userId = #{req.userId}
 
        <if test="req.type == 2">
            and t1.state = 2
        </if>
        <if test="req.type == 3">
            and t1.state = 1
        </if>
        <if test="req.type == 4">
            and t1.state = 3
        </if>
        limit #{req.pageNum}, #{req.pageSize}
    </select>
</mapper>