xin
15 hours ago 501eba8c1c5b58fb3e5f442dcf892a460148e0c0
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?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.oying.modules.system.mapper.InvitationsMapper">
    <resultMap id="BaseResultMap" type="com.oying.modules.system.domain.Invitations">
        <id column="invitations_id" property="invitationsId"/>
        <result column="inviter_id" property="inviterId"/>
        <result column="inviter_phone" property="inviterPhone"/>
        <result column="inviter_name" property="inviterName"/>
        <result column="inviter_open_id" property="inviterOpenId"/>
        <result column="new_user_open_id" property="newUserOpenId"/>
        <result column="new_user_id" property="newUserId"/>
        <result column="new_user_name" property="newUserName"/>
        <result column="new_user_phone" property="newUserPhone"/>
        <result column="type" property="type"/>
        <result column="user_type" property="userType"/>
        <result column="status" property="status"/>
        <result column="reward_value" property="rewardValue"/>
        <result column="reward_type" property="rewardType"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by" property="updateBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        invitations_id, inviter_id, inviter_phone, inviter_name, inviter_open_id, new_user_open_id, new_user_id, new_user_name, new_user_phone, type, user_type, status, reward_value, reward_type, create_by, update_by, create_time, update_time
    </sql>
 
    <select id="findAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sys_invitations
        <where>
            <if test="criteria.inviterId != null">
                and inviter_id = #{criteria.inviterId}
            </if>
            <if test="criteria.inviterPhone != null">
                and inviter_phone like concat('%',#{criteria.inviterPhone},'%')
            </if>
            <if test="criteria.inviterName != null">
                and inviter_name like concat('%',#{criteria.inviterName},'%')
            </if>
            <if test="criteria.inviterOpenId != null">
                and inviter_open_id = #{criteria.inviterOpenId}
            </if>
            <if test="criteria.newUserOpenId != null">
                and new_user_open_id = #{criteria.newUserOpenId}
            </if>
            <if test="criteria.newUserId != null">
                and new_user_id = #{criteria.newUserId}
            </if>
            <if test="criteria.newUserName != null">
                and new_user_name like concat('%',#{criteria.newUserName},'%')
            </if>
            <if test="criteria.newUserPhone != null">
                and new_user_phone like concat('%',#{criteria.newUserPhone},'%')
            </if>
            <if test="criteria.type != null">
                and type = #{criteria.type}
            </if>
            <if test="criteria.userType != null">
                and user_type = #{criteria.userType}
            </if>
            <if test="criteria.status != null">
                and status = #{criteria.status}
            </if>
            <if test="criteria.rewardType != null">
                and reward_type = #{criteria.rewardType}
            </if>
            <if test="criteria.createTime != null and criteria.createTime.size() > 0">
                AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]}
            </if>
        </where>
        order by invitations_id desc
    </select>
</mapper>