林火综合应急信息管理系统后端
guoshilong
2023-03-04 548f9cf603460e1d23124b92e625f32f36730a6e
添加设备管理、车辆管理、火灾管理、机构添加字段
2 files modified
32 files added
1788 ■■■■■ changed files
src/main/java/org/springblade/modules/device/controller/DeviceController.java 125 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/dto/DeviceDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/entity/DeviceEntity.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/mapper/DeviceMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/mapper/DeviceMapper.xml 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/service/IDeviceService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/service/impl/DeviceServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/vo/DeviceVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/controller/FireController.java 125 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/dto/FireDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/entity/FireEntity.java 93 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/mapper/FireMapper.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/mapper/FireMapper.xml 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/service/IFireService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/service/impl/FireServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fire/vo/FireVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/controller/FireSupplementController.java 125 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/dto/FireSupplementDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/entity/FireSupplementEntity.java 119 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/mapper/FireSupplementMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/mapper/FireSupplementMapper.xml 38 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/service/IFireSupplementService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/service/impl/FireSupplementServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/fireSupplement/vo/FireSupplementVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/entity/Dept.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/controller/VehicleController.java 125 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/dto/VehicleDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/entity/VehicleEntity.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/mapper/VehicleMapper.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/mapper/VehicleMapper.xml 31 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/service/IVehicleService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/service/impl/VehicleServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/vehicle/vo/VehicleVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/device/controller/DeviceController.java
New file
@@ -0,0 +1,125 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.device.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.device.entity.DeviceEntity;
import org.springblade.modules.device.vo.DeviceVO;
import org.springblade.modules.device.service.IDeviceService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 设备表 控制器
 *
 * @author BladeX
 * @since 2023-03-03
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-device/device")
@Api(value = "设备表", tags = "设备表接口")
public class DeviceController extends BladeController {
    private final IDeviceService deviceService;
    /**
     * 设备表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入device")
    public R<DeviceEntity> detail(DeviceEntity device) {
        DeviceEntity detail = deviceService.getOne(Condition.getQueryWrapper(device));
        return R.data(detail);
    }
    /**
     * 设备表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入device")
    public R<IPage<DeviceEntity>> list(DeviceEntity device, Query query) {
        IPage<DeviceEntity> pages = deviceService.page(Condition.getPage(query), Condition.getQueryWrapper(device));
        return R.data(pages);
    }
    /**
     * 设备表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入device")
    public R<IPage<DeviceVO>> page(DeviceVO device, Query query) {
        IPage<DeviceVO> pages = deviceService.selectDevicePage(Condition.getPage(query), device);
        return R.data(pages);
    }
    /**
     * 设备表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入device")
    public R save(@Valid @RequestBody DeviceEntity device) {
        return R.status(deviceService.save(device));
    }
    /**
     * 设备表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入device")
    public R update(@Valid @RequestBody DeviceEntity device) {
        return R.status(deviceService.updateById(device));
    }
    /**
     * 设备表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入device")
    public R submit(@Valid @RequestBody DeviceEntity device) {
        return R.status(deviceService.saveOrUpdate(device));
    }
    /**
     * 设备表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(deviceService.deleteLogic(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/device/dto/DeviceDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.device.dto;
import org.springblade.modules.device.entity.DeviceEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 设备表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DeviceDTO extends DeviceEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/device/entity/DeviceEntity.java
New file
@@ -0,0 +1,60 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.device.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
 * 设备表 实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@TableName("sys_device")
@ApiModel(value = "Device对象", description = "设备表")
@EqualsAndHashCode(callSuper = true)
public class DeviceEntity extends TenantEntity {
    /**
     * 设备名称
     */
    @ApiModelProperty(value = "设备名称")
    private String name;
    /**
     * 设备类型
     */
    @ApiModelProperty(value = "设备类型")
    private String type;
    /**
     * 是否支持北斗定位(1、支持;2不支持)
     */
    @ApiModelProperty(value = "是否支持北斗定位(1、支持;2不支持)")
    private String beidouPositioning;
    /**
     * 所在单位id
     */
    @ApiModelProperty(value = "所在单位id")
    private String deptId;
}
src/main/java/org/springblade/modules/device/mapper/DeviceMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.device.mapper;
import org.springblade.modules.device.entity.DeviceEntity;
import org.springblade.modules.device.vo.DeviceVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 设备表 Mapper 接口
 *
 * @author BladeX
 * @since 2023-03-03
 */
