Blame view

src/main/resources/mybatis/monitor/WorkOrderRecodingMapper.xml 4.13 KB
xumiao authored
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
<?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.huaheng.pc.monitor.workOrderRecoding.mapper.WorkOrderRecodingMapper">
    <insert id="insert">
        INSERT INTO work_order_recoding
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inventoryId != null">
                inventoryId,
            </if>
            <if test="materialCode != null">
                materialCode,
            </if>
            <if test="materialName != null">
                materialName,
            </if>
            <if test="specification != null">
                specification,
            </if>
            <if test="type != null">
                type,
            </if>
            <if test="qty != null">
                qty,
            </if>
            <if test="created != null">
                created,
            </if>
            <if test="moCode != null">
                moCode,
            </if>
            <if test="receiptId != null">
                receiptId,
            </if>
            <if test="receiptCode != null">
                receiptCode,
            </if>
            <if test="receiptDetailId != null">
                receiptDetailId,
            </if>
            <if test="createdBy != null">
                createdBy,
            </if>
        </trim>
        <trim prefix=" values (" suffix=")" suffixOverrides=",">
            <if test="inventoryId != null">
                #{inventoryId, jdbcType=INTEGER},
            </if>
            <if test="materialCode != null">
                #{materialCode, jdbcType=VARCHAR},
            </if>
            <if test="materialName != null">
                #{materialName, jdbcType=VARCHAR},
            </if>
            <if test="specification != null">
                #{specification, jdbcType=VARCHAR},
            </if>
            <if test="type != null">
                #{type, jdbcType=INTEGER},
            </if>
            <if test="qty != null">
                #{qty, jdbcType=DECIMAL},
            </if>
            <if test="created != null">
                #{created,jdbcType=TIMESTAMP},
            </if>
            <if test="moCode != null">
                #{moCode,jdbcType=VARCHAR},
            </if>
            <if test="receiptId != null">
                #{receiptId,  jdbcType=INTEGER},
            </if>
            <if test="receiptCode != null">
                #{receiptCode,  jdbcType=VARCHAR},
            </if>
            <if test="receiptDetailId != null">
                #{receiptDetailId,  jdbcType=VARCHAR},
            </if>
            <if test="createdBy != null">
                #{createdBy,  jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>

    <select id="selectListEntityByLike"
            resultType="com.huaheng.pc.monitor.workOrderRecoding.domain.WorkOrderRecoding">
        SELECT * FROM work_order_recoding
        <where>
            <if test="inventoryId != null and inventoryId != '' ">
                AND inventoryId =#{inventoryId}
            </if>
            <if test="materialCode != null and materialCode != '' ">
                AND materialCode like concat('%', #{materialCode}, '%')
            </if>
            <if test="materialName != null and materialName != '' ">
                AND materialName like concat('%', #{materialName}, '%')
            </if>
            <if test="specification != null and specification != '' ">
                AND specification like concat('%', #{specification}, '%')
            </if>
            <if test="type != null  and type != '' ">
                AND type = #{type}
            </if>
            <if test="created != null  and created != '' ">
                AND created &gt;= #{created}
            </if>
            <if test="moCode != null and moCode != '' ">
                AND moCode like concat('%', #{moCode}, '%')
            </if>
            <if test="receiptCode != null and receiptCode != '' ">
                AND receiptCode like concat('%', #{receiptCode}, '%')
            </if>
        </where>
        order by id desc
    </select>
</mapper>