Fancy
2024-07-04 ddd56a8f37eb47d933a7064be9341feb8dbd8165
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
<?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.dy.pmsGlobal.daoSta.StaDeviceLifeMapper">
 
    <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/>
            <result property="workId" column="work_id" jdbcType="BIGINT"/>
            <result property="repairId" column="repair_id" jdbcType="BIGINT"/>
            <result property="planId" column="plan_id" jdbcType="BIGINT"/>
            <result property="stationId" column="station_id" jdbcType="BIGINT"/>
            <result property="currNode" column="curr_node" jdbcType="BIGINT"/>
            <result property="nodeContent" column="node_content" jdbcType="VARCHAR"/>
            <result property="equipCycleContent" column="equip_cycle_content" jdbcType="VARCHAR"/>
            <result property="status" column="status" jdbcType="TINYINT"/>
            <result property="result" column="result" jdbcType="TINYINT"/>
            <result property="errorMsg" column="error_msg" jdbcType="VARCHAR"/>
            <result property="assistants" column="assistants" jdbcType="VARCHAR"/>
            <result property="inTime" column="in_time" jdbcType="TIMESTAMP"/>
            <result property="outTime" column="out_time" jdbcType="TIMESTAMP"/>
            <result property="updatedBy" column="updated_by" jdbcType="BIGINT"/>
            <result property="memo" column="memo" jdbcType="VARCHAR"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id,equip_no,work_id,
        repair_id,plan_id,station_id,
        curr_node,node_content,equip_cycle_content,
        status,result,
        error_msg,assistants,in_time,
        out_time,updated_by,memo
    </sql>
 
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from sta_device_life
        where  id = #{id,jdbcType=BIGINT} 
    </select>
 
    <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from sta_device_life
        where  equip_no = #{equipNo,jdbcType=VARCHAR}
        order by id desc
    </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from sta_device_life
        where  id = #{id,jdbcType=BIGINT} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLife" useGeneratedKeys="true">
        insert into sta_device_life
        ( id,equip_no,work_id
        ,repair_id,plan_id,station_id
        ,curr_node,node_content,equip_cycle_content
        ,status,result
        ,error_msg,assistants,in_time
        ,out_time,updated_by,memo
        )
        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT}
        ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT}
        ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{equipCycleContent,jdbcType=VARCHAR}
        ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT}
        ,#{errorMsg,jdbcType=VARCHAR},#{assistants,jdbcType=VARCHAR},#{inTime,jdbcType=TIMESTAMP}
        ,#{outTime,jdbcType=TIMESTAMP},#{updatedBy,jdbcType=BIGINT},#{memo,jdbcType=VARCHAR}
        )
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLife" useGeneratedKeys="true">
        insert into sta_device_life
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="equipNo != null">equip_no,</if>
                <if test="workId != null">work_id,</if>
                <if test="repairId != null">repair_id,</if>
                <if test="planId != null">plan_id,</if>
                <if test="stationId != null">station_id,</if>
                <if test="currNode != null">curr_node,</if>
                <if test="nodeContent != null">node_content,</if>
                <if test="equipCycleContent != null">equip_cycle_content,</if>
                <if test="status != null">status,</if>
                <if test="result != null">result,</if>
                <if test="errorMsg != null">error_msg,</if>
                <if test="assistants != null">assistants,</if>
                <if test="inTime != null">in_time,</if>
                <if test="outTime != null">out_time,</if>
                <if test="updatedBy != null">updated_by,</if>
                <if test="memo != null">memo,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=BIGINT},</if>
                <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if>
                <if test="workId != null">#{workId,jdbcType=BIGINT},</if>
                <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if>
                <if test="planId != null">#{planId,jdbcType=BIGINT},</if>
                <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if>
                <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if>
                <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if>
                <if test="equipCycleContent != null">#{equipCycleContent,jdbcType=VARCHAR},</if>
                <if test="status != null">#{status,jdbcType=TINYINT},</if>
                <if test="result != null">#{result,jdbcType=TINYINT},</if>
                <if test="errorMsg != null">#{errorMsg,jdbcType=VARCHAR},</if>
                <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if>
                <if test="inTime != null">#{inTime,jdbcType=TIMESTAMP},</if>
                <if test="outTime != null">#{outTime,jdbcType=TIMESTAMP},</if>
                <if test="updatedBy != null">#{updatedBy,jdbcType=BIGINT},</if>
                <if test="memo != null">#{memo,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLife">
        update sta_device_life
        <set>
                <if test="equipNo != null">
                    equip_no = #{equipNo,jdbcType=VARCHAR},
                </if>
                <if test="workId != null">
                    work_id = #{workId,jdbcType=BIGINT},
                </if>
                <if test="repairId != null">
                    repair_id = #{repairId,jdbcType=BIGINT},
                </if>
                <if test="planId != null">
                    plan_id = #{planId,jdbcType=BIGINT},
                </if>
                <if test="stationId != null">
                    station_id = #{stationId,jdbcType=BIGINT},
                </if>
                <if test="currNode != null">
                    curr_node = #{currNode,jdbcType=BIGINT},
                </if>
                <if test="nodeContent != null">
                    node_content = #{nodeContent,jdbcType=VARCHAR},
                </if>
                <if test="equipCycleContent != null">
                    equip_cycle_content = #{equipCycleContent,jdbcType=VARCHAR},
                </if>
                <if test="status != null">
                    status = #{status,jdbcType=TINYINT},
                </if>
                <if test="result != null">
                    result = #{result,jdbcType=TINYINT},
                </if>
                <if test="errorMsg != null">
                    error_msg = #{errorMsg,jdbcType=VARCHAR},
                </if>
                <if test="assistants != null">
                    assistants = #{assistants,jdbcType=VARCHAR},
                </if>
                <if test="inTime != null">
                    in_time = #{inTime,jdbcType=TIMESTAMP},
                </if>
                <if test="outTime != null">
                    out_time = #{outTime,jdbcType=TIMESTAMP},
                </if>
                <if test="updatedBy != null">
                    updated_by = #{updatedBy,jdbcType=BIGINT},
                </if>
                <if test="memo != null">
                    memo = #{memo,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=BIGINT} 
    </update>
    <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLife">
        update sta_device_life
        set 
            equip_no =  #{equipNo,jdbcType=VARCHAR},
            work_id =  #{workId,jdbcType=BIGINT},
            repair_id =  #{repairId,jdbcType=BIGINT},
            plan_id =  #{planId,jdbcType=BIGINT},
            station_id =  #{stationId,jdbcType=BIGINT},
            curr_node =  #{currNode,jdbcType=BIGINT},
            node_content =  #{nodeContent,jdbcType=VARCHAR},
            equip_cycle_content =  #{equipCycleContent,jdbcType=VARCHAR},
            status =  #{status,jdbcType=TINYINT},
            result =  #{result,jdbcType=TINYINT},
            error_msg =  #{errorMsg,jdbcType=VARCHAR},
            assistants =  #{assistants,jdbcType=VARCHAR},
            in_time =  #{inTime,jdbcType=TIMESTAMP},
            out_time =  #{outTime,jdbcType=TIMESTAMP},
            updated_by =  #{updatedBy,jdbcType=BIGINT},
            memo =  #{memo,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=BIGINT} 
    </update>
</mapper>