소스 검색

新增边坡需求

15928045575 2 년 전
부모
커밋
65d710e728

+ 40 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CompanyStatusEnum.java

@@ -0,0 +1,40 @@
+package com.sckw.core.model.enums;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-11-05 15:11:30
+ */
+
+public enum CompanyStatusEnum {
+
+    COMPANY_STATUS_ONE("01", "生产"),
+    COMPANY_STATUS_TWO("02", "建设"),
+    COMPANY_STATUS_THREE("03", "停产"),
+    COMPANY_STATUS_FOUR("04", "停建"),
+    ;
+    private final String code;
+    private final String name;
+
+    CompanyStatusEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getNames() {
+        return name;
+    }
+
+    public static String getName(String code) {
+        for (CompanyStatusEnum em : CompanyStatusEnum.values()) {
+            if (em.getCode().equals(code)) {
+                return em.getNames();
+            }
+        }
+        return null;
+    }
+}

+ 42 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CompanyTypeEnum.java

@@ -0,0 +1,42 @@
+package com.sckw.core.model.enums;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-11-05 15:11:30
+ */
+
+public enum CompanyTypeEnum {
+
+    COMPANY_TYPE_ONE("01", "露天煤矿"),
+    COMPANY_TYPE_TWO("02", "露天金属矿山"),
+    COMPANY_TYPE_THREE("03", "露天非金属矿山"),
+    COMPANY_TYPE_FOUR("04", "其他矿山"),
+    ;
+    private final String code;
+    private final String name;
+
+    CompanyTypeEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getNames() {
+        return name;
+    }
+
+
+
+    public static String getName(String code) {
+        for (CompanyTypeEnum em : CompanyTypeEnum.values()) {
+            if (em.getCode().equals(code)) {
+                return em.getNames();
+            }
+        }
+        return null;
+    }
+}

+ 4 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -152,6 +152,8 @@ public class HttpStatus {
     public static final String MODEL_NOT_EXISTS = "未查询到设备型号或已失效";
     public static final String DEVICE_NOT_EXISTS = "未查询到设备或已失效";
 
+    public static final String COMPANY_NOT_EXISTS = "未查询到矿山或已失效";
+
 
     /**自定义提示消息*/
     public static final String PASSWD_ERROR = "密码不正确";
@@ -204,4 +206,6 @@ public class HttpStatus {
 
     public static final String INTEGRATION_SAME_PART_EXISTS = "集成要素不能与基础要素名称相同!";
 
+    public static final String COMPANY_SN_EXISTS = "矿山名称已存在,不可重复!";
+
 }

+ 62 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/CompanyController.java

@@ -0,0 +1,62 @@
+package com.sckw.slope.detection.controller;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.sckw.core.annotation.Log;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.model.param.CompanyAdd;
+import com.sckw.slope.detection.model.param.CompanyQuery;
+import com.sckw.slope.detection.model.param.DeviceAdd;
+import com.sckw.slope.detection.service.CompanyService;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author sky
+ * @description 矿山Controller
+ * @date 2023-10-30 17:10:28
+ */
+@Slf4j
+@RestController
+@RequestMapping("/company")
+public class CompanyController {
+
+    @Autowired
+    CompanyService companyService;
+
+    @Log(description = "矿山查询-分页")
+    @RequestMapping(name = "矿山查询-分页", value = "/select", method = RequestMethod.POST)
+    public HttpResult select(@Valid @RequestBody CompanyQuery query, HttpServletRequest request) {
+        log.info("矿山查询-分页 select param:{}", JSONObject.toJSONString(query));
+        return HttpResult.ok(companyService.select(query, request));
+    }
+
+    @Log(description = "矿山新增")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "矿山新增", value = "/add", method = RequestMethod.POST)
+    public HttpResult add(@Valid @RequestBody CompanyAdd query, HttpServletRequest request) {
+        log.info("矿山新增 add param:{}", JSONObject.toJSONString(query));
+        return companyService.add(query, request);
+    }
+
+    @Log(description = "矿山详情")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "矿山详情", value = "/detail", method = RequestMethod.GET)
+    public HttpResult detail(@RequestParam("id") @NotNull(message = "数据id不能为空") long id, HttpServletRequest request) {
+        log.info("矿山详情 detail param:{}", id);
+        return companyService.detail(id, request);
+    }
+
+    @Log(description = "矿山编辑")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "矿山编辑", value = "/update", method = RequestMethod.POST)
+    public HttpResult update(@Valid @RequestBody CompanyAdd query, HttpServletRequest request) {
+        log.info("矿山编辑 update param:{}", JSONObject.toJSONString(query));
+        return companyService.update(query, request);
+    }
+
+
+}

