zhangback
2026-01-07 25d87543cdef089c36e82908599ee79efbf94fb6
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
<?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.tms.mapper.TmsArSettlementMapper">
 
    <resultMap type="com.ruoyi.tms.domain.TmsArSettlement" id="TmsArSettlementResult">
        <result property="id"    column="id"    />
        <result property="systemNo"    column="system_no"    />
        <result property="billId"    column="bill_id"    />
        <result property="settleAmount"    column="settle_amount"    />
        <result property="remark"    column="remark"    />
        <result property="attachment"    column="attachment"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
 
    <sql id="selectTmsArSettlementVo">
        select thisTab.id, thisTab.system_no, thisTab.bill_id, thisTab.settle_amount, thisTab.remark, thisTab.attachment, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time from tms_ar_settlement AS thisTab
    </sql>
    <sql id="selectTmsArSettlementVoCount">
        select count(0) from tms_ar_settlement as thisTab
    </sql>
 
    <sql id="whereCondition">
        <if test="systemNo != null  and systemNo != ''"> and thisTab.system_no = #{systemNo}</if>
        <if test="billId != null "> and thisTab.bill_id = #{billId}</if>
        <if test="settleAmount != null "> and thisTab.settle_amount = #{settleAmount}</if>
        <if test="attachment != null  and attachment != ''"> and thisTab.attachment = #{attachment}</if>
    </sql>
 
    <!--查询-->
    <select id="selectTmsArSettlementById" parameterType="Integer" resultMap="TmsArSettlementResult">
        <include refid="selectTmsArSettlementVo"/>
        where id = #{id}
    </select>
 
    <select id="selectTmsArSettlementCount" parameterType="com.ruoyi.tms.domain.TmsArSettlement" resultType="int">
        <include refid="selectTmsArSettlementVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
 
    <select id="selectTmsArSettlementList" parameterType="com.ruoyi.tms.domain.TmsArSettlement" resultMap="TmsArSettlementResult">
        <include refid="selectTmsArSettlementVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
 
    <!-- 新增 -->
    <insert id="insertTmsArSettlement" parameterType="com.ruoyi.tms.domain.TmsArSettlement"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_ar_settlement
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="systemNo != null and systemNo != ''">system_no,</if>
            <if test="billId != null">bill_id,</if>
            <if test="settleAmount != null">settle_amount,</if>
            <if test="remark != null">remark,</if>
            <if test="attachment != null">attachment,</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>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="systemNo != null and systemNo != ''">#{systemNo},</if>
            <if test="billId != null">#{billId},</if>
            <if test="settleAmount != null">#{settleAmount},</if>
            <if test="remark != null">#{remark},</if>
            <if test="attachment != null">#{attachment},</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>
         </trim>
    </insert>
 
    <insert id="insertTmsArSettlementBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_ar_settlement
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_no,bill_id,settle_amount,remark,attachment,create_by,create_time,update_by,update_time,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.systemNo},#{item.billId},#{item.settleAmount},#{item.remark},#{item.attachment},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},
            </trim>
        </foreach>
    </insert>
 
    <!-- 修改 -->
    <update id="updateTmsArSettlement" parameterType="com.ruoyi.tms.domain.TmsArSettlement">
        update tms_ar_settlement
        <trim prefix="SET" suffixOverrides=",">
            <if test="systemNo != null and systemNo != ''">system_no = #{systemNo},</if>
            <if test="billId != null">bill_id = #{billId},</if>
            <if test="settleAmount != null">settle_amount = #{settleAmount},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="attachment != null">attachment = #{attachment},</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>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateTmsArSettlementBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update tms_ar_settlement
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.systemNo != null and item.systemNo != ''">system_no = #{item.systemNo},</if>
                <if test="item.billId != null">bill_id = #{item.billId},</if>
                <if test="item.settleAmount != null">settle_amount = #{item.settleAmount},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.attachment != null">attachment = #{item.attachment},</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>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
 
    <!--删除-->
    <delete id="deleteTmsArSettlementById" parameterType="Integer">
        delete from tms_ar_settlement where id = #{id}
    </delete>
    <delete id="deleteTmsArSettlementByIds" parameterType="Integer">
        delete from tms_ar_settlement where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>