Pu Zhibing
2025-05-16 4c99ee7028c3fe58a2cd4b8273b22c75c45574fc
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
<?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.TPubTransactionDetailsMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TPubTransactionDetails">
        <id column="id" property="id" />
        <result column="userId" property="userId" />
        <result column="insertTime" property="insertTime" />
        <result column="remark" property="remark" />
        <result column="money" property="money" />
        <result column="state" property="state" />
        <result column="type" property="type" />
        <result column="userType" property="userType" />
        <result column="orderType" property="orderType" />
        <result column="orderId" property="orderId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, userId, insertTime, remark, money, state, type, userType, orderType, orderId
    </sql>
 
    <select id="selectUserList" parameterType="com.baomidou.mybatisplus.plugins.Page" resultType="map">
        select
            a.id as id,
            a.userId as userId,
            a.insertTime as insertTime,
            a.remark as remark,
            a.money as money,
            a.state as state,
            a.type as type,
            a.userType as userType,
            a.orderType as orderType,
            a.orderId as orderId,
            b.phone as phone,
            b.nickName as nickName
        from
            t_pub_transaction_details a
        inner join
            t_user b
          on a.userId=b.id
        where a.userType=1
        <if test="userId != null and userId != ''">
            and a.userId=#{userId}
        </if>
        <if test="phone != null and phone != ''">
            and b.phone=#{phone}
        </if>
        <if test="state != null and state != ''">
            and a.state=#{state}
        </if>
        order by a.insertTime desc
    </select>
 
</mapper>