|
|
@@ -7,28 +7,43 @@
|
|
7
|
7
|
<resultMap type="CmcDevice" id="CmcDeviceResult">
|
|
8
|
8
|
<result property="deviceId" column="device_id" />
|
|
9
|
9
|
<result property="code" column="code" />
|
|
|
10
|
+ <result property="name" column="name" />
|
|
10
|
11
|
<result property="type" column="type" />
|
|
11
|
12
|
<result property="acquisitionTime" column="acquisition_time" />
|
|
12
|
13
|
<result property="cost" column="cost" />
|
|
13
|
14
|
<result property="expectLife" column="expect_life" />
|
|
14
|
15
|
<result property="series" column="series" />
|
|
15
|
|
- <result property="dayCost" column="dayCost" />
|
|
|
16
|
+ <result property="brand" column="brand" />
|
|
|
17
|
+ <result property="dayCost" column="day_cost" />
|
|
|
18
|
+ <result property="place" column="place" />
|
|
|
19
|
+ <result property="remark" column="remark" />
|
|
|
20
|
+ <result property="checkTerm" column="check_term" />
|
|
|
21
|
+ <result property="checkTime" column="check_time" />
|
|
|
22
|
+ <result property="warranty" column="warranty" />
|
|
|
23
|
+ <result property="manageDept" column="manage_dept" />
|
|
16
|
24
|
</resultMap>
|
|
17
|
25
|
|
|
18
|
26
|
<sql id="selectCmcDeviceVo">
|
|
19
|
|
- select device_id, code, type, acquisition_time, cost, expect_life, series, day_cost from cmc_device
|
|
|
27
|
+ select device_id, code, name, type, acquisition_time, cost, expect_life, series, brand, day_cost, place, remark, check_term, check_time, warranty, manage_dept from cmc_device
|
|
20
|
28
|
</sql>
|
|
21
|
29
|
|
|
22
|
30
|
<select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
|
|
23
|
31
|
<include refid="selectCmcDeviceVo"/>
|
|
24
|
32
|
<where>
|
|
25
|
|
- <if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
|
|
26
|
|
- <if test="type != null and type != ''"> and type like concat('%', #{type}, '%')</if>
|
|
|
33
|
+ <if test="code != null and code != ''"> and code = #{code}</if>
|
|
|
34
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
35
|
+ <if test="type != null and type != ''"> and type = #{type}</if>
|
|
27
|
36
|
<if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
|
|
28
|
37
|
<if test="cost != null "> and cost = #{cost}</if>
|
|
29
|
|
- <if test="dayCost != null "> and day_cost = #{dayCost}</if>
|
|
30
|
38
|
<if test="expectLife != null "> and expect_life = #{expectLife}</if>
|
|
31
|
|
- <if test="series != null and series != ''"> and series like concat('%', #{series}, '%')</if>
|
|
|
39
|
+ <if test="series != null and series != ''"> and series = #{series}</if>
|
|
|
40
|
+ <if test="brand != null and brand != ''"> and brand = #{brand}</if>
|
|
|
41
|
+ <if test="dayCost != null "> and day_cost = #{dayCost}</if>
|
|
|
42
|
+ <if test="place != null and place != ''"> and place = #{place}</if>
|
|
|
43
|
+ <if test="checkTerm != null "> and check_term = #{checkTerm}</if>
|
|
|
44
|
+ <if test="checkTime != null "> and check_time = #{checkTime}</if>
|
|
|
45
|
+ <if test="warranty != null "> and warranty = #{warranty}</if>
|
|
|
46
|
+ <if test="manageDept != null "> and manage_dept = #{manageDept}</if>
|
|
32
|
47
|
</where>
|
|
33
|
48
|
</select>
|
|
34
|
49
|
|
|
|
@@ -41,21 +56,37 @@
|
|
41
|
56
|
insert into cmc_device
|
|
42
|
57
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
43
|
58
|
<if test="code != null">code,</if>
|
|
|
59
|
+ <if test="name != null">name,</if>
|
|
44
|
60
|
<if test="type != null">type,</if>
|
|
45
|
61
|
<if test="acquisitionTime != null">acquisition_time,</if>
|
|
46
|
62
|
<if test="cost != null">cost,</if>
|
|
47
|
|
- <if test="dayCost != null">day_cost,</if>
|
|
48
|
63
|
<if test="expectLife != null">expect_life,</if>
|
|
49
|
64
|
<if test="series != null">series,</if>
|
|
|
65
|
+ <if test="brand != null">brand,</if>
|
|
|
66
|
+ <if test="dayCost != null">day_cost,</if>
|
|
|
67
|
+ <if test="place != null">place,</if>
|
|
|
68
|
+ <if test="remark != null">remark,</if>
|
|
|
69
|
+ <if test="checkTerm != null">check_term,</if>
|
|
|
70
|
+ <if test="checkTime != null">check_time,</if>
|
|
|
71
|
+ <if test="warranty != null">warranty,</if>
|
|
|
72
|
+ <if test="manageDept != null">manage_dept,</if>
|
|
50
|
73
|
</trim>
|
|
51
|
74
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
52
|
75
|
<if test="code != null">#{code},</if>
|
|
|
76
|
+ <if test="name != null">#{name},</if>
|
|
53
|
77
|
<if test="type != null">#{type},</if>
|
|
54
|
78
|
<if test="acquisitionTime != null">#{acquisitionTime},</if>
|
|
55
|
79
|
<if test="cost != null">#{cost},</if>
|
|
56
|
|
- <if test="dayCost != null">#{dayCost},</if>
|
|
57
|
80
|
<if test="expectLife != null">#{expectLife},</if>
|
|
58
|
81
|
<if test="series != null">#{series},</if>
|
|
|
82
|
+ <if test="brand != null">#{brand},</if>
|
|
|
83
|
+ <if test="dayCost != null">#{dayCost},</if>
|
|
|
84
|
+ <if test="place != null">#{place},</if>
|
|
|
85
|
+ <if test="remark != null">#{remark},</if>
|
|
|
86
|
+ <if test="checkTerm != null">#{checkTerm},</if>
|
|
|
87
|
+ <if test="checkTime != null">#{checkTime},</if>
|
|
|
88
|
+ <if test="warranty != null">#{warranty},</if>
|
|
|
89
|
+ <if test="manageDept != null">#{manageDept},</if>
|
|
59
|
90
|
</trim>
|
|
60
|
91
|
</insert>
|
|
61
|
92
|
|
|
|
@@ -63,17 +94,25 @@
|
|
63
|
94
|
update cmc_device
|
|
64
|
95
|
<trim prefix="SET" suffixOverrides=",">
|
|
65
|
96
|
<if test="code != null">code = #{code},</if>
|
|
|
97
|
+ <if test="name != null">name = #{name},</if>
|
|
66
|
98
|
<if test="type != null">type = #{type},</if>
|
|
67
|
99
|
<if test="acquisitionTime != null">acquisition_time = #{acquisitionTime},</if>
|
|
68
|
100
|
<if test="cost != null">cost = #{cost},</if>
|
|
69
|
|
- <if test="dayCost != null">day_cost = #{dayCost},</if>
|
|
70
|
101
|
<if test="expectLife != null">expect_life = #{expectLife},</if>
|
|
71
|
102
|
<if test="series != null">series = #{series},</if>
|
|
|
103
|
+ <if test="brand != null">brand = #{brand},</if>
|
|
|
104
|
+ <if test="dayCost != null">day_cost = #{dayCost},</if>
|
|
|
105
|
+ <if test="place != null">place = #{place},</if>
|
|
|
106
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
107
|
+ <if test="checkTerm != null">check_term = #{checkTerm},</if>
|
|
|
108
|
+ <if test="checkTime != null">check_time = #{checkTime},</if>
|
|
|
109
|
+ <if test="warranty != null">warranty = #{warranty},</if>
|
|
|
110
|
+ <if test="manageDept != null">manage_dept = #{manageDept},</if>
|
|
72
|
111
|
</trim>
|
|
73
|
112
|
where device_id = #{deviceId}
|
|
74
|
113
|
</update>
|
|
75
|
114
|
|
|
76
|
|
- <delete id="deleteCmcDeviceByDeviceId" parameterType="Long">
|
|
|
115
|
+ <delete id="deleteCmcDeviceByDeviceId" parameterType="Integer">
|
|
77
|
116
|
delete from cmc_device where device_id = #{deviceId}
|
|
78
|
117
|
</delete>
|
|
79
|
118
|
|