Commit ba94a0ad authored by WangXinYu's avatar WangXinYu

养护计划 更新

parent 7e6cfd76
...@@ -37,6 +37,18 @@ public class MaintenanceController { ...@@ -37,6 +37,18 @@ public class MaintenanceController {
} }
return null; return null;
} }
@ApiOperation(value = "更新维护记录", notes = "更新维护记录")
@PostMapping(value = "/update")
public Result update(@Valid BusDevService busDevService, BindingResult bindingResult) {
int i = maintenanceService.updateBusDevService(busDevService);
if (i > 0) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
busDevService);
}
return null;
}
@ApiOperation(value = "删除维护记录", notes = "删除维护记录") @ApiOperation(value = "删除维护记录", notes = "删除维护记录")
@ApiImplicitParams({ @ApiImplicitParams({
......
...@@ -57,7 +57,7 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> { ...@@ -57,7 +57,7 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> {
* @param year the year * @param year the year
* @return the list * @return the list
*/ */
@Select("SELECT ds.*,d.DEV_NM,tp.DEV_TP_NM FROM bus_dev_service ds INNER JOIN bus_device d on d.DEV_ID = ds.DEV_ID INNER JOIN bus_device_tp tp ON tp.DEV_TP_ID=d.DEV_TP_ID WHERE DATE_FORMAT(SER_TM,'%Y') = #{year}") @Select("SELECT ds.*,d.DEV_NM,tp.DEV_TP_NM,tp.DEV_TP_ID FROM bus_dev_service ds INNER JOIN bus_device d on d.DEV_ID = ds.DEV_ID INNER JOIN bus_device_tp tp ON tp.DEV_TP_ID=d.DEV_TP_ID WHERE DATE_FORMAT(SER_TM,'%Y') = #{year}")
List<Map<String,Object>> listBusDevServiceByYear(@Param("year") String year); List<Map<String,Object>> listBusDevServiceByYear(@Param("year") String year);
/** /**
......
...@@ -23,6 +23,13 @@ public interface MaintenanceService { ...@@ -23,6 +23,13 @@ public interface MaintenanceService {
*/ */
int saveBusDevService(BusDevService busDevService); int saveBusDevService(BusDevService busDevService);
/**
* Update bus dev service int.
* 更新 维修记录
* @param busDevService the bus dev service
* @return the int
*/
int updateBusDevService(BusDevService busDevService);
/** /**
* Delete bus dev service by id int. * Delete bus dev service by id int.
...@@ -73,6 +80,7 @@ public interface MaintenanceService { ...@@ -73,6 +80,7 @@ public interface MaintenanceService {
/** /**
* List dev date list. * List dev date list.
* 使用年份查询存在维护记录的 日期 * 使用年份查询存在维护记录的 日期
*
* @param year the year * @param year the year
* @return the list * @return the list
*/ */
......
...@@ -41,6 +41,21 @@ public class MaintenanceServiceImpl implements MaintenanceService { ...@@ -41,6 +41,21 @@ public class MaintenanceServiceImpl implements MaintenanceService {
} }
return i; return i;
} }
/**
* 根据id修改维修记录
* @param busDevService
* @return
*/
@Override
public int updateBusDevService(BusDevService busDevService) {
int i= 0;
try {
i = maintenanceRepository.updateByPrimaryKeySelective(busDevService);
} catch (Exception e) {
e.printStackTrace();
}
return i;
}
/** /**
* 删除设备维修记录 * 删除设备维修记录
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment