瀏覽代碼

-修改表字段

jiangbiao 2 年之前
父節點
當前提交
568dbad246

+ 1 - 1
master/src/main/java/com/ruoyi/project/base/controller/TBaseDeviceController.java

@@ -166,7 +166,7 @@ public class TBaseDeviceController extends BaseController
                         //  区域名称
                         TBaseRegion tBaseRegion = tBaseRegionService.selectTBaseRegionByName(cellValue, plantId);
                         if (tBaseRegion == null) {return AjaxResult.success("未找到对应区域!请检查装置名称与区域名称无误后重新提交!",0);}
-                        entity.setRegionId(tBaseRegion.getId());
+                        entity.setRegionId(tBaseRegion.getRegionId());
                     } else if (j == 2) {
                         // 设备描述
                         entity.setDevDescribe(cellValue);

+ 6 - 6
master/src/main/java/com/ruoyi/project/base/domain/TBasePoint.java

@@ -21,7 +21,7 @@ public class TBasePoint extends BaseEntity {
     /**
      * 唯一标识id
      */
-    private Long id;
+    private Long pointId;
 
     /**
      * 检测净值
@@ -340,12 +340,12 @@ public class TBasePoint extends BaseEntity {
         this.updater = updater;
     }
 
-    public void setId(Long id) {
-        this.id = id;
+    public void setPointId(Long pointId) {
+        this.pointId = pointId;
     }
 
-    public Long getId() {
-        return id;
+    public Long getPointId() {
+        return pointId;
     }
 
     public void setNetTestValue(Integer netTestValue) {
@@ -647,7 +647,7 @@ public class TBasePoint extends BaseEntity {
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("id", getId())
+                .append("id", getPointId())
                 .append("netTestValue", getNetTestValue())
                 .append("leakageDegree", getLeakageDegree())
                 .append("plantId", getPlantId())

+ 6 - 6
master/src/main/java/com/ruoyi/project/base/domain/TBaseRegion.java

@@ -21,7 +21,7 @@ public class TBaseRegion extends BaseEntity {
     /**
      * 唯一标识id
      */
-    private Long id;
+    private Long regionId;
 
     /**
      * 装置id
@@ -142,12 +142,12 @@ public class TBaseRegion extends BaseEntity {
     @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 
-    public void setId(Long id) {
-        this.id = id;
+    public void setRegionId(Long regionId) {
+        this.regionId = regionId;
     }
 
-    public Long getId() {
-        return id;
+    public Long getRegionId() {
+        return regionId;
     }
 
     public void setPlantId(Long plantId) {
@@ -249,7 +249,7 @@ public class TBaseRegion extends BaseEntity {
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("id", getId())
+                .append("regionId", getRegionId())
                 .append("plantId", getPlantId())
                 .append("regionCode", getRegionCode())
                 .append("regionName", getRegionName())

+ 1 - 1
master/src/main/resources/mybatis/base/TBaseDeviceMapper.xml

@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select d.dev_id, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.dev_code, d.dev_describe, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code,su.user_name updater, d.updatedate,d.material,d.material_status,d.response_factor,d.response_factor_from from t_base_device d
         left join sys_user su on su.user_id = d.updater_code
         left join t_base_plant bp on bp.plant_id = d.plant_id
-        left join t_base_region br on br.id = d.region_id
+        left join t_base_region br on br.region_id = d.region_id
         <where>
             <if test="plantId != null "> and d.plant_id = #{plantId}</if>
             <if test="regionId != null  and regionId != ''"> and d.region_id = #{regionId}</if>

+ 11 - 11
master/src/main/resources/mybatis/base/TBasePointMapper.xml

@@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.ruoyi.project.base.mapper.TBasePointMapper">
 
     <resultMap type="TBasePoint" id="TBasePointResult">
-        <result property="id"    column="id"    />
+        <result property="pointId"    column="point_id"    />
         <result property="netTestValue"    column="net_test_value"    />
         <result property="leakageDegree"    column="leakage_degree"    />
         <result property="plantId"    column="plant_id"    />
@@ -54,14 +54,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTBasePointVo">
-        select id, net_test_value, leakage_degree, plant_id, region_id, dev_id, medium, medium_type, point_type, layer, group_position, point_position, group_code, extend_code, sub_point_type, dia, unarrive, unarrive_reason, keep_warm, temperature, pressure, run_time, pid_no, pid_url, pic_no, pic_url, toc_mark, methane_mark, vocs_mark, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_base_point
+        select point_id, net_test_value, leakage_degree, plant_id, region_id, dev_id, medium, medium_type, point_type, layer, group_position, point_position, group_code, extend_code, sub_point_type, dia, unarrive, unarrive_reason, keep_warm, temperature, pressure, run_time, pid_no, pid_url, pic_no, pic_url, toc_mark, methane_mark, vocs_mark, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_base_point
     </sql>
 
     <select id="selectTBasePointList" parameterType="TBasePoint" resultMap="TBasePointResult">
-        select d.id, d.net_test_value, d.leakage_degree, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.dev_id,bd.dev_code,bd.`dev_describe` dev_name,d.medium, d.medium_type, d.point_type, d.layer, d.group_position, d.point_position, d.group_code, d.extend_code, d.sub_point_type, d.dia, d.unarrive, d.unarrive_reason, d.keep_warm, d.temperature, d.pressure, d.run_time, d.pid_no, d.pid_url, d.pic_no, d.pic_url, d.toc_mark, d.methane_mark, d.vocs_mark, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, su.user_name updater, d.updatedate from t_base_point d
+        select d.point_id, d.net_test_value, d.leakage_degree, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.dev_id,bd.dev_code,bd.`dev_describe` dev_name,d.medium, d.medium_type, d.point_type, d.layer, d.group_position, d.point_position, d.group_code, d.extend_code, d.sub_point_type, d.dia, d.unarrive, d.unarrive_reason, d.keep_warm, d.temperature, d.pressure, d.run_time, d.pid_no, d.pid_url, d.pic_no, d.pic_url, d.toc_mark, d.methane_mark, d.vocs_mark, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, su.user_name updater, d.updatedate from t_base_point d
         left join sys_user su on su.user_id = d.updater_code
         left join t_base_plant bp on bp.plant_id = d.plant_id
-        left join t_base_region br on br.id = d.region_id
+        left join t_base_region br on br.region_id = d.region_id
         left join t_base_device bd on bd.dev_id = d.dev_id
         <where>
             <if test="netTestValue != null "> and d.net_test_value = #{netTestValue}</if>
@@ -106,13 +106,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTBasePointById" parameterType="Long" resultMap="TBasePointResult">
         <include refid="selectTBasePointVo"/>
-        where id = #{id}
+        where point_id = #{pointId}
     </select>
 
     <select id="selectTBasePointByGroupCodeAndExtendCode" parameterType="TBasePoint" resultMap="TBasePointResult">
         <include refid="selectTBasePointVo"/>
         <where>
-            <if test="id != null "> and id != #{id}</if>
+            <if test="pointId != null "> and point_id != #{pointId}</if>
             <if test="plantId != null "> and plant_id = #{plantId}</if>
             <if test="regionId != null "> and region_id = #{regionId}</if>
             <if test="devId != null "> and dev_id = #{devId}</if>
@@ -245,17 +245,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">updater_code = #{updaterCode},</if>
             <if test="updatedate != null">updatedate = #{updatedate},</if>
         </trim>
-        where id = #{id}
+        where point_id = #{pointId}
     </update>
 
     <delete id="deleteTBasePointById" parameterType="Long">
-        update t_base_point set del_flag=1 where id = #{id}
+        update t_base_point set del_flag=1 where point_id = #{pointId}
     </delete>
 
     <delete id="deleteTBasePointByIds" parameterType="String">
-        update t_base_point set del_flag=1 where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
+        update t_base_point set del_flag=1 where point_id in
+        <foreach item="pointId" collection="array" open="(" separator="," close=")">
+            #{pointId}
         </foreach>
     </delete>
 </mapper>

+ 10 - 10
master/src/main/resources/mybatis/base/TBaseRegionMapper.xml

@@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.ruoyi.project.base.mapper.TBaseRegionMapper">
 
     <resultMap type="TBaseRegion" id="TBaseRegionResult">
-        <result property="id"    column="id"    />
+        <result property="regionId"    column="region_id"    />
         <result property="plantId"    column="plant_id"    />
         <result property="plantType"    column="plant_type"    />
         <result property="plantName"    column="plant_name"    />
@@ -25,13 +25,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTBaseRegionVo">
-        select id, plant_id, region_code, region_name, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_base_region
+        select region_id, plant_id, region_code, region_name, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_base_region
     </sql>
 
 
 
     <select id="selectTBaseRegionList" parameterType="TBaseRegion" resultMap="TBaseRegionResult">
-        select d.id, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code,su.user_name updater, d.region_code, d.region_name, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate from t_base_region d
+        select d.region_id, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code,su.user_name updater, d.region_code, d.region_name, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate from t_base_region d
         left join sys_user su on su.user_id = d.updater_code
         left join t_base_plant bp on bp.plant_id = d.plant_id
         <where>
@@ -50,12 +50,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
     <select id="selectAllRegionByPlantId" parameterType="long"  resultMap="TBaseRegionResult">
-        select d.id, d.region_code, d.region_name from t_base_region d where d.plant_id=#{plantId} and d.del_flag=0
+        select d.region_id, d.region_code, d.region_name from t_base_region d where d.plant_id=#{plantId} and d.del_flag=0
     </select>
 
     <select id="selectTBaseRegionById" parameterType="Long" resultMap="TBaseRegionResult">
         <include refid="selectTBaseRegionVo"/>
-        where id = #{id}
+        where region_id = #{regionId}
     </select>
 
     <select id="selectTBaseRegionByName" resultMap="TBaseRegionResult">
@@ -111,17 +111,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">updater_code = #{updaterCode},</if>
             <if test="updatedate != null">updatedate = #{updatedate},</if>
         </trim>
-        where id = #{id}
+        where region_id = #{regionId}
     </update>
 
     <delete id="deleteTBaseRegionById" parameterType="Long">
-        update t_base_region set del_flag=1 where id = #{id}
+        update t_base_region set del_flag=1 where region_id = #{regionId}
     </delete>
 
     <delete id="deleteTBaseRegionByIds" parameterType="String">
-        update t_base_region set del_flag=1 where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
+        update t_base_region set del_flag=1 where region_id in
+        <foreach item="regionId" collection="array" open="(" separator="," close=")">
+            #{regionId}
         </foreach>
     </delete>
 </mapper>

+ 2 - 2
ui/src/views/base/device/index.vue

@@ -184,9 +184,9 @@
           <el-select v-model="form.regionId" placeholder="请选择区域" clearable size="small" style="width: 100%">
             <el-option
               v-for="dict in regionOperation"
-              :key="dict.id"
+              :key="dict.regionId"
               :label="dict.regionName"
-              :value="dict.id"
+              :value="dict.regionId"
             />
           </el-select>
         </el-form-item>

+ 10 - 10
ui/src/views/base/point/index.vue

@@ -17,9 +17,9 @@
                    placeholder="请选择区域" clearable size="small">
           <el-option
             v-for="dict in regionOperation"
-            :key="dict.id"
+            :key="dict.regionId"
             :label="dict.regionName"
-            :value="dict.id"
+            :value="dict.regionId"
           />
         </el-select>
       </el-form-item>
@@ -308,9 +308,9 @@
                          @change="getAllDeviceByRegionId(form.regionId)">
                 <el-option
                   v-for="dict in regionOperation"
-                  :key="dict.id"
+                  :key="dict.regionId"
                   :label="dict.regionName"
-                  :value="dict.id"
+                  :value="dict.regionId"
                 />
               </el-select>
             </el-form-item>
@@ -829,7 +829,7 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        id: null,
+        pointId: null,
         ppm: null,
         leakageDegree: null,
         plantId: null,
@@ -886,7 +886,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
+      this.ids = selection.map(item => item.pointId)
       this.status = selection.map(item => item.approveStatus)
       this.single = selection.length !== 1
       this.multiple = !selection.length
@@ -900,14 +900,14 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
+      const pointId = row.pointId || this.ids
       if (row.approveStatus != 0) {
         MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
           confirmButtonText: '确定',
         })
         return
       }
-      getPoint(id).then(response => {
+      getPoint(pointId).then(response => {
         this.form = response.data;
         getAllRegion(this.form.plantId).then(response => {
             this.regionOperation = response.data;
@@ -925,7 +925,7 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.id != null) {
+          if (this.form.pointId != null) {
             updatePoint(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
@@ -943,7 +943,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
+      const ids = row.pointId || this.ids;
       if (row.approveStatus === undefined) {
         for (let i = 0; i < this.status.length; i++) {
           if (this.status[i] != 0) {

+ 6 - 6
ui/src/views/base/region/index.vue

@@ -281,7 +281,7 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        id: null,
+        regionId: null,
         plantId: null,
         regionCode: null,
         regionName: null,
@@ -309,7 +309,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
+      this.ids = selection.map(item => item.regionId)
       this.status = selection.map(item => item.approveStatus)
       this.single = selection.length!==1
       this.multiple = !selection.length
@@ -323,14 +323,14 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
+      const regionId = row.regionId || this.ids
       if (row.approveStatus != 0) {
         MessageBox.alert('已送审/已审核的数据不可修改!', '注意!', {
           confirmButtonText: '确定',
         })
         return;
       }
-      getRegion(id).then(response => {
+      getRegion(regionId).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改区域";
@@ -340,7 +340,7 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.id != null) {
+          if (this.form.regionId != null) {
             updateRegion(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
@@ -358,7 +358,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
+      const ids = row.regionId || this.ids;
       if(row.approveStatus===undefined){
         for (let i = 0; i < this.status.length; i++) {
           if (this.status[i] != 0) {