wlzboy
4 天以前 06a17c236d4cb9b8da75fce43af938cb7ea510bf
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
<?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.PaidMoneyAddMapper">
 
    <resultMap id="PaidMoneyAddResult" type="com.ruoyi.system.domain.PaidMoneyAdd">
        <result property="id" column="id" />
        <result property="toServiceOrdID" column="ToServiceOrdID" />
        <result property="toDispatchOrdID" column="ToDispatchOrdID" />
        <result property="addMoneyType" column="AddMoneyType" />
        <result property="addMoney" column="AddMoney" />
        <result property="addMoneyExplain" column="AddMoneyExplain" />
        <result property="addMoneyTime" column="AddMoneyTime" />
        <result property="addMoneyOAID" column="AddMoneyOAID" />
    </resultMap>
 
    <sql id="selectPaidMoneyAddVo">
        SELECT id, ToServiceOrdID, ToDispatchOrdID, AddMoneyType, AddMoney, 
               AddMoneyExplain, AddMoneyTime, AddMoneyOAID
        FROM PaidMoney_Add
    </sql>
 
    <select id="selectById" parameterType="Long" resultMap="PaidMoneyAddResult">
        <include refid="selectPaidMoneyAddVo"/>
        WHERE id = #{id}
    </select>
 
    <select id="selectByOrderIds" resultMap="PaidMoneyAddResult">
        <include refid="selectPaidMoneyAddVo"/>
        WHERE ToServiceOrdID = #{toServiceOrdID}
          AND ToDispatchOrdID = #{toDispatchOrdID}
        ORDER BY id DESC
    </select>
 
    <select id="selectRecentRecords" resultMap="PaidMoneyAddResult">
        <include refid="selectPaidMoneyAddVo"/>
        WHERE AddMoneyTime >= DATEADD(HOUR, -#{hours}, GETDATE())
        ORDER BY id DESC
    </select>
 
    <insert id="insert" parameterType="com.ruoyi.system.domain.PaidMoneyAdd" useGeneratedKeys="true" keyProperty="id">
        INSERT INTO PaidMoney_Add
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="toServiceOrdID != null">ToServiceOrdID,</if>
            <if test="toDispatchOrdID != null">ToDispatchOrdID,</if>
            <if test="addMoneyType != null">AddMoneyType,</if>
            <if test="addMoney != null">AddMoney,</if>
            <if test="addMoneyExplain != null and addMoneyExplain != ''">AddMoneyExplain,</if>
            <if test="addMoneyTime != null">AddMoneyTime,</if>
            <if test="addMoneyOAID != null">AddMoneyOAID,</if>
        </trim>
        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
            <if test="toServiceOrdID != null">#{toServiceOrdID},</if>
            <if test="toDispatchOrdID != null">#{toDispatchOrdID},</if>
            <if test="addMoneyType != null">#{addMoneyType},</if>
            <if test="addMoney != null">#{addMoney},</if>
            <if test="addMoneyExplain != null and addMoneyExplain != ''">#{addMoneyExplain},</if>
            <if test="addMoneyTime != null">#{addMoneyTime},</if>
            <if test="addMoneyOAID != null">#{addMoneyOAID},</if>
        </trim>
    </insert>
 
    <update id="update" parameterType="com.ruoyi.system.domain.PaidMoneyAdd">
        UPDATE PaidMoney_Add
        <trim prefix="SET" suffixOverrides=",">
            <if test="toServiceOrdID != null">ToServiceOrdID = #{toServiceOrdID},</if>
            <if test="toDispatchOrdID != null">ToDispatchOrdID = #{toDispatchOrdID},</if>
            <if test="addMoneyType != null">AddMoneyType = #{addMoneyType},</if>
            <if test="addMoney != null">AddMoney = #{addMoney},</if>
            <if test="addMoneyExplain != null">AddMoneyExplain = #{addMoneyExplain},</if>
            <if test="addMoneyTime != null">AddMoneyTime = #{addMoneyTime},</if>
            <if test="addMoneyOAID != null">AddMoneyOAID = #{addMoneyOAID},</if>
        </trim>
        WHERE id = #{id}
    </update>
 
    <delete id="deleteById" parameterType="Long">
        DELETE FROM PaidMoney_Add WHERE id = #{id}
    </delete>
 
</mapper>