manailin
2021-07-08 df14c88843bfeb2cf1168f806db23dd8ca3a828d
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
<?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.panzhihua.service_community.dao.ComActUserWalletTradeMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActUserWalletTradeDO">
        <id column="id" property="id" />
        <result column="user_id" property="userId" />
        <result column="community_id" property="communityId" />
        <result column="service_id" property="serviceId" />
        <result column="amount" property="amount" />
        <result column="type" property="type" />
        <result column="remark" property="remark" />
        <result column="create_at" property="createAt" />
        <result column="create_by" property="createBy" />
        <result column="wallet_id" property="walletId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, user_id, community_id, service_id, amount, type, remark, create_at, create_by, wallet_id
    </sql>
 
    <select id="getUserWalletTradeList" resultType="com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeVO"
            parameterType="com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO">
        SELECT
            cauwt.id,
            ca.`name` AS communityName,
            cauwt.type,
            cauwt.remark,
            cauwt.change_type,
            cauwt.amount,
            cauwt.create_at
        FROM
            com_act_user_wallet_trade AS cauwt
            LEFT JOIN com_act AS ca ON ca.community_id = cauwt.community_id
            where cauwt.community_id = #{walletTradeDTO.communityId}
            and cauwt.user_id = #{walletTradeDTO.userId}
    </select>
 
</mapper>