Переглянути джерело

车辆信息增加保险、维修字段

lamphua 2 тижднів тому
джерело
коміт
c73a48e74e

+ 28
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCar.java Переглянути файл

@@ -47,6 +47,14 @@ public class CmcCar extends BaseEntity
47 47
     @Excel(name = "油耗")
48 48
     private BigDecimal fuel;
49 49
 
50
+    /** 保险 */
51
+    @Excel(name = "保险")
52
+    private BigDecimal insurance;
53
+
54
+    /** 维修 */
55
+    @Excel(name = "维修")
56
+    private BigDecimal maintenance;
57
+
50 58
     /** 总价 */
51 59
     @Excel(name = "总价(元)")
52 60
     private BigDecimal cost;
@@ -196,6 +204,24 @@ public class CmcCar extends BaseEntity
196 204
     {
197 205
         return fuel;
198 206
     }
207
+    public void setInsurance(BigDecimal insurance)
208
+    {
209
+        this.insurance = insurance;
210
+    }
211
+
212
+    public BigDecimal getInsurance()
213
+    {
214
+        return insurance;
215
+    }
216
+    public void setMaintenance(BigDecimal maintenance)
217
+    {
218
+        this.maintenance = maintenance;
219
+    }
220
+
221
+    public BigDecimal getMaintenance()
222
+    {
223
+        return maintenance;
224
+    }
199 225
     public void setStatus(String status)
200 226
     {
201 227
         this.status = status;
@@ -231,6 +257,8 @@ public class CmcCar extends BaseEntity
231 257
                 .append("dayCost", getDayCost())
232 258
                 .append("status", getStatus())
233 259
                 .append("fuel", getFuel())
260
+                .append("insurance", getInsurance())
261
+                .append("maintenance", getMaintenance())
234 262
                 .toString();
235 263
     }
236 264
 }

+ 3
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetCarMapper.xml Переглянути файл

@@ -26,6 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
26 26
         <result property="driver"    column="driver"    />
27 27
         <result property="dayCost"    column="day_cost"    />
28 28
         <result property="fuel"    column="fuel"    />
29
+        <result property="insurance"    column="insurance"    />
30
+        <result property="maintenance"    column="maintenance"    />
29 31
     </resultMap>
30 32
 
31 33
     <resultMap type="SysUser" id="SysUserResult">
@@ -34,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
34 36
     </resultMap>
35 37
 
36 38
     <sql id="selectCmcBudgetCarVo">
37
-        select bc.budget_car_id, bc.budget_id, bc.car_id, c.license_plate, c.driver, c.brand, u.nick_name, c.day_cost, c.fuel, bc.days, bc.depreciation, bc.distance, bc.mileage, bc.toll, bc.expense, bc.remark from cmc_budget_car as bc
39
+        select bc.budget_car_id, bc.budget_id, bc.car_id, c.license_plate, c.driver, c.brand, u.nick_name, c.day_cost, c.fuel, c.insurance, c.maintenance, bc.days, bc.depreciation, bc.distance, bc.mileage, bc.toll, bc.expense, bc.remark from cmc_budget_car as bc
38 40
         left join cmc_car as c on c.car_id = bc.car_id
39 41
         left join sys_user as u on c.driver = u.user_id
40 42
     </sql>

+ 9
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarMapper.xml Переглянути файл

@@ -19,6 +19,8 @@
19 19
         <result property="dayCost"    column="day_cost"    />
20 20
         <result property="remark"    column="remark"    />
21 21
         <result property="status"    column="status"    />
22
+        <result property="insurance"    column="insurance"    />
23
+        <result property="maintenance"    column="maintenance"    />
22 24
         <association property="driverUser"    javaType="SysUser"         resultMap="SysUserResult" />
23 25
     </resultMap>
24 26
 
@@ -28,7 +30,7 @@
28 30
     </resultMap>
29 31
 
30 32
     <sql id="selectCmcCarVo">
31
-        select c.car_id, c.license_plate, c.driver, u.nick_name, c.acquisition_time, c.cost, c.fuel, c.expect_life, c.expect_km, c.series, c.brand, c.is_rent, c.day_cost, c.remark, c.status from cmc_car as c
33
+        select c.car_id, c.license_plate, c.driver, u.nick_name, c.acquisition_time, c.cost, c.fuel, c.insurance, c.maintenance, c.expect_life, c.expect_km, c.series, c.brand, c.is_rent, c.day_cost, c.remark, c.status from cmc_car as c
32 34
         left join sys_user as u on u.user_id = c.driver
33 35
     </sql>
34 36
 
@@ -71,6 +73,8 @@
71 73
             <if test="remark != null">remark,</if>
72 74
             <if test="status != null">status,</if>
73 75
             <if test="fuel != null">fuel,</if>
76
+            <if test="insurance != null">insurance,</if>
77
+            <if test="maintenance != null">maintenance,</if>
74 78
         </trim>
75 79
         <trim prefix="values (" suffix=")" suffixOverrides=",">
76 80
             <if test="licensePlate != null">#{licensePlate},</if>
@@ -86,6 +90,8 @@
86 90
             <if test="remark != null">#{remark},</if>
87 91
             <if test="status != null">#{status},</if>
88 92
             <if test="fuel != null">#{fuel},</if>
93
+            <if test="insurance != null">#{insurance},</if>
94
+            <if test="maintenance != null">#{maintenance},</if>
89 95
         </trim>
90 96
     </insert>
91 97
 
@@ -105,6 +111,8 @@
105 111
             <if test="remark != null">remark = #{remark},</if>
106 112
             <if test="status != null">status = #{status},</if>
107 113
             <if test="fuel != null">fuel = #{fuel},</if>
114
+            <if test="insurance != null">insurance = #{insurance},</if>
115
+            <if test="maintenance != null">maintenance = #{maintenance},</if>
108 116
         </trim>
109 117
         where car_id = #{carId}
110 118
     </update>

+ 17
- 16
oa-back/sql/sq.sql Переглянути файл

@@ -1,17 +1,18 @@
1
-alter table cmc_car add column fuel decimal(10,2) default null comment '油耗';
2
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A5177U', `expect_life` = 15, `day_cost` = 113.00, `fuel` = 0.7 WHERE `car_id` = 1;
3
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A1081W', `expect_life` = 15, `day_cost` = 89.00, `fuel` = 1.0 WHERE `car_id` = 2;
4
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A2239Q', `expect_life` = 10, `day_cost` = 25.00, `fuel` = 0.7 WHERE `car_id` = 3;
5
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A1686T', `expect_life` = 10, `day_cost` = 31.00, `fuel` = 0.8 WHERE `car_id` = 4;
6
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A0T282', `expect_life` = 10, `day_cost` = 59.00, `fuel` = 0.7 WHERE `car_id` = 5;
7
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A9802U', `expect_life` = 10, `day_cost` = 39.00, `fuel` = 0.7 WHERE `car_id` = 6;
8
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A6106T', `expect_life` = 10, `day_cost` = 31.00, `fuel` = 0.7 WHERE `car_id` = 32;
9
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川AQ259W', `expect_life` = 10, `day_cost` = 24.00, `fuel` = 0.6 WHERE `car_id` = 8;
10
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A5U91Q', `expect_life` = 10, `day_cost` = 34.00, `fuel` = 0.7 WHERE `car_id` = 9;
11
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川AEX607', `expect_life` = 10, `day_cost` = 33.00, `fuel` = 1.0 WHERE `car_id` = 10;
12
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A99L3B', `expect_life` = 10, `day_cost` = 18.00, `fuel` = 0.7 WHERE `car_id` = 11;
13
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A6692U', `expect_life` = 10, `day_cost` = 16.00, `fuel` = 0.6 WHERE `car_id` = 12;
14
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川GAR907', `expect_life` = 10, `day_cost` = 15.00, `fuel` = 0.3 WHERE `car_id` = 13;
15
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A3760U', `expect_life` = 10, `day_cost` = 40.00, `fuel` = 1.0 WHERE `car_id` = 14;
16
-UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A1950R', `expect_life` = 10, `day_cost` = 61.00, `fuel` = 0.9 WHERE `car_id` = 15;
1
+alter table cmc_car add column insurance decimal(10,2) default null comment '保险';
2
+alter table cmc_car add column maintenance decimal(10,2) default null comment '维修';
3
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A5177U', `insurance` = 11, `maintenance` = 35.00 WHERE `car_id` = 1;
4
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A1081W', `insurance` = 13, `maintenance` = 60.00 WHERE `car_id` = 2;
5
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A2239Q', `insurance` = 8, `maintenance` = 46.00 WHERE `car_id` = 3;
6
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A1686T', `insurance` = 10, `maintenance` = 60.00 WHERE `car_id` = 4;
7
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A0T282', `insurance` = 8, `maintenance` = 60.00 WHERE `car_id` = 5;
8
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A9802U', `insurance` = 12, `maintenance` = 32.00 WHERE `car_id` = 6;
9
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A6106T', `insurance` = 11, `maintenance` = 10.00 WHERE `car_id` = 32;
10
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川AQ259W', `insurance` = 8, `maintenance` = 13.00 WHERE `car_id` = 8;
11
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A5U91Q', `insurance` = 8, `maintenance` = 46.00 WHERE `car_id` = 9;
12
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川AEX607', `insurance` = 7, `maintenance` = 8.00 WHERE `car_id` = 10;
13
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A99L3B', `insurance` = 6, `maintenance` = 14.00 WHERE `car_id` = 11;
14
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A6692U', `insurance` = 9, `maintenance` = 10.00 WHERE `car_id` = 12;
15
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川GAR907', `insurance` = 8, `maintenance` = 7.00 WHERE `car_id` = 13;
16
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A3760U', `insurance` = 10, `maintenance` = 10.00 WHERE `car_id` = 14;
17
+UPDATE `cmc_oa`.`cmc_car` SET `license_plate` = '川A1950R', `insurance` = 10, `maintenance` = 10.00 WHERE `car_id` = 15;
17 18
 

Завантаження…
Відмінити
Зберегти