wlzboy
2 天以前 8cb5d3440208a3be3e772e65f1bd0ec63031ba62
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
<?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.system.mapper.PaidMoneyMapper">
    
    <resultMap type="com.ruoyi.system.domain.PaidMoney" id="PaidMoneyResult">
        <result property="id" column="id" />
        <result property="paidMoneyClass" column="PaidMoneyClass" />
        <result property="serviceOrdIDDt" column="ServiceOrdIDDt" />
        <result property="dispatchOrdIDDt" column="DispatchOrdIDDt" />
        <result property="paidMoney" column="PaidMoney" />
        <result property="paidMoneyType" column="PaidMoneyType" />
        <result property="paidMoneyMono" column="PaidMoneyMono" />
        <result property="paidMoneyTime" column="PaidMoneyTime" />
        <result property="paidMoneyOaID" column="PaidMoneyOaID" />
        <result property="paidMoneyUnitID" column="PaidMoneyUnitID" />
        <result property="paidMoneyAPID" column="PaidMoney_AP_ID" />
        <result property="paidMoneyAPTime" column="PaidMoney_AP_Time" />
        <result property="paidMoneyAPCheck" column="PaidMoney_AP_Check" />
        <result property="paidMoneyTimestamp" column="PaidMoneyTimestamp" />
    </resultMap>
 
    <sql id="selectPaidMoneyVo">
        select id, PaidMoneyClass, ServiceOrdIDDt, DispatchOrdIDDt, PaidMoney, PaidMoneyType,
               PaidMoneyMono, PaidMoneyTime, PaidMoneyOaID, PaidMoneyUnitID, PaidMoney_AP_ID,
               PaidMoney_AP_Time, PaidMoney_AP_Check, PaidMoneyTimestamp
        from PaidMoney
    </sql>
 
    <select id="selectById" parameterType="Long" resultMap="PaidMoneyResult">
        <include refid="selectPaidMoneyVo"/>
        where id = #{id}
    </select>
 
    <select id="selectByOrderIds" resultMap="PaidMoneyResult">
        <include refid="selectPaidMoneyVo"/>
        where ServiceOrdIDDt = #{serviceOrdIDDt}
        <if test="dispatchOrdIDDt != null">
            and DispatchOrdIDDt = #{dispatchOrdIDDt}
        </if>
        order by PaidMoneyTime desc
    </select>
 
    <insert id="insert" parameterType="com.ruoyi.system.domain.PaidMoney" useGeneratedKeys="true" keyProperty="id">
        insert into PaidMoney
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="paidMoneyClass != null and paidMoneyClass != ''">PaidMoneyClass,</if>
            <if test="serviceOrdIDDt != null">ServiceOrdIDDt,</if>
            <if test="dispatchOrdIDDt != null">DispatchOrdIDDt,</if>
            <if test="paidMoney != null">PaidMoney,</if>
            <if test="paidMoneyType != null">PaidMoneyType,</if>
            <if test="paidMoneyMono != null and paidMoneyMono != ''">PaidMoneyMono,</if>
            <if test="paidMoneyTime != null">PaidMoneyTime,</if>
            <if test="paidMoneyOaID != null">PaidMoneyOaID,</if>
            <if test="paidMoneyUnitID != null">PaidMoneyUnitID,</if>
            <if test="paidMoneyAPID != null">PaidMoney_AP_ID,</if>
            <if test="paidMoneyAPTime != null">PaidMoney_AP_Time,</if>
            <if test="paidMoneyAPCheck != null">PaidMoney_AP_Check,</if>
            <if test="paidMoneyTimestamp != null and paidMoneyTimestamp != ''">PaidMoneyTimestamp,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="paidMoneyClass != null and paidMoneyClass != ''">#{paidMoneyClass},</if>
            <if test="serviceOrdIDDt != null">#{serviceOrdIDDt},</if>
            <if test="dispatchOrdIDDt != null">#{dispatchOrdIDDt},</if>
            <if test="paidMoney != null">#{paidMoney},</if>
            <if test="paidMoneyType != null">#{paidMoneyType},</if>
            <if test="paidMoneyMono != null and paidMoneyMono != ''">#{paidMoneyMono},</if>
            <if test="paidMoneyTime != null">#{paidMoneyTime},</if>
            <if test="paidMoneyOaID != null">#{paidMoneyOaID},</if>
            <if test="paidMoneyUnitID != null">#{paidMoneyUnitID},</if>
            <if test="paidMoneyAPID != null">#{paidMoneyAPID},</if>
            <if test="paidMoneyAPTime != null">#{paidMoneyAPTime},</if>
            <if test="paidMoneyAPCheck != null">#{paidMoneyAPCheck},</if>
            <if test="paidMoneyTimestamp != null and paidMoneyTimestamp != ''">#{paidMoneyTimestamp},</if>
        </trim>
    </insert>
 
    <update id="update" parameterType="com.ruoyi.system.domain.PaidMoney">
        update PaidMoney
        <trim prefix="SET" suffixOverrides=",">
            <if test="paidMoneyClass != null and paidMoneyClass != ''">PaidMoneyClass = #{paidMoneyClass},</if>
            <if test="serviceOrdIDDt != null">ServiceOrdIDDt = #{serviceOrdIDDt},</if>
            <if test="dispatchOrdIDDt != null">DispatchOrdIDDt = #{dispatchOrdIDDt},</if>
            <if test="paidMoney != null">PaidMoney = #{paidMoney},</if>
            <if test="paidMoneyType != null">PaidMoneyType = #{paidMoneyType},</if>
            <if test="paidMoneyMono != null and paidMoneyMono != ''">PaidMoneyMono = #{paidMoneyMono},</if>
            <if test="paidMoneyTime != null">PaidMoneyTime = #{paidMoneyTime},</if>
            <if test="paidMoneyOaID != null">PaidMoneyOaID = #{paidMoneyOaID},</if>
            <if test="paidMoneyUnitID != null">PaidMoneyUnitID = #{paidMoneyUnitID},</if>
            <if test="paidMoneyAPID != null">PaidMoney_AP_ID = #{paidMoneyAPID},</if>
            <if test="paidMoneyAPTime != null">PaidMoney_AP_Time = #{paidMoneyAPTime},</if>
            <if test="paidMoneyAPCheck != null">PaidMoney_AP_Check = #{paidMoneyAPCheck},</if>
            <if test="paidMoneyTimestamp != null and paidMoneyTimestamp != ''">PaidMoneyTimestamp = #{paidMoneyTimestamp},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteById" parameterType="Long">
        delete from PaidMoney where id = #{id}
    </delete>
 
    <select id="selectRecentRecords" resultMap="PaidMoneyResult">
        <include refid="selectPaidMoneyVo"/>
        where PaidMoneyTime >= DATEADD(DAY, -#{days}, GETDATE())
        order by PaidMoneyTime desc
    </select>
 
</mapper>