+ 21 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsCompanyMapper.java

@@ -0,0 +1,21 @@
+package com.sckw.slope.detection.dao.mysql;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsCompany;
+import com.sckw.slope.detection.model.dos.mysql.KwsLog;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface KwsCompanyMapper  extends BaseMapper<KwsCompany> {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(KwsCompany record);
+
+    int insertSelective(KwsCompany record);
+
+    KwsCompany selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(KwsCompany record);
+
+    int updateByPrimaryKey(KwsCompany record);
+}

+ 128 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsCompany.java

@@ -0,0 +1,128 @@
+package com.sckw.slope.detection.model.dos.mysql;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+
+/**
+    * 矿山项目信息
+    */
+@Data
+@TableName("kws_company")
+public class KwsCompany implements Serializable {
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 公司
+     */
+    private String companyId;
+
+    /**
+    * 项目名
+    */
+    private String name;
+
+    /**
+    * 矿山类型
+    */
+    private String type;
+
+    /**
+    * 矿山所属省市区
+    */
+    private String code;
+
+    /**
+     * 矿山所属省市区all
+     */
+    private String codeAll;
+
+    /**
+     * 矿山所属具体省市区文字
+     */
+    private String codeArea;
+
+    /**
+    * 矿山详细地址
+    */
+    private String address;
+
+    /**
+    * 调度室座机号码
+    */
+    private String phone;
+
+    /**
+    * 矿山描边
+    */
+    private String fence;
+
+    /**
+    * 上级平台上报填表人
+    */
+    private String person;
+
+    /**
+    * 填表人联系电话
+    */
+    private String personMobile;
+
+    /**
+    * 省级平台名称
+    */
+    private String platformName;
+
+    /**
+    * 省级平台地址
+    */
+    private String platformAddress;
+
+    /**
+    * 状态
+    */
+    private String status;
+
+    /**
+    * 创建人
+    */
+    private Long createBy;
+
+    /**
+     * 创建人
+     */
+    @TableField(exist = false)
+    private Long createByName;
+
+    /**
+    * 创建时间
+    */
+    private LocalDateTime createTime;
+
+    /**
+    * 修改人
+    */
+    private Long updateBy;
+
+    /**
+    * 修改时间
+    */
+    private LocalDateTime updateTime;
+
+    /**
+    * 删除标识
+    */
+    private Byte delFlag;
+
+    private static final long serialVersionUID = 1L;
+
+
+}

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceModel.java

@@ -35,6 +35,11 @@ public class KwsDeviceModel implements Serializable {
      */
     private String name;
 
+    /**
+     * 量程
+     */
+    private String range;
+
     /**
      * 厂商
      */

+ 114 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/CompanyAdd.java

@@ -0,0 +1,114 @@
+package com.sckw.slope.detection.model.param;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+
+@Data
+/**
+    * 矿山项目信息
+    */
+public class CompanyAdd {
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+    * 项目名
+    */
+    @NotBlank(message = "矿山名不能为空")
+    @Size(max = 64,message = "矿山名最大长度要小于 64")
+    private String name;
+
+    /**
+    * 矿山类型
+    */
+    @NotBlank(message = "矿山类型不能为空")
+    @Size(max = 64,message = "矿山类型最大长度要小于 64")
+    private String type;
+
+    private String typeText;
+
+    /**
+    * 矿山所属省市区
+    */
+    @NotBlank(message = "矿山所属省市区不能为空")
+    @Size(max = 64,message = "矿山所属省市区最大长度要小于 64")
+    private String code;
+
+    @NotBlank(message = "矿山所属具体省市区代码不能为空")
+    @Size(max = 255,message = "矿山所属具体省市区代码最大长度要小于 255")
+    private String codeAll;
+
+    @NotBlank(message = "矿山所属具体省市区文字不能为空")
+    @Size(max = 255,message = "矿山所属具体省市区文字最大长度要小于 255")
+    private String codeArea;
+
+    /**
+    * 矿山详细地址
+    */
+    @NotBlank(message = "矿山详细地址不能为空")
+    @Size(max = 255,message = "矿山详细地址最大长度要小于 255")
+    private String address;
+
+    /**
+    * 调度室座机号码
+    */
+    @NotBlank(message = "度室座机号码不能为空")
+    @Size(max = 32,message = "调度室座机号码最大长度要小于 32")
+    private String phone;
+
+    /**
+    * 矿山描边
+    */
+    @NotBlank(message = "矿山描边不能为空")
+    @Size(max = 1024,message = "矿山描边最大长度要小于 1024")
+    private String fence;
+
+    /**
+    * 上级平台上报填表人
+    */
+    @NotBlank(message = "上级平台上报填表人不能为空")
+    @Size(max = 30,message = "上级平台上报填表人最大长度要小于 30")
+    private String person;
+
+    /**
+    * 填表人联系电话
+    */
+    @NotBlank(message = "填表人联系电话不能为空")
+    @Size(max = 32,message = "填表人联系电话最大长度要小于 32")
+    private String personMobile;
+
+    /**
+    * 省级平台名称
+    */
+    @NotBlank(message = "省级平台名称不能为空")
+    @Size(max = 128,message = "省级平台名称最大长度要小于 128")
+    private String platformName;
+
+    /**
+    * 省级平台地址
+    */
+    @NotBlank(message = "省级平台不能为空")
+    @Size(max = 128,message = "省级平台地址最大长度要小于 128")
+    private String platformAddress;
+
+    /**
+    * 状态
+    */
+    @NotBlank(message = "状态不能为空")
+    private String status;
+
+    private String statusText;
+
+
+
+    private static final long serialVersionUID = 1L;
+
+
+}

+ 28 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/CompanyQuery.java

@@ -0,0 +1,28 @@
+package com.sckw.slope.detection.model.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author sky
+ * @description 统计查询
+ * @date 2023-11-15 10:11:12
+ */
+@Data
+public class CompanyQuery implements Serializable {
+
+    /**
+     * 矿山ID
+     */
+    private String mountainId;
+
+    /**
+     * 矿山ID
+     */
+    private String companyId;
+
+    private int page;
+
+    private int pageSize;
+}

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/DeviceModelAdd.java

@@ -33,6 +33,11 @@ public class DeviceModelAdd {
      */
     private String name;
 
+    /**
+     * 量程
+     */
+    private String range;
+
     /**
      * 厂商
      */

+ 158 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CompanyService.java

@@ -0,0 +1,158 @@
+package com.sckw.slope.detection.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.CompanyTypeEnum;
+import com.sckw.core.model.enums.CompanyStatusEnum;
+import com.sckw.core.model.page.PageRes;
+
+import com.sckw.core.utils.IdWorker;
+import com.sckw.core.web.constant.HttpStatus;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.KwsCompanyMapper;
+import com.sckw.slope.detection.model.dos.mysql.*;
+import com.sckw.slope.detection.model.dto.HeaderData;
+import com.sckw.slope.detection.model.param.CompanyAdd;
+import com.sckw.slope.detection.model.param.CompanyQuery;
+import com.sckw.slope.detection.model.param.DeviceAdd;
+import com.sckw.slope.detection.model.vo.DeviceVo;
+import jakarta.servlet.http.HttpServletRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author sky
+ * @description 矿山公司service
+ * @date 2023-11-09 14:11:21
+ */
+@Slf4j
+@Service
+public class CompanyService {
+
+    @Autowired
+    KwsCompanyMapper companyMapper;
+
+    @Autowired
+    CommonService commonService;
+
+
+
+    public PageRes select(CompanyQuery query, HttpServletRequest request) {
+        PageHelper.startPage(query.getPage(), query.getPageSize());
+        List<KwsCompany> company = companyMapper.selectList(new LambdaQueryWrapper<KwsCompany>()
+                        .eq(KwsCompany::getDelFlag, NumberConstant.ZERO)
+                .orderByDesc(KwsCompany::getCreateTime)
+        );
+        PageInfo<KwsCompany> info = new PageInfo<>(company);
+        if (CollectionUtils.isEmpty(company)) {
+            return PageRes.build(info, company);
+        }
+        for(KwsCompany co : company){
+            co.setType(CompanyTypeEnum.getName(co.getType()));
+            co.setStatus(CompanyStatusEnum.getName(co.getStatus()));
+            co.setCreateByName(co.getCreateBy());
+        }
+
+        return PageRes.build(info, company);
+    }
+
+    /**
+     * 新增矿山
+     *
+     * @param add 请求参数
+     * @param request   http流
+     * @return 返回值
+     */
+    @Transactional
+    public HttpResult add(CompanyAdd add, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        KwsCompany companyHas = companyMapper.selectOne(new LambdaQueryWrapper<KwsCompany>()
+                .eq(KwsCompany::getName, add.getName())
+                .eq(KwsCompany::getDelFlag, NumberConstant.ZERO)
+                .eq(KwsCompany::getCompanyId, headerData.getCompanyId())
+        );
+        if (!Objects.isNull(companyHas)) {
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.COMPANY_SN_EXISTS);
+        }
+
+        KwsCompany company = new KwsCompany();
+        BeanUtils.copyProperties(add, company);
+        LocalDateTime now = LocalDateTime.now();
+        long id = new IdWorker(NumberConstant.ONE).nextId();
+        company.setId(id);
+        company.setCreateBy(Long.parseLong(headerData.getCreateBy()));
+        company.setCreateTime(now);
+        company.setCompanyId(headerData.getCompanyId());
+        company.setUpdateBy(Long.parseLong(headerData.getUpdateBy()));
+        company.setUpdateTime(now);
+        companyMapper.insert(company);
+        return HttpResult.ok();
+    }
+
+    /**
+     * 修改矿山
+     *
+     * @param add 请求参数
+     * @param request   http流
+     * @return 返回值
+     */
+    @Transactional
+    public HttpResult update(CompanyAdd add, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        KwsCompany companyHas = companyMapper.selectOne(new LambdaQueryWrapper<KwsCompany>()
+                .eq(KwsCompany::getId, add.getId()));
+        if (Objects.isNull(companyHas)) {
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.COMPANY_NOT_EXISTS);
+        }
+        KwsCompany companyHas1 = companyMapper.selectOne(new LambdaQueryWrapper<KwsCompany>()
+                .ne(KwsCompany::getId, add.getId())
+                .eq(KwsCompany::getName, add.getName())
+                .eq(KwsCompany::getDelFlag, NumberConstant.ZERO)
+                .eq(KwsCompany::getCompanyId, headerData.getCompanyId())
+        );
+        if (!Objects.isNull(companyHas1)) {
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.COMPANY_SN_EXISTS);
+        }
+
+        KwsCompany company = new KwsCompany();
+        BeanUtils.copyProperties(add, company);
+        company.setId(add.getId());
+        LocalDateTime now = LocalDateTime.now();
+
+        company.setUpdateBy(Long.parseLong(headerData.getUpdateBy()));
+        company.setUpdateTime(now);
+        Integer updateStatus = companyMapper.updateById(company);
+        return HttpResult.ok();
+    }
+
+    /**
+     * 矿山详情
+     *
+     * @param id 请求参数
+     * @param response   http流
+     * @return 返回值
+     */
+
+    public HttpResult detail(Long id, HttpServletRequest response) {
+        KwsCompany companyHas = companyMapper.selectOne(new LambdaQueryWrapper<KwsCompany>()
+                .eq(KwsCompany::getId, id));
+        CompanyAdd vo = new CompanyAdd();
+        BeanUtils.copyProperties(companyHas, vo);
+        vo.setTypeText(CompanyTypeEnum.getName(vo.getType()));
+        vo.setStatusText(CompanyStatusEnum.getName(vo.getStatus()));
+        return HttpResult.ok(vo);
+    }
+}

+ 243 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsCompanyMapper.xml

@@ -0,0 +1,243 @@
+<?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.sckw.slope.detection.dao.mysql.KwsCompanyMapper">
+  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsCompany">
+    <!--@mbg.generated-->
+    <!--@Table kws_company-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="type" jdbcType="VARCHAR" property="type" />
+    <result column="code" jdbcType="VARCHAR" property="code" />
+    <result column="address" jdbcType="VARCHAR" property="address" />
+    <result column="phone" jdbcType="VARCHAR" property="phone" />
+    <result column="fence" jdbcType="VARCHAR" property="fence" />
+    <result column="person" jdbcType="VARCHAR" property="person" />
+    <result column="person_mobile" jdbcType="VARCHAR" property="personMobile" />
+    <result column="platform_name" jdbcType="VARCHAR" property="platformName" />
+    <result column="platform_address" jdbcType="VARCHAR" property="platformAddress" />
+    <result column="status" jdbcType="TINYINT" property="status" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, `name`, `type`, code, address, phone, fence, person, person_mobile, platform_name, 
+    platform_address, `status`, create_by, create_time, update_by, update_time, del_flag
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select 
+    <include refid="Base_Column_List" />
+    from kws_company
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    <!--@mbg.generated-->
+    delete from kws_company
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsCompany">
+    <!--@mbg.generated-->
+    insert into kws_company (id, `name`, `type`,
+      code,code_all, address, phone,
+      fence, person, person_mobile, 
+      platform_name, platform_address, `status`, 
+      create_by, create_time, update_by,
+      update_time,company_id,code_area)
+    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
+      #{code,jdbcType=VARCHAR}, #{codeAll,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
+      #{fence,jdbcType=VARCHAR}, #{person,jdbcType=VARCHAR}, #{personMobile,jdbcType=VARCHAR}, 
+      #{platformName,jdbcType=VARCHAR}, #{platformAddress,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
+      #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, 
+      #{updateTime,jdbcType=TIMESTAMP},#{companyId,jdbcType=BIGINT},#{codeArea,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsCompany">
+    <!--@mbg.generated-->
+    insert into kws_company
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="code != null">
+        code,
+      </if>
+      <if test="address != null">
+        address,
+      </if>
+      <if test="phone != null">
+        phone,
+      </if>
+      <if test="fence != null">
+        fence,
+      </if>
+      <if test="person != null">
+        person,
+      </if>
+      <if test="personMobile != null">
+        person_mobile,
+      </if>
+      <if test="platformName != null">
+        platform_name,
+      </if>
+      <if test="platformAddress != null">
+        platform_address,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="delFlag != null">
+        del_flag,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="code != null">
+        #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="address != null">
+        #{address,jdbcType=VARCHAR},
+      </if>
+      <if test="phone != null">
+        #{phone,jdbcType=VARCHAR},
+      </if>
+      <if test="fence != null">
+        #{fence,jdbcType=VARCHAR},
+      </if>
+      <if test="person != null">
+        #{person,jdbcType=VARCHAR},
+      </if>
+      <if test="personMobile != null">
+        #{personMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="platformName != null">
+        #{platformName,jdbcType=VARCHAR},
+      </if>
+      <if test="platformAddress != null">
+        #{platformAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=TINYINT},
+      </if>
+      <if test="createBy != null">
+        #{createBy,jdbcType=BIGINT},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy,jdbcType=BIGINT},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="delFlag != null">
+        #{delFlag,jdbcType=TINYINT},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsCompany">
+    <!--@mbg.generated-->
+    update kws_company
+    <set>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="code != null">
+        code = #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="address != null">
+        address = #{address,jdbcType=VARCHAR},
+      </if>
+      <if test="phone != null">
+        phone = #{phone,jdbcType=VARCHAR},
+      </if>
+      <if test="fence != null">
+        fence = #{fence,jdbcType=VARCHAR},
+      </if>
+      <if test="person != null">
+        person = #{person,jdbcType=VARCHAR},
+      </if>
+      <if test="personMobile != null">
+        person_mobile = #{personMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="platformName != null">
+        platform_name = #{platformName,jdbcType=VARCHAR},
+      </if>
+      <if test="platformAddress != null">
+        platform_address = #{platformAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=TINYINT},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy,jdbcType=BIGINT},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy,jdbcType=BIGINT},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="delFlag != null">
+        del_flag = #{delFlag,jdbcType=TINYINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsCompany">
+    <!--@mbg.generated-->
+    update kws_company
+    set `name` = #{name,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=VARCHAR},
+      code = #{code,jdbcType=VARCHAR},
+      address = #{address,jdbcType=VARCHAR},
+      phone = #{phone,jdbcType=VARCHAR},
+      fence = #{fence,jdbcType=VARCHAR},
+      person = #{person,jdbcType=VARCHAR},
+      person_mobile = #{personMobile,jdbcType=VARCHAR},
+      platform_name = #{platformName,jdbcType=VARCHAR},
+      platform_address = #{platformAddress,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=TINYINT},
+      create_by = #{createBy,jdbcType=BIGINT},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_by = #{updateBy,jdbcType=BIGINT},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      del_flag = #{delFlag,jdbcType=TINYINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 2 - 2
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceModelMapper.xml

@@ -73,12 +73,12 @@
                                       `name`, manufacturer, manufacturer_contacts,
                                       manufacturer_phone, remark, `status`,
                                       create_by, create_time, update_by,
-                                      update_time, del_flag, mountain_id)
+                                      update_time, del_flag, mountain_id,range)
         values (#{id,jdbcType=BIGINT}, #{identifyCode,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR},
                 #{name,jdbcType=VARCHAR}, #{manufacturer,jdbcType=VARCHAR}, #{manufacturerContacts,jdbcType=VARCHAR},
                 #{manufacturerPhone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
                 #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
-                #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{mountainId,jdbcType=VARCHAR})
+                #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{mountainId,jdbcType=VARCHAR}, #{range,jdbcType=VARCHAR})
     </insert>
     <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel">
         <!--@mbg.generated-->