public interface DeviceMapper extends BaseMapper<DeviceEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param device
     * @return
     */
    List<DeviceVO> selectDevicePage(IPage page, DeviceVO device);
}
src/main/java/org/springblade/modules/device/mapper/DeviceMapper.xml
New file
@@ -0,0 +1,28 @@
<?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="org.springblade.modules.device.mapper.DeviceMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="deviceResultMap" type="org.springblade.modules.device.entity.DeviceEntity">
        <result column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="type" property="type"/>
        <result column="beidou_positioning" property="beidouPositioning"/>
        <result column="dept_id" property="deptId"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="selectDevicePage" resultMap="deviceResultMap">
        select * from sys_device where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/device/service/IDeviceService.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.device.service;
import org.springblade.modules.device.entity.DeviceEntity;
import org.springblade.modules.device.vo.DeviceVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 设备表 服务类
 *
 * @author BladeX
 * @since 2023-03-03
 */
public interface IDeviceService extends BaseService<DeviceEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param device
     * @return
     */
    IPage<DeviceVO> selectDevicePage(IPage<DeviceVO> page, DeviceVO device);
}
src/main/java/org/springblade/modules/device/service/impl/DeviceServiceImpl.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.device.service.impl;
import org.springblade.modules.device.entity.DeviceEntity;
import org.springblade.modules.device.vo.DeviceVO;
import org.springblade.modules.device.mapper.DeviceMapper;
import org.springblade.modules.device.service.IDeviceService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 设备表 服务实现类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Service
public class DeviceServiceImpl extends BaseServiceImpl<DeviceMapper, DeviceEntity> implements IDeviceService {
    @Override
    public IPage<DeviceVO> selectDevicePage(IPage<DeviceVO> page, DeviceVO device) {
        return page.setRecords(baseMapper.selectDevicePage(page, device));
    }
}
src/main/java/org/springblade/modules/device/vo/DeviceVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.device.vo;
import org.springblade.modules.device.entity.DeviceEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 设备表 视图实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DeviceVO extends DeviceEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/fire/controller/FireController.java
New file
@@ -0,0 +1,125 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fire.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.fire.entity.FireEntity;
import org.springblade.modules.fire.vo.FireVO;
import org.springblade.modules.fire.service.IFireService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 火灾记录表 控制器
 *
 * @author BladeX
 * @since 2023-03-03
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-fire/fire")
@Api(value = "火灾记录表", tags = "火灾记录表接口")
public class FireController extends BladeController {
    private final IFireService fireService;
    /**
     * 火灾记录表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入fire")
    public R<FireEntity> detail(FireEntity fire) {
        FireEntity detail = fireService.getOne(Condition.getQueryWrapper(fire));
        return R.data(detail);
    }
    /**
     * 火灾记录表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入fire")
    public R<IPage<FireEntity>> list(FireEntity fire, Query query) {
        IPage<FireEntity> pages = fireService.page(Condition.getPage(query), Condition.getQueryWrapper(fire));
        return R.data(pages);
    }
    /**
     * 火灾记录表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入fire")
    public R<IPage<FireVO>> page(FireVO fire, Query query) {
        IPage<FireVO> pages = fireService.selectFirePage(Condition.getPage(query), fire);
        return R.data(pages);
    }
    /**
     * 火灾记录表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入fire")
    public R save(@Valid @RequestBody FireEntity fire) {
        return R.status(fireService.save(fire));
    }
    /**
     * 火灾记录表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入fire")
    public R update(@Valid @RequestBody FireEntity fire) {
        return R.status(fireService.updateById(fire));
    }
    /**
     * 火灾记录表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入fire")
    public R submit(@Valid @RequestBody FireEntity fire) {
        return R.status(fireService.saveOrUpdate(fire));
    }
    /**
     * 火灾记录表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(fireService.deleteLogic(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/fire/dto/FireDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fire.dto;
import org.springblade.modules.fire.entity.FireEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 火灾记录表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FireDTO extends FireEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/fire/entity/FireEntity.java
New file
@@ -0,0 +1,93 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fire.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * 火灾记录表 实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@TableName(value = "sys_fire",autoResultMap = true)
@ApiModel(value = "Fire对象", description = "火灾记录表")
@EqualsAndHashCode(callSuper = true)
public class FireEntity extends TenantEntity {
    /**
     * 火灾编号
     */
    @ApiModelProperty(value = "火灾编号")
    private String no;
    /**
     * 火灾具体位置
     */
    @ApiModelProperty(value = "火灾具体位置")
    private String address;
    /**
     * 行政区域
     */
    @ApiModelProperty(value = "行政区域")
    @TableField(value = "location",typeHandler = FastjsonTypeHandler.class)
    private Object location;
    /**
     * 发现方式
     */
    @ApiModelProperty(value = "发现方式")
    private String findWay;
    /**
     * 火灾等级
     */
    @ApiModelProperty(value = "火灾等级")
    private String level;
    /**
     * 报警人
     */
    @ApiModelProperty(value = "报警人")
    private String caller;
    /**
     * 报警时间
     */
    @ApiModelProperty(value = "报警时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date alarmTime;
    /**
     * 火灾描述
     */
    @ApiModelProperty(value = "火灾描述")
    private String description;
    /**
     * 现场图片
     */
    @ApiModelProperty(value = "现场图片")
    @TableField(value = "images",typeHandler = FastjsonTypeHandler.class)
    private Object images;
}
src/main/java/org/springblade/modules/fire/mapper/FireMapper.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fire.mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.fire.entity.FireEntity;
import org.springblade.modules.fire.vo.FireVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 火灾记录表 Mapper 接口
 *
 * @author BladeX
 * @since 2023-03-03
 */
public interface FireMapper extends BaseMapper<FireEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param fire
     * @return
     */
    List<FireVO> selectFirePage(IPage page, @Param("fire") FireVO fire);
}
src/main/java/org/springblade/modules/fire/mapper/FireMapper.xml
New file
@@ -0,0 +1,35 @@
<?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="org.springblade.modules.fire.mapper.FireMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="fireResultMap" type="org.springblade.modules.fire.entity.FireEntity">
        <result column="id" property="id"/>
        <result column="no" property="no"/>
        <result column="location" property="location" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
        <result column="level" property="level"/>
        <result column="status" property="status"/>
        <result column="caller" property="caller"/>
        <result column="alarm_time" property="alarmTime"/>
        <result column="description" property="description"/>
        <result column="images" property="images" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="selectFirePage" resultMap="fireResultMap">
        select * from sys_fire where is_deleted = 0
        <if test="fire.location !=null and fire.location !='' ">
            AND location = #{fire.location,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler}
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/fire/service/IFireService.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fire.service;
import org.springblade.modules.fire.entity.FireEntity;
import org.springblade.modules.fire.vo.FireVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 火灾记录表 服务类
 *
 * @author BladeX
 * @since 2023-03-03
 */
public interface IFireService extends BaseService<FireEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param fire
     * @return
     */
    IPage<FireVO> selectFirePage(IPage<FireVO> page, FireVO fire);
}
src/main/java/org/springblade/modules/fire/service/impl/FireServiceImpl.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fire.service.impl;
import org.springblade.modules.fire.entity.FireEntity;
import org.springblade.modules.fire.vo.FireVO;
import org.springblade.modules.fire.mapper.FireMapper;
import org.springblade.modules.fire.service.IFireService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 火灾记录表 服务实现类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Service
public class FireServiceImpl extends BaseServiceImpl<FireMapper, FireEntity> implements IFireService {
    @Override
    public IPage<FireVO> selectFirePage(IPage<FireVO> page, FireVO fire) {
        return page.setRecords(baseMapper.selectFirePage(page, fire));
    }
}
src/main/java/org/springblade/modules/fire/vo/FireVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fire.vo;
import org.springblade.modules.fire.entity.FireEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 火灾记录表 视图实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FireVO extends FireEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/fireSupplement/controller/FireSupplementController.java
New file
@@ -0,0 +1,125 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fireSupplement.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.fireSupplement.entity.FireSupplementEntity;
import org.springblade.modules.fireSupplement.vo.FireSupplementVO;
import org.springblade.modules.fireSupplement.service.IFireSupplementService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 火灾补充表 控制器
 *
 * @author BladeX
 * @since 2023-03-04
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-fireSupplement/fireSupplement")
@Api(value = "火灾补充表", tags = "火灾补充表接口")
public class FireSupplementController extends BladeController {
    private final IFireSupplementService fireSupplementService;
    /**
     * 火灾补充表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入fireSupplement")
    public R<FireSupplementEntity> detail(FireSupplementEntity fireSupplement) {
        FireSupplementEntity detail = fireSupplementService.getOne(Condition.getQueryWrapper(fireSupplement));
        return R.data(detail);
    }
    /**
     * 火灾补充表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入fireSupplement")
    public R<IPage<FireSupplementEntity>> list(FireSupplementEntity fireSupplement, Query query) {
        IPage<FireSupplementEntity> pages = fireSupplementService.page(Condition.getPage(query), Condition.getQueryWrapper(fireSupplement));
        return R.data(pages);
    }
    /**
     * 火灾补充表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入fireSupplement")
    public R<IPage<FireSupplementVO>> page(FireSupplementVO fireSupplement, Query query) {
        IPage<FireSupplementVO> pages = fireSupplementService.selectFireSupplementPage(Condition.getPage(query), fireSupplement);
        return R.data(pages);
    }
    /**
     * 火灾补充表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入fireSupplement")
    public R save(@Valid @RequestBody FireSupplementEntity fireSupplement) {
        return R.status(fireSupplementService.save(fireSupplement));
    }
    /**
     * 火灾补充表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入fireSupplement")
    public R update(@Valid @RequestBody FireSupplementEntity fireSupplement) {
        return R.status(fireSupplementService.updateById(fireSupplement));
    }
    /**
     * 火灾补充表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入fireSupplement")
    public R submit(@Valid @RequestBody FireSupplementEntity fireSupplement) {
        return R.status(fireSupplementService.saveOrUpdate(fireSupplement));
    }
    /**
     * 火灾补充表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(fireSupplementService.deleteLogic(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/fireSupplement/dto/FireSupplementDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fireSupplement.dto;
import org.springblade.modules.fireSupplement.entity.FireSupplementEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 火灾补充表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2023-03-04
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FireSupplementDTO extends FireSupplementEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/fireSupplement/entity/FireSupplementEntity.java
New file
@@ -0,0 +1,119 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fireSupplement.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * 火灾补充表 实体类
 *
 * @author BladeX
 * @since 2023-03-04
 */
@Data
@TableName(value = "sys_fire_supplement",autoResultMap = true)
@ApiModel(value = "FireSupplement对象", description = "火灾补充表")
@EqualsAndHashCode(callSuper = true)
public class FireSupplementEntity extends TenantEntity {
    /**
     * 火灾表主键
     */
    @ApiModelProperty(value = "火灾表主键")
    private String fireId;
    /**
     * 火灾原因
     */
    @ApiModelProperty(value = "火灾原因")
    private String fireReason;
    /**
     * 起火树种
     */
    @ApiModelProperty(value = "起火树种")
    private String treeSpecies;
    /**
     * 灭火时间
     */
    @ApiModelProperty(value = "灭火时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date extinguishingTime;
    /**
     * 肇事者
     */
    @ApiModelProperty(value = "肇事者")
    private String perpetrator;
    /**
     * 处理人数
     */
    @ApiModelProperty(value = "处理人数")
    private Integer sumPerson;
    /**
     * 刑事处罚人数
     */
    @ApiModelProperty(value = "刑事处罚人数")
    private Integer punishPerson;
    /**
     * 处理情况
     */
    @ApiModelProperty(value = "处理情况")
    private String situation;
    /**
     * 轻伤人数
     */
    @ApiModelProperty(value = "轻伤人数")
    private Integer minorInjuryPerson;
    /**
     * 重伤人数
     */
    @ApiModelProperty(value = "重伤人数")
    private Integer seriousInjuryPerson;
    /**
     * 死亡人数
     */
    @ApiModelProperty(value = "死亡人数")
    private Integer deathPerson;
    /**
     * 经济损失
     */
    @ApiModelProperty(value = "经济损失")
    @TableField(value = "economic_loss",typeHandler = FastjsonTypeHandler.class)
    private Object economicLoss;
    /**
     * 受灾面积
     */
    @ApiModelProperty(value = "受灾面积")
    @TableField(value = "damage_area",typeHandler = FastjsonTypeHandler.class)
    private Object damageArea;
    /**
     * 出动警力
     */
    @ApiModelProperty(value = "出动警力")
    @TableField(value = "police_resources",typeHandler = FastjsonTypeHandler.class)
    private Object policeResources;
}
src/main/java/org/springblade/modules/fireSupplement/mapper/FireSupplementMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fireSupplement.mapper;
import org.springblade.modules.fireSupplement.entity.FireSupplementEntity;
import org.springblade.modules.fireSupplement.vo.FireSupplementVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 火灾补充表 Mapper 接口
 *
 * @author BladeX
 * @since 2023-03-04
 */
public interface FireSupplementMapper extends BaseMapper<FireSupplementEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param fireSupplement
     * @return
     */
    List<FireSupplementVO> selectFireSupplementPage(IPage page, FireSupplementVO fireSupplement);
}
src/main/java/org/springblade/modules/fireSupplement/mapper/FireSupplementMapper.xml
New file
@@ -0,0 +1,38 @@
<?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="org.springblade.modules.fireSupplement.mapper.FireSupplementMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="fireSupplementResultMap" type="org.springblade.modules.fireSupplement.entity.FireSupplementEntity">
        <result column="id" property="id"/>
        <result column="fire_id" property="fireId"/>
        <result column="fire_reason" property="fireReason"/>
        <result column="tree_species" property="treeSpecies"/>
        <result column="extinguishing_time" property="extinguishingTime"/>
        <result column="perpetrator" property="perpetrator"/>
        <result column="sum_person" property="sumPerson"/>
        <result column="punish_person" property="punishPerson"/>
        <result column="situation" property="situation"/>
        <result column="minor_injury_person" property="minorInjuryPerson"/>
        <result column="serious_injury_person" property="seriousInjuryPerson"/>
        <result column="death_person" property="deathPerson"/>
        <result column="economic_loss" property="economicLoss"/>
        <result column="damage_area" property="damageArea"/>
        <result column="police_resources" property="policeResources"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="selectFireSupplementPage" resultMap="fireSupplementResultMap">
        select * from sys_fire_supplement where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/fireSupplement/service/IFireSupplementService.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fireSupplement.service;
import org.springblade.modules.fireSupplement.entity.FireSupplementEntity;
import org.springblade.modules.fireSupplement.vo.FireSupplementVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 火灾补充表 服务类
 *
 * @author BladeX
 * @since 2023-03-04
 */
public interface IFireSupplementService extends BaseService<FireSupplementEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param fireSupplement
     * @return
     */
    IPage<FireSupplementVO> selectFireSupplementPage(IPage<FireSupplementVO> page, FireSupplementVO fireSupplement);
}
src/main/java/org/springblade/modules/fireSupplement/service/impl/FireSupplementServiceImpl.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fireSupplement.service.impl;
import org.springblade.modules.fireSupplement.entity.FireSupplementEntity;
import org.springblade.modules.fireSupplement.vo.FireSupplementVO;
import org.springblade.modules.fireSupplement.mapper.FireSupplementMapper;
import org.springblade.modules.fireSupplement.service.IFireSupplementService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 火灾补充表 服务实现类
 *
 * @author BladeX
 * @since 2023-03-04
 */
@Service
public class FireSupplementServiceImpl extends BaseServiceImpl<FireSupplementMapper, FireSupplementEntity> implements IFireSupplementService {
    @Override
    public IPage<FireSupplementVO> selectFireSupplementPage(IPage<FireSupplementVO> page, FireSupplementVO fireSupplement) {
        return page.setRecords(baseMapper.selectFireSupplementPage(page, fireSupplement));
    }
}
src/main/java/org/springblade/modules/fireSupplement/vo/FireSupplementVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.fireSupplement.vo;
import org.springblade.modules.fireSupplement.entity.FireSupplementEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 火灾补充表 视图实体类
 *
 * @author BladeX
 * @since 2023-03-04
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FireSupplementVO extends FireSupplementEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/system/entity/Dept.java
@@ -74,6 +74,42 @@
    private String deptName;
    /**
     * 省
     */
    @ApiModelProperty(value = "省")
    private String province;
    /**
     * 市
     */
    @ApiModelProperty(value = "市")
    private String city;
    /**
     * 县
     */
    @ApiModelProperty(value = "县")
    private String county;
    /**
     * 所在位置
     */
    @ApiModelProperty(value = "所在位置")
    private String location;
    /**
     * 经度
     */
    @ApiModelProperty(value = "经度")
    private String lon;
    /**
     * 纬度
     */
    @ApiModelProperty(value = "纬度")
    private String lat;
    /**
     * 祖级机构主键
     */
    @ApiModelProperty(value = "祖级机构主键")
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -36,10 +36,10 @@
            and tenant_id = #{user.tenantId}
        </if>
        <if test="user.account!=null and user.account != ''">
            and account = #{user.account}
            and account LIKE CONCAT('%', #{user.account},'%')
        </if>
        <if test="user.realName!=null and user.realName != ''">
            and real_name = #{user.realName}
            and real_name LIKE CONCAT('%', #{user.realName},'%')
        </if>
        <if test="user.userType!=null and user.userType != ''">
            and user_type = #{user.userType}
@@ -57,6 +57,9 @@
                </foreach>
            )
        </if>
        <if test="user.phone !=null and user.phone !='' ">
            AND phone LIKE CONCAT('%',#{user.phone},'%')
        </if>
        ORDER BY id
    </select>
src/main/java/org/springblade/modules/vehicle/controller/VehicleController.java
New file
@@ -0,0 +1,125 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.vehicle.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.vehicle.entity.VehicleEntity;
import org.springblade.modules.vehicle.vo.VehicleVO;
import org.springblade.modules.vehicle.service.IVehicleService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 车辆表 控制器
 *
 * @author BladeX
 * @since 2023-03-03
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-vehicle/vehicle")
@Api(value = "车辆表", tags = "车辆表接口")
public class VehicleController extends BladeController {
    private final IVehicleService vehicleService;
    /**
     * 车辆表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入vehicle")
    public R<VehicleEntity> detail(VehicleEntity vehicle) {
        VehicleEntity detail = vehicleService.getOne(Condition.getQueryWrapper(vehicle));
        return R.data(detail);
    }
    /**
     * 车辆表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入vehicle")
    public R<IPage<VehicleEntity>> list(VehicleEntity vehicle, Query query) {
        IPage<VehicleEntity> pages = vehicleService.page(Condition.getPage(query), Condition.getQueryWrapper(vehicle));
        return R.data(pages);
    }
    /**
     * 车辆表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入vehicle")
    public R<IPage<VehicleVO>> page(VehicleVO vehicle, Query query) {
        IPage<VehicleVO> pages = vehicleService.selectVehiclePage(Condition.getPage(query), vehicle);
        return R.data(pages);
    }
    /**
     * 车辆表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入vehicle")
    public R save(@Valid @RequestBody VehicleEntity vehicle) {
        return R.status(vehicleService.save(vehicle));
    }
    /**
     * 车辆表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入vehicle")
    public R update(@Valid @RequestBody VehicleEntity vehicle) {
        return R.status(vehicleService.updateById(vehicle));
    }
    /**
     * 车辆表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入vehicle")
    public R submit(@Valid @RequestBody VehicleEntity vehicle) {
        return R.status(vehicleService.saveOrUpdate(vehicle));
    }
    /**
     * 车辆表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(vehicleService.deleteLogic(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/vehicle/dto/VehicleDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.vehicle.dto;
import org.springblade.modules.vehicle.entity.VehicleEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 车辆表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class VehicleDTO extends VehicleEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/vehicle/entity/VehicleEntity.java
New file
@@ -0,0 +1,55 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.vehicle.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
 * 车辆表 实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@TableName("sys_vehicle")
@ApiModel(value = "Vehicle对象", description = "车辆表")
@EqualsAndHashCode(callSuper = true)
public class VehicleEntity extends TenantEntity {
    /**
     * 车牌号
     */
    @ApiModelProperty(value = "车牌号")
    private String licensePlate;
    /**
     * 单位id
     */
    @ApiModelProperty(value = "单位id")
    private String deptId;
    /**
     * 车辆类型
     */
    @ApiModelProperty(value = "车辆类型")
    private String type;
}
src/main/java/org/springblade/modules/vehicle/mapper/VehicleMapper.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.vehicle.mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.vehicle.entity.VehicleEntity;
import org.springblade.modules.vehicle.vo.VehicleVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 车辆表 Mapper 接口
 *
 * @author BladeX
 * @since 2023-03-03
 */
public interface VehicleMapper extends BaseMapper<VehicleEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param vehicle
     * @return
     */
    List<VehicleVO> selectVehiclePage(IPage page, @Param("vehicle") VehicleVO vehicle);
}
src/main/java/org/springblade/modules/vehicle/mapper/VehicleMapper.xml
New file
@@ -0,0 +1,31 @@
<?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="org.springblade.modules.vehicle.mapper.VehicleMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="vehicleResultMap" type="org.springblade.modules.vehicle.entity.VehicleEntity">
        <result column="id" property="id"/>
        <result column="license_plate" property="licensePlate"/>
        <result column="dept_id" property="deptId"/>
        <result column="type" property="type"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="selectVehiclePage" resultType="org.springblade.modules.vehicle.vo.VehicleVO">
        select * from sys_vehicle
        where is_deleted = 0
        <if test="vehicle.licensePlate !=null and vehicle.licensePlate !='' ">
            AND license_plate LIKE CONCAT('%',#{vehicle.licensePlate},'%')
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/vehicle/service/IVehicleService.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.vehicle.service;
import org.springblade.modules.vehicle.entity.VehicleEntity;
import org.springblade.modules.vehicle.vo.VehicleVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 车辆表 服务类
 *
 * @author BladeX
 * @since 2023-03-03
 */
public interface IVehicleService extends BaseService<VehicleEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param vehicle
     * @return
     */
    IPage<VehicleVO> selectVehiclePage(IPage<VehicleVO> page, VehicleVO vehicle);
}
src/main/java/org/springblade/modules/vehicle/service/impl/VehicleServiceImpl.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.vehicle.service.impl;
import org.springblade.modules.vehicle.entity.VehicleEntity;
import org.springblade.modules.vehicle.vo.VehicleVO;
import org.springblade.modules.vehicle.mapper.VehicleMapper;
import org.springblade.modules.vehicle.service.IVehicleService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 车辆表 服务实现类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Service
public class VehicleServiceImpl extends BaseServiceImpl<VehicleMapper, VehicleEntity> implements IVehicleService {
    @Override
    public IPage<VehicleVO> selectVehiclePage(IPage<VehicleVO> page, VehicleVO vehicle) {
        return page.setRecords(baseMapper.selectVehiclePage(page, vehicle));
    }
}
src/main/java/org/springblade/modules/vehicle/vo/VehicleVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.vehicle.vo;
import org.springblade.modules.vehicle.entity.VehicleEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 车辆表 视图实体类
 *
 * @author BladeX
 * @since 2023-03-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class VehicleVO extends VehicleEntity {
    private static final long serialVersionUID = 1L;
}