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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?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.AgentAgencyFeeMapper">
    <resultMap id="BaseResultMap" type="com.nq.pojo.AgentAgencyFee" >
        <result column="id" property="id" />
        <result column="agent_id" property="agentId" />
        <result column="status" property="status" />
        <result column="business_id" property="businessId" />
        <result column="fee_type" property="feeType" />
        <result column="ayment_type" property="aymentType" />
        <result column="total_money" property="totalMoney" />
        <result column="profit_money" property="profitMoney" />
        <result column="add_time" property="addTime" />
        <result column="update_time" property="updateTime" />
        <result column="remarks" property="remarks" />
    </resultMap>
 
    <sql id="Base_Column_List">
                id,
                agent_id,
                status,
                business_id,
                fee_type,
                ayment_type,
                total_money,
                profit_money,
                add_time,
                update_time,
                remarks
    </sql>
 
    <insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.nq.pojo.AgentAgencyFee">
        INSERT INTO agent_agency_fee
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test ='null != agentId'>
                agent_id,
            </if>
            <if test ='null != status'>
                status,
            </if>
            <if test ='null != businessId'>
                business_id,
            </if>
            <if test ='null != feeType'>
                fee_type,
            </if>
            <if test ='null != aymentType'>
                ayment_type,
            </if>
            <if test ='null != totalMoney'>
                total_money,
            </if>
            <if test ='null != profitMoney'>
                profit_money,
            </if>
            add_time,
            <if test ='null != updateTime'>
                update_time,
            </if>
            <if test ='null != remarks'>
                remarks
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test ='null != agentId'>
                #{agentId},
            </if>
            <if test ='null != status'>
                #{status},
            </if>
            <if test ='null != businessId'>
                #{businessId},
            </if>
            <if test ='null != feeType'>
                #{feeType},
            </if>
            <if test ='null != aymentType'>
                #{aymentType},
            </if>
            <if test ='null != totalMoney'>
                #{totalMoney},
            </if>
            <if test ='null != profitMoney'>
                #{profitMoney},
            </if>
                now(),
            <if test ='null != updateTime'>
                #{updateTime},
            </if>
            <if test ='null != remarks'>
                #{remarks}
            </if>
        </trim>
    </insert>
 
    <delete id="delete" >
        DELETE FROM agent_agency_fee
        WHERE id = #{id}
    </delete>
 
    <update id="update" parameterType="com.nq.pojo.AgentAgencyFee">
        UPDATE agent_agency_fee
        <set>
            <if test ='null != agentId'>agent_id = #{agentId},</if>
            <if test ='null != status'>status = #{status},</if>
            <if test ='null != businessId'>business_id = #{businessId},</if>
            <if test ='null != feeType'>fee_type = #{feeType},</if>
            <if test ='null != aymentType'>ayment_type = #{aymentType},</if>
            <if test ='null != addTime'>add_time = #{addTime},</if>
            <if test ='null != updateTime'>update_time = #{updateTime},</if>
            <if test ='null != remarks'>remarks = #{remarks}</if>
        </set>
        WHERE id = #{id}
    </update>
 
 
    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM agent_agency_fee
        WHERE id = #{id}
    </select>
 
    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM agent_agency_fee
        LIMIT #{offset}, #{pageSize}
    </select>
 
    <select id="getAgentAgencyFeeList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM agent_agency_fee
        WHERE agent_id = #{agent_id} and status = 1
        order by id asc
    </select>
 
    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM agent_agency_fee
    </select>
 
</mapper>