wujianwei
5 天以前 849648e82e5dec96f9f30fcc9c9bd799268b1f4c
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?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.ruoyi.cwgl.mapper.ReceivableFeeDetailMapper">
 
    <resultMap type="com.ruoyi.cwgl.domain.ReceivableFeeDetail" id="ReceivableFeeDetailResult">
        <result property="id"    column="id"    />
        <result property="receivableFeeId"    column="receivable_fee_id"    />
        <result property="feeType"    column="fee_type"    />
        <result property="feeName"    column="fee_name"    />
        <result property="billingUnit"    column="billing_unit"    />
        <result property="unitPrice"    column="unit_price"    />
        <result property="billingQuantity"    column="billing_quantity"    />
        <result property="billingAmount"    column="billing_amount"    />
        <result property="actualAmount"    column="actual_amount"    />
        <result property="currency"    column="currency"    />
        <result property="feeRegTime"    column="fee_reg_time"    />
        <result property="remark"    column="remark"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleted"    column="deleted"    />
    </resultMap>
 
    <sql id="selectReceivableFeeDetailVo">
        select thisTab.id, thisTab.receivable_fee_id, thisTab.fee_type, thisTab.fee_name, thisTab.billing_unit, thisTab.unit_price, thisTab.billing_quantity, thisTab.billing_amount, thisTab.actual_amount, thisTab.currency, thisTab.fee_reg_time, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from receivable_fee_detail AS thisTab
    </sql>
    <sql id="selectReceivableFeeDetailVoCount">
        select count(0) from receivable_fee_detail as thisTab
    </sql>
 
    <sql id="whereCondition">
        <if test="receivableFeeId != null "> and thisTab.receivable_fee_id = #{receivableFeeId}</if>
        <if test="feeType != null  and feeType != ''"> and thisTab.fee_type = #{feeType}</if>
        <if test="feeName != null  and feeName != ''"> and  thisTab.fee_name like concat('%', #{feeName}, '%')</if>
        <if test="billingUnit != null  and billingUnit != ''"> and thisTab.billing_unit = #{billingUnit}</if>
        <if test="unitPrice != null "> and thisTab.unit_price = #{unitPrice}</if>
        <if test="billingQuantity != null "> and thisTab.billing_quantity = #{billingQuantity}</if>
        <if test="billingAmount != null "> and thisTab.billing_amount = #{billingAmount}</if>
        <if test="actualAmount != null "> and thisTab.actual_amount = #{actualAmount}</if>
        <if test="currency != null  and currency != ''"> and thisTab.currency = #{currency}</if>
        <if test="feeRegTime != null "> and thisTab.fee_reg_time = #{feeRegTime}</if>
        <if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
    </sql>
 
    <!--查询-->
    <select id="selectReceivableFeeDetailById" parameterType="Integer" resultMap="ReceivableFeeDetailResult">
        <include refid="selectReceivableFeeDetailVo"/>
        where id = #{id}
    </select>
 
    <select id="selectReceivableFeeDetailCount" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail" resultType="int">
        <include refid="selectReceivableFeeDetailVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
 
    <select id="selectReceivableFeeDetailList" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail" resultMap="ReceivableFeeDetailResult">
        <include refid="selectReceivableFeeDetailVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
 
    <!-- 新增 -->
    <insert id="insertReceivableFeeDetail" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail"  useGeneratedKeys="true" keyProperty="id">
        insert into receivable_fee_detail
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="receivableFeeId != null">receivable_fee_id,</if>
            <if test="feeType != null and feeType != ''">fee_type,</if>
            <if test="feeName != null and feeName != ''">fee_name,</if>
            <if test="billingUnit != null">billing_unit,</if>
            <if test="unitPrice != null">unit_price,</if>
            <if test="billingQuantity != null">billing_quantity,</if>
            <if test="billingAmount != null">billing_amount,</if>
            <if test="actualAmount != null">actual_amount,</if>
            <if test="currency != null">currency,</if>
            <if test="feeRegTime != null">fee_reg_time,</if>
            <if test="remark != null">remark,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="deleted != null">deleted,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="receivableFeeId != null">#{receivableFeeId},</if>
            <if test="feeType != null and feeType != ''">#{feeType},</if>
            <if test="feeName != null and feeName != ''">#{feeName},</if>
            <if test="billingUnit != null">#{billingUnit},</if>
            <if test="unitPrice != null">#{unitPrice},</if>
            <if test="billingQuantity != null">#{billingQuantity},</if>
            <if test="billingAmount != null">#{billingAmount},</if>
            <if test="actualAmount != null">#{actualAmount},</if>
            <if test="currency != null">#{currency},</if>
            <if test="feeRegTime != null">#{feeRegTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="deleted != null">#{deleted},</if>
         </trim>
    </insert>
 
    <insert id="insertReceivableFeeDetailBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into receivable_fee_detail
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            receivable_fee_id,fee_type,fee_name,billing_unit,unit_price,billing_quantity,billing_amount,actual_amount,currency,fee_reg_time,remark,create_by,create_time,update_by,update_time,deleted,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.receivableFeeId},#{item.feeType},#{item.feeName},#{item.billingUnit},#{item.unitPrice},#{item.billingQuantity},#{item.billingAmount},#{item.actualAmount},#{item.currency},#{item.feeRegTime},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
            </trim>
        </foreach>
    </insert>
 
    <!-- 修改 -->
    <update id="updateReceivableFeeDetail" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail">
        update receivable_fee_detail
        <trim prefix="SET" suffixOverrides=",">
            <if test="receivableFeeId != null">receivable_fee_id = #{receivableFeeId},</if>
            <if test="feeType != null and feeType != ''">fee_type = #{feeType},</if>
            <if test="feeName != null and feeName != ''">fee_name = #{feeName},</if>
            <if test="billingUnit != null">billing_unit = #{billingUnit},</if>
            <if test="unitPrice != null">unit_price = #{unitPrice},</if>
            <if test="billingQuantity != null">billing_quantity = #{billingQuantity},</if>
            <if test="billingAmount != null">billing_amount = #{billingAmount},</if>
            <if test="actualAmount != null">actual_amount = #{actualAmount},</if>
            <if test="currency != null">currency = #{currency},</if>
            <if test="feeRegTime != null">fee_reg_time = #{feeRegTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="deleted != null">deleted = #{deleted},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateReceivableFeeDetailBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update receivable_fee_detail
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.receivableFeeId != null">receivable_fee_id = #{item.receivableFeeId},</if>
                <if test="item.feeType != null and item.feeType != ''">fee_type = #{item.feeType},</if>
                <if test="item.feeName != null and item.feeName != ''">fee_name = #{item.feeName},</if>
                <if test="item.billingUnit != null">billing_unit = #{item.billingUnit},</if>
                <if test="item.unitPrice != null">unit_price = #{item.unitPrice},</if>
                <if test="item.billingQuantity != null">billing_quantity = #{item.billingQuantity},</if>
                <if test="item.billingAmount != null">billing_amount = #{item.billingAmount},</if>
                <if test="item.actualAmount != null">actual_amount = #{item.actualAmount},</if>
                <if test="item.currency != null">currency = #{item.currency},</if>
                <if test="item.feeRegTime != null">fee_reg_time = #{item.feeRegTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.deleted != null">deleted = #{item.deleted},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
 
    <!--删除-->
    <delete id="deleteReceivableFeeDetailById" parameterType="Integer">
        delete from receivable_fee_detail where id = #{id}
    </delete>
    <!--根据应收费用ID删除明细-->
    <delete id="deleteReceivableFeeDetailByReceivableFeeId" parameterType="Integer">
        delete from receivable_fee_detail where receivable_fee_id = #{receivableFeeId}
    </delete>
    <delete id="deleteReceivableFeeDetailByIds" parameterType="Integer">
        delete from receivable_fee_detail where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <!--根据应收费用ID数组查询明细-->
    <select id="selectReceivableFeeDetailByReceivableFeeIds" parameterType="Integer" resultMap="ReceivableFeeDetailResult">
        <include refid="selectReceivableFeeDetailVo"/>
        where thisTab.receivable_fee_id in
        <foreach item="receivableFeeId" collection="array" open="(" separator="," close=")">
            #{receivableFeeId}
        </foreach>
    </select>
 
</mapper>