zj
2024-06-03 287ac389edd047696d956afafdb855a93830bc0c
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
77
<?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.nq.dao.DkMapper">
    <resultMap id="BaseResultMap" type="com.nq.pojo.DkModel">
        <result column="id" property="id"/>
        <result column="dk_money" property="dkMoney"/>
        <result column="sp_money" property="spMoney"/>
        <result column="create_time" property="createTime"/>
        <result column="dk_user_id" property="dkUserId"/>
        <result column="dk_state" property="dkState"/>
        <result column="dk_message" property="dkMessage"/>
        <result column="dk_jg_id" property="dkJgId"/>
    </resultMap>
 
 
    <resultMap id="BaseResultMap1" type="com.nq.vo.dk.DkModelVo">
        <result column="id" property="id"/>
        <result column="dk_money" property="dkMoney"/>
        <result column="sp_money" property="spMoney"/>
        <result column="create_time" property="createTime"/>
        <result column="dk_user_id" property="dkUserId"/>
        <result column="dk_state" property="dkState"/>
        <result column="dk_message" property="dkMessage"/>
        <result  column="agent_name" property="dkUserName"/>
        <result column="dk_phone"  property="dkPhone"/>
        <result column="dk_jg" property="dkJgName"/>
    </resultMap>
    <sql id="Base_Column_List">
        id
        ,
                dk_money,
                sp_money,
                create_time,
                dk_user_id,
                dk_state,
                dk_message
    </sql>
 
    <select id="queryDk" resultMap="BaseResultMap1">
        select d.id,
               d.dk_money,
               d.sp_money,
               d.create_time,
               d.dk_user_id,
               d.dk_state,
               d.dk_phone,
               d.dk_message,
               u.agent_name
        from dk d
                 join user u
                      on d.dk_user_id = u.id
    </select>
 
 
 
 
    <select id="queryByShUserId" resultMap="BaseResultMap1" parameterType="String">
        select d.id,
               d.dk_money,
               d.sp_money,
               d.create_time,
               d.dk_user_id,
               d.dk_state,
               d.dk_message,
               d.dk_phone,
               u.agent_name,
               d.dk_jg_id,
               jg.dk_jg
        from dk d
                 join user u
                      on d.dk_user_id = u.id
                 join  dk_jg jg  on  jg.id =  d.dk_jg_id
        where d.dk_user_id = #{id}
    </select>
 
</mapper>