lirl 3 éve
szülő
commit
288b27379c
23 módosított fájl, 1308 hozzáadás és 1543 törlés
  1. 0 124
      src/main/java/com/steerinfo/ems/emswaterrealtime/controller/EmsWaterRealtimeController.java
  2. 0 26
      src/main/java/com/steerinfo/ems/emswaterrealtime/mapper/EmsWaterRealtimeMapper.java
  3. 0 676
      src/main/java/com/steerinfo/ems/emswaterrealtime/mapper/EmsWaterRealtimeMapper.xml
  4. 0 348
      src/main/java/com/steerinfo/ems/emswaterrealtime/model/EmsWaterRealtime.java
  5. 0 30
      src/main/java/com/steerinfo/ems/emswaterrealtime/service/IEmsWaterRealtimeService.java
  6. 0 172
      src/main/java/com/steerinfo/ems/emswaterrealtime/service/impl/EmsWaterRealtimeServiceImpl.java
  7. 41 30
      src/main/java/com/steerinfo/ems/tcm0318/controller/TCm0318Controller.java
  8. 20 2
      src/main/java/com/steerinfo/ems/tcm0318/mapper/TCm0318Mapper.java
  9. 896 39
      src/main/java/com/steerinfo/ems/tcm0318/mapper/TCm0318Mapper.xml
  10. 10 5
      src/main/java/com/steerinfo/ems/tcm0318/model/TCm0318.java
  11. 18 0
      src/main/java/com/steerinfo/ems/tcm0318/service/ITCm0318Service.java
  12. 103 3
      src/main/java/com/steerinfo/ems/tcm0318/service/impl/TCm0318ServiceImpl.java
  13. 15 26
      src/main/java/com/steerinfo/ems/tcm0323/controller/TCm0323Controller.java
  14. 14 25
      src/main/java/com/steerinfo/ems/tcm0325/controller/TCm0325Controller.java
  15. 3 0
      src/main/java/com/steerinfo/ems/tcm0325/mapper/TCm0325Mapper.xml
  16. 42 18
      src/main/java/com/steerinfo/ems/tcm0348/controller/TCm0348Controller.java
  17. 4 0
      src/main/java/com/steerinfo/ems/tcm0348/mapper/TCm0348Mapper.java
  18. 81 8
      src/main/java/com/steerinfo/ems/tcm0348/mapper/TCm0348Mapper.xml
  19. 14 4
      src/main/java/com/steerinfo/ems/tcm0348/model/TCm0348.java
  20. 8 0
      src/main/java/com/steerinfo/ems/tcm0348/service/ITCm0348Service.java
  21. 36 0
      src/main/java/com/steerinfo/ems/tcm0348/service/impl/TCm0348ServiceImpl.java
  22. 2 6
      src/main/java/com/steerinfo/ems/trmworkprocmaterialvalue/mapper/TRmWorkprocMaterialValueMapper.xml
  23. 1 1
      src/main/java/com/steerinfo/ems/trmworkprocproductvalue/service/impl/TRmWorkprocProductValueServiceImpl.java

+ 0 - 124
src/main/java/com/steerinfo/ems/emswaterrealtime/controller/EmsWaterRealtimeController.java

@@ -1,124 +0,0 @@
-package com.steerinfo.ems.emswaterrealtime.controller;
-
-import com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime;
-import com.steerinfo.ems.emswaterrealtime.service.IEmsWaterRealtimeService;
-import com.steerinfo.ems.trmcalpoint.service.ITRmCalpointService;
-import com.steerinfo.framework.controller.BaseRESTfulController;
-import com.steerinfo.framework.controller.RESTfulResult;
-import com.steerinfo.framework.service.pagehelper.PageList;
-import com.steerinfo.framework.utils.collection.ListUtils;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * EmsWaterRealtime RESTful接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-08-24 07:52
- * 类描述
- * 修订历史:
- * 日期:2021-08-24
- * 作者:generator
- * 参考:
- * 描述:EmsWaterRealtime RESTful接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
-@RestController
-@RequestMapping("/${api.version}/emswaterrealtimes")
-public class EmsWaterRealtimeController extends BaseRESTfulController {
-
-    @Autowired
-    IEmsWaterRealtimeService emsWaterRealtimeService;
-
-    @ApiOperation(value="获取列表", notes="分页查询")
-    @ApiImplicitParams({
-        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
-        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
-    })
-    //@RequiresPermissions("emswaterrealtime:view")
-    @GetMapping(value = "/")
-    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
-        PageList<EmsWaterRealtime> list = emsWaterRealtimeService.queryForPage(parmas, pageNum, pageSize);
-        return success(list);
-    }
-
-    @ApiOperation(value="获取列表", notes="分页模糊查询")
-    @ApiImplicitParams({
-        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
-        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
-    })
-    //@RequiresPermissions("emswaterrealtime:view")
-    @GetMapping(value = "/like/")
-    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
-        PageList<EmsWaterRealtime> list = emsWaterRealtimeService.queryLikeForPage(parmas, pageNum, pageSize);
-        return success(list);
-    }
-    
-    @ApiOperation(value="创建", notes="根据EmsWaterRealtime对象创建")
-    @ApiImplicitParam(name = "emsWaterRealtime", value = "详细实体emsWaterRealtime", required = true, dataType = "EmsWaterRealtime")
-    //@RequiresPermissions("emswaterrealtime:create")
-    @PostMapping(value = "/")
-    public RESTfulResult add(@ModelAttribute EmsWaterRealtime model){
-        EmsWaterRealtime emsWaterRealtime = emsWaterRealtimeService.add(model);
-        return success(emsWaterRealtime);
-    }
-
-    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
-    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
-    //@RequiresPermissions("emswaterrealtime:view")
-    @GetMapping(value = "/{id}")
-    public RESTfulResult get(@PathVariable String id){
-        EmsWaterRealtime emsWaterRealtime = emsWaterRealtimeService.getById(id);
-        return success(emsWaterRealtime);
-    }
-
-    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsWaterRealtime信息来更新详细信息")
-    @ApiImplicitParams({
-        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short"),
-        @ApiImplicitParam(name = "emsWaterRealtime", value = "详细实体emsWaterRealtime", required = true, dataType = "EmsWaterRealtime")
-    })
-    //@RequiresPermissions("emswaterrealtime:update")
-    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult update(@PathVariable String id, @RequestBody EmsWaterRealtime model){
-        model.setId(id);
-        EmsWaterRealtime emsWaterRealtime = emsWaterRealtimeService.modify(model);
-        return success(emsWaterRealtime);
-    }
-
-    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
-    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
-    //@RequiresPermissions("emswaterrealtime:delete")
-    @DeleteMapping(value = "/{id}")//Short
-    public RESTfulResult delete(@PathVariable String id){
-    	List<String> list = Arrays.asList(id.split(","));
-    	if(ListUtils.isNotEmpty(list)) {
-	    	List<String> ids = ListUtils.convertList(list);
-			  emsWaterRealtimeService.delete(ids);
-    	}
-      return success();
-    }
-
-    @Autowired
-    ITRmCalpointService tRmCalpointService;
-
-
-    @ApiOperation(value="生成", notes="生成水数据")
-    //@RequiresPermissions("emswaterrealtime:delete")
-    @GetMapping(value = "/water")//Short
-    public int water(){
-        emsWaterRealtimeService.getWaterListByArmMeter();
-         emsWaterRealtimeService.dataGeneration();
-        //emsWaterRealtimeService.getcalpoint();
-        emsWaterRealtimeService.getWaterTenMinutes();
-
-        tRmCalpointService.statHourData();
-        return 1;
-    }
-}

+ 0 - 26
src/main/java/com/steerinfo/ems/emswaterrealtime/mapper/EmsWaterRealtimeMapper.java

@@ -1,26 +0,0 @@
-package com.steerinfo.ems.emswaterrealtime.mapper;
-
-import com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime;
-import com.steerinfo.ems.trmcalpoint.model.TRmCalpoint;
-import com.steerinfo.framework.mapper.IBaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.HashMap;
-import java.util.List;
-
-@Mapper
-public interface EmsWaterRealtimeMapper extends IBaseMapper<EmsWaterRealtime, String> {
-
-    //@TargetDataSource(dataSourceKey = DataSourceKey.DB_OTHER)
-    List<EmsWaterRealtime> getWaterListByArmMeter();
-
-    List<TRmCalpoint> getcalpoint();
-
-    List<EmsWaterRealtime> getWaterTenMinutes();
-
-    int insertWaterTenMinutes(HashMap<String, Object> HashMap);
-
-    int updateWaterTenMinutes(HashMap<String, Object> HashMap);
-
-    int updateWaterMinutes(HashMap<String, Object> HashMap);
-}

+ 0 - 676
src/main/java/com/steerinfo/ems/emswaterrealtime/mapper/EmsWaterRealtimeMapper.xml

@@ -1,676 +0,0 @@
-<?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.steerinfo.ems.emswaterrealtime.mapper.EmsWaterRealtimeMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime">
-    <id column="MeterId" jdbcType="DECIMAL" property="meterid" />
-    <result column="PhoneNo" jdbcType="VARCHAR" property="phoneno" />
-    <result column="AddressCode" jdbcType="VARCHAR" property="addresscode" />
-    <result column="M_UserType" jdbcType="VARCHAR" property="mUsertype" />
-    <result column="M_Type" jdbcType="VARCHAR" property="mType" />
-    <result column="M_Name" jdbcType="VARCHAR" property="mName" />
-    <result column="M_DoorNo" jdbcType="VARCHAR" property="mDoorno" />
-    <result column="M_PipeDn" jdbcType="VARCHAR" property="mPipedn" />
-    <result column="M_Material" jdbcType="VARCHAR" property="mMaterial" />
-    <result column="M_Ratio" jdbcType="VARCHAR" property="mRatio" />
-    <result column="CreateTime" jdbcType="TIMESTAMP" property="createtime" />
-    <result column="ForValue" jdbcType="DECIMAL" property="forvalue" />
-    <result column="RevValue" jdbcType="DECIMAL" property="revvalue" />
-    <result column="PressValue" jdbcType="DECIMAL" property="pressvalue" />
-    <result column="RealValue" jdbcType="DECIMAL" property="realvalue" />
-    <result column="SumValue" jdbcType="DECIMAL" property="sumvalue" />
-    <result column="CelVal" jdbcType="DECIMAL" property="celval" />
-    <result column="NetVal" jdbcType="DECIMAL" property="netval" />
-    <result column="IsStat" jdbcType="CHAR" property="isstat" />
-    <result column="DeviceId" jdbcType="VARCHAR" property="deviceid" />
-    <result column="ReadTime" jdbcType="TIMESTAMP" property="readtime" />
-  </resultMap>
-  <sql id="columns">
-    MeterId, PhoneNo, AddressCode, M_UserType, M_Type, M_Name, M_DoorNo, M_PipeDn, M_Material, 
-    M_Ratio, CreateTime, ForValue, RevValue, PressValue, RealValue, SumValue, CelVal, 
-    NetVal, IsStat, DeviceId, ReadTime
-  </sql>
-  <sql id="columns_alias">
-    t.MeterId, t.PhoneNo, t.AddressCode, t.M_UserType, t.M_Type, t.M_Name, t.M_DoorNo, 
-    t.M_PipeDn, t.M_Material, t.M_Ratio, t.CreateTime, t.ForValue, t.RevValue, t.PressValue, 
-    t.RealValue, t.SumValue, t.CelVal, t.NetVal, t.IsStat, t.DeviceId, t.ReadTime
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns"/> FROM EMS_WATER_REALTIME
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM EMS_WATER_REALTIME t
-  </sql>
-  <sql id="where">
-    <where> 
-      <if test="meterid != null">
-        and MeterId = #{meterid}
-      </if>
-      <if test="phoneno != null and phoneno != ''">
-        and PhoneNo = #{phoneno}
-      </if>
-      <if test="addresscode != null and addresscode != ''">
-        and AddressCode = #{addresscode}
-      </if>
-      <if test="mUsertype != null and mUsertype != ''">
-        and M_UserType = #{mUsertype}
-      </if>
-      <if test="mType != null and mType != ''">
-        and M_Type = #{mType}
-      </if>
-      <if test="mName != null and mName != ''">
-        and M_Name = #{mName}
-      </if>
-      <if test="mDoorno != null and mDoorno != ''">
-        and M_DoorNo = #{mDoorno}
-      </if>
-      <if test="mPipedn != null and mPipedn != ''">
-        and M_PipeDn = #{mPipedn}
-      </if>
-      <if test="mMaterial != null and mMaterial != ''">
-        and M_Material = #{mMaterial}
-      </if>
-      <if test="mRatio != null and mRatio != ''">
-        and M_Ratio = #{mRatio}
-      </if>
-      <if test="createtime != null">
-        and TO_CHAR(CreateTime,'yyyy-MM-dd') = #{createtime}
-      </if>
-      <if test="forvalue != null">
-        and ForValue = #{forvalue}
-      </if>
-      <if test="revvalue != null">
-        and RevValue = #{revvalue}
-      </if>
-      <if test="pressvalue != null">
-        and PressValue = #{pressvalue}
-      </if>
-      <if test="realvalue != null">
-        and RealValue = #{realvalue}
-      </if>
-      <if test="sumvalue != null">
-        and SumValue = #{sumvalue}
-      </if>
-      <if test="celval != null">
-        and CelVal = #{celval}
-      </if>
-      <if test="netval != null">
-        and NetVal = #{netval}
-      </if>
-      <if test="isstat != null">
-        and IsStat = #{isstat}
-      </if>
-      <if test="deviceid != null and deviceid != ''">
-        and DeviceId = #{deviceid}
-      </if>
-      <if test="readtime != null">
-        and TO_CHAR(ReadTime,'yyyy-MM-dd') = #{readtime}
-      </if>
-    </where>
-  </sql>
-  <sql id="whereLike">
-    <where> 
-      <if test="meterid != null">
-        and MeterId = #{meterid}
-      </if>
-      <if test="phoneno != null and phoneno != ''">
-        and PhoneNo LIKE '%${phoneno}%'
-      </if>
-      <if test="addresscode != null and addresscode != ''">
-        and AddressCode LIKE '%${addresscode}%'
-      </if>
-      <if test="mUsertype != null and mUsertype != ''">
-        and M_UserType LIKE '%${mUsertype}%'
-      </if>
-      <if test="mType != null and mType != ''">
-        and M_Type LIKE '%${mType}%'
-      </if>
-      <if test="mName != null and mName != ''">
-        and M_Name LIKE '%${mName}%'
-      </if>
-      <if test="mDoorno != null and mDoorno != ''">
-        and M_DoorNo LIKE '%${mDoorno}%'
-      </if>
-      <if test="mPipedn != null and mPipedn != ''">
-        and M_PipeDn LIKE '%${mPipedn}%'
-      </if>
-      <if test="mMaterial != null and mMaterial != ''">
-        and M_Material LIKE '%${mMaterial}%'
-      </if>
-      <if test="mRatio != null and mRatio != ''">
-        and M_Ratio LIKE '%${mRatio}%'
-      </if>
-      <if test="createtime != null">
-        and TO_CHAR(CreateTime,'yyyy-MM-dd') = #{createtime}
-      </if>
-      <if test="forvalue != null">
-        and ForValue = #{forvalue}
-      </if>
-      <if test="revvalue != null">
-        and RevValue = #{revvalue}
-      </if>
-      <if test="pressvalue != null">
-        and PressValue = #{pressvalue}
-      </if>
-      <if test="realvalue != null">
-        and RealValue = #{realvalue}
-      </if>
-      <if test="sumvalue != null">
-        and SumValue = #{sumvalue}
-      </if>
-      <if test="celval != null">
-        and CelVal = #{celval}
-      </if>
-      <if test="netval != null">
-        and NetVal = #{netval}
-      </if>
-      <if test="isstat != null">
-        and IsStat = #{isstat}
-      </if>
-      <if test="deviceid != null and deviceid != ''">
-        and DeviceId LIKE '%${deviceid}%'
-      </if>
-      <if test="readtime != null">
-        and TO_CHAR(ReadTime,'yyyy-MM-dd') = #{readtime}
-      </if>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from EMS_WATER_REALTIME
-    where MeterId = #{meterid,jdbcType=DECIMAL}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from EMS_WATER_REALTIME
-    where 1!=1 
-      <if test="phoneno != null and phoneno != ''">
-        or PhoneNo = #{phoneno}
-      </if>
-      <if test="addresscode != null and addresscode != ''">
-        or AddressCode = #{addresscode}
-      </if>
-      <if test="mUsertype != null and mUsertype != ''">
-        or M_UserType = #{mUsertype}
-      </if>
-      <if test="mType != null and mType != ''">
-        or M_Type = #{mType}
-      </if>
-      <if test="mName != null and mName != ''">
-        or M_Name = #{mName}
-      </if>
-      <if test="mDoorno != null and mDoorno != ''">
-        or M_DoorNo = #{mDoorno}
-      </if>
-      <if test="mPipedn != null and mPipedn != ''">
-        or M_PipeDn = #{mPipedn}
-      </if>
-      <if test="mMaterial != null and mMaterial != ''">
-        or M_Material = #{mMaterial}
-      </if>
-      <if test="mRatio != null and mRatio != ''">
-        or M_Ratio = #{mRatio}
-      </if>
-      <if test="createtime != null">
-        or TO_CHAR(CreateTime,'yyyy-MM-dd') = '#{createtime}'
-      </if>
-      <if test="forvalue != null">
-        or ForValue = #{forvalue}
-      </if>
-      <if test="revvalue != null">
-        or RevValue = #{revvalue}
-      </if>
-      <if test="pressvalue != null">
-        or PressValue = #{pressvalue}
-      </if>
-      <if test="realvalue != null">
-        or RealValue = #{realvalue}
-      </if>
-      <if test="sumvalue != null">
-        or SumValue = #{sumvalue}
-      </if>
-      <if test="celval != null">
-        or CelVal = #{celval}
-      </if>
-      <if test="netval != null">
-        or NetVal = #{netval}
-      </if>
-      <if test="isstat != null">
-        or IsStat = #{isstat}
-      </if>
-      <if test="deviceid != null and deviceid != ''">
-        or DeviceId = #{deviceid}
-      </if>
-      <if test="readtime != null">
-        or TO_CHAR(ReadTime,'yyyy-MM-dd') = '#{readtime}'
-      </if>
-  </delete>
-  <insert id="insert" parameterType="com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime">
-    insert into EMS_WATER_REALTIME (MeterId, PhoneNo, AddressCode, 
-      M_UserType, M_Type, M_Name, 
-      M_DoorNo, M_PipeDn, M_Material, 
-      M_Ratio, CreateTime, ForValue,
-      RevValue, PressValue, RealValue, 
-      SumValue, CelVal, NetVal, 
-      IsStat, DeviceId, ReadTime
-      )
-    values (#{meterid,jdbcType=DECIMAL}, #{phoneno,jdbcType=VARCHAR}, #{addresscode,jdbcType=VARCHAR}, 
-      #{mUsertype,jdbcType=VARCHAR}, #{mType,jdbcType=VARCHAR}, #{mName,jdbcType=VARCHAR}, 
-      #{mDoorno,jdbcType=VARCHAR}, #{mPipedn,jdbcType=VARCHAR}, #{mMaterial,jdbcType=VARCHAR}, 
-      #{mRatio,jdbcType=VARCHAR},
-    to_date (substr( #{createtime,jdbcType=TIME}, 0, INSTR( #{createtime,jdbcType=TIME}, '.', 1, 1 )-1), 'YYYY-MM-DD HH24:MI:SS' ),
-    #{forvalue,jdbcType=DECIMAL},
-      #{revvalue,jdbcType=DECIMAL}, #{pressvalue,jdbcType=DECIMAL}, #{realvalue,jdbcType=DECIMAL}, 
-      #{sumvalue,jdbcType=DECIMAL}, #{celval,jdbcType=DECIMAL}, #{netval,jdbcType=DECIMAL}, 
-      #{isstat,jdbcType=CHAR}, #{deviceid,jdbcType=VARCHAR}, to_date ( #{readtime,jdbcType=TIME} , 'YYYY-MM-DD HH24:MI:SS' )
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime">
-    insert into EMS_WATER_REALTIME
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="meterid != null">
-        MeterId,
-      </if>
-      <if test="phoneno != null">
-        PhoneNo,
-      </if>
-      <if test="addresscode != null">
-        AddressCode,
-      </if>
-      <if test="mUsertype != null">
-        M_UserType,
-      </if>
-      <if test="mType != null">
-        M_Type,
-      </if>
-      <if test="mName != null">
-        M_Name,
-      </if>
-      <if test="mDoorno != null">
-        M_DoorNo,
-      </if>
-      <if test="mPipedn != null">
-        M_PipeDn,
-      </if>
-      <if test="mMaterial != null">
-        M_Material,
-      </if>
-      <if test="mRatio != null">
-        M_Ratio,
-      </if>
-      <if test="createtime != null">
-        CreateTime,
-      </if>
-      <if test="forvalue != null">
-        ForValue,
-      </if>
-      <if test="revvalue != null">
-        RevValue,
-      </if>
-      <if test="pressvalue != null">
-        PressValue,
-      </if>
-      <if test="realvalue != null">
-        RealValue,
-      </if>
-      <if test="sumvalue != null">
-        SumValue,
-      </if>
-      <if test="celval != null">
-        CelVal,
-      </if>
-      <if test="netval != null">
-        NetVal,
-      </if>
-      <if test="isstat != null">
-        IsStat,
-      </if>
-      <if test="deviceid != null">
-        DeviceId,
-      </if>
-      <if test="readtime != null">
-        ReadTime,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="meterid != null">
-        #{meterid,jdbcType=DECIMAL},
-      </if>
-      <if test="phoneno != null">
-        #{phoneno,jdbcType=VARCHAR},
-      </if>
-      <if test="addresscode != null">
-        #{addresscode,jdbcType=VARCHAR},
-      </if>
-      <if test="mUsertype != null">
-        #{mUsertype,jdbcType=VARCHAR},
-      </if>
-      <if test="mType != null">
-        #{mType,jdbcType=VARCHAR},
-      </if>
-      <if test="mName != null">
-        #{mName,jdbcType=VARCHAR},
-      </if>
-      <if test="mDoorno != null">
-        #{mDoorno,jdbcType=VARCHAR},
-      </if>
-      <if test="mPipedn != null">
-        #{mPipedn,jdbcType=VARCHAR},
-      </if>
-      <if test="mMaterial != null">
-        #{mMaterial,jdbcType=VARCHAR},
-      </if>
-      <if test="mRatio != null">
-        #{mRatio,jdbcType=VARCHAR},
-      </if>
-      <if test="createtime != null">
-        #{createtime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="forvalue != null">
-        #{forvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="revvalue != null">
-        #{revvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="pressvalue != null">
-        #{pressvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="realvalue != null">
-        #{realvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="sumvalue != null">
-        #{sumvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="celval != null">
-        #{celval,jdbcType=DECIMAL},
-      </if>
-      <if test="netval != null">
-        #{netval,jdbcType=DECIMAL},
-      </if>
-      <if test="isstat != null">
-        #{isstat,jdbcType=CHAR},
-      </if>
-      <if test="deviceid != null">
-        #{deviceid,jdbcType=VARCHAR},
-      </if>
-      <if test="readtime != null">
-        #{readtime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime">
-    update EMS_WATER_REALTIME
-    set PhoneNo = #{phoneno,jdbcType=VARCHAR},
-      AddressCode = #{addresscode,jdbcType=VARCHAR},
-      M_UserType = #{mUsertype,jdbcType=VARCHAR},
-      M_Type = #{mType,jdbcType=VARCHAR},
-      M_Name = #{mName,jdbcType=VARCHAR},
-      M_DoorNo = #{mDoorno,jdbcType=VARCHAR},
-      M_PipeDn = #{mPipedn,jdbcType=VARCHAR},
-      M_Material = #{mMaterial,jdbcType=VARCHAR},
-      M_Ratio = #{mRatio,jdbcType=VARCHAR},
-      CreateTime = to_date (substr( #{createtime,jdbcType=TIME}, 0, INSTR( #{createtime,jdbcType=TIME}, '.', 1, 1 )-1), 'YYYY-MM-DD HH24:MI:SS' ),
-      ForValue = #{forvalue,jdbcType=DECIMAL},
-      RevValue = #{revvalue,jdbcType=DECIMAL},
-      PressValue = #{pressvalue,jdbcType=DECIMAL},
-      RealValue = #{realvalue,jdbcType=DECIMAL},
-      SumValue = #{sumvalue,jdbcType=DECIMAL},
-      CelVal = #{celval,jdbcType=DECIMAL},
-      NetVal = #{netval,jdbcType=DECIMAL},
-      IsStat = #{isstat,jdbcType=CHAR},
-      DeviceId = #{deviceid,jdbcType=VARCHAR},
-      ReadTime = to_date (#{readtime,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' )
-    where MeterId = #{meterid,jdbcType=DECIMAL}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime">
-    update EMS_WATER_REALTIME
-    <set>
-      <if test="phoneno != null">
-        PhoneNo = #{phoneno,jdbcType=VARCHAR},
-      </if>
-      <if test="addresscode != null">
-        AddressCode = #{addresscode,jdbcType=VARCHAR},
-      </if>
-      <if test="mUsertype != null">
-        M_UserType = #{mUsertype,jdbcType=VARCHAR},
-      </if>
-      <if test="mType != null">
-        M_Type = #{mType,jdbcType=VARCHAR},
-      </if>
-      <if test="mName != null">
-        M_Name = #{mName,jdbcType=VARCHAR},
-      </if>
-      <if test="mDoorno != null">
-        M_DoorNo = #{mDoorno,jdbcType=VARCHAR},
-      </if>
-      <if test="mPipedn != null">
-        M_PipeDn = #{mPipedn,jdbcType=VARCHAR},
-      </if>
-      <if test="mMaterial != null">
-        M_Material = #{mMaterial,jdbcType=VARCHAR},
-      </if>
-      <if test="mRatio != null">
-        M_Ratio = #{mRatio,jdbcType=VARCHAR},
-      </if>
-      <if test="createtime != null">
-        CreateTime = #{createtime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="forvalue != null">
-        ForValue = #{forvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="revvalue != null">
-        RevValue = #{revvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="pressvalue != null">
-        PressValue = #{pressvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="realvalue != null">
-        RealValue = #{realvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="sumvalue != null">
-        SumValue = #{sumvalue,jdbcType=DECIMAL},
-      </if>
-      <if test="celval != null">
-        CelVal = #{celval,jdbcType=DECIMAL},
-      </if>
-      <if test="netval != null">
-        NetVal = #{netval,jdbcType=DECIMAL},
-      </if>
-      <if test="isstat != null">
-        IsStat = #{isstat,jdbcType=CHAR},
-      </if>
-      <if test="deviceid != null">
-        DeviceId = #{deviceid,jdbcType=VARCHAR},
-      </if>
-      <if test="readtime != null">
-        ReadTime = #{readtime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where MeterId = #{meterid,jdbcType=DECIMAL}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where MeterId = #{meterid,jdbcType=DECIMAL}
-  </select>
-  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
-  </select>
-  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
-  </select>
-  <insert id="batchInsert" parameterType="java.util.List">
-    insert into EMS_WATER_REALTIME 
-      (MeterId, 
-      PhoneNo, AddressCode, M_UserType, 
-      M_Type, M_Name, M_DoorNo, 
-      M_PipeDn, M_Material, M_Ratio, 
-      CreateTime, ForValue, RevValue, 
-      PressValue, RealValue, SumValue, 
-      CelVal, NetVal, IsStat, 
-      DeviceId, ReadTime)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.meterid,jdbcType=DECIMAL}, 
-      #{item.phoneno,jdbcType=VARCHAR}, #{item.addresscode,jdbcType=VARCHAR}, #{item.mUsertype,jdbcType=VARCHAR}, 
-      #{item.mType,jdbcType=VARCHAR}, #{item.mName,jdbcType=VARCHAR}, #{item.mDoorno,jdbcType=VARCHAR}, 
-      #{item.mPipedn,jdbcType=VARCHAR}, #{item.mMaterial,jdbcType=VARCHAR}, #{item.mRatio,jdbcType=VARCHAR}, 
-      #{item.createtime,jdbcType=TIMESTAMP}, #{item.forvalue,jdbcType=DECIMAL}, #{item.revvalue,jdbcType=DECIMAL}, 
-      #{item.pressvalue,jdbcType=DECIMAL}, #{item.realvalue,jdbcType=DECIMAL}, #{item.sumvalue,jdbcType=DECIMAL}, 
-      #{item.celval,jdbcType=DECIMAL}, #{item.netval,jdbcType=DECIMAL}, #{item.isstat,jdbcType=CHAR}, 
-      #{item.deviceid,jdbcType=VARCHAR}, #{item.readtime,jdbcType=TIMESTAMP} from dual  
-   </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-     update EMS_WATER_REALTIME
-     set
-       MeterId=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.meterid,jdbcType=DECIMAL}
-       </foreach>
-       ,PhoneNo=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.phoneno,jdbcType=VARCHAR}
-       </foreach>
-       ,AddressCode=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.addresscode,jdbcType=VARCHAR}
-       </foreach>
-       ,M_UserType=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.mUsertype,jdbcType=VARCHAR}
-       </foreach>
-       ,M_Type=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.mType,jdbcType=VARCHAR}
-       </foreach>
-       ,M_Name=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.mName,jdbcType=VARCHAR}
-       </foreach>
-       ,M_DoorNo=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.mDoorno,jdbcType=VARCHAR}
-       </foreach>
-       ,M_PipeDn=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.mPipedn,jdbcType=VARCHAR}
-       </foreach>
-       ,M_Material=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.mMaterial,jdbcType=VARCHAR}
-       </foreach>
-       ,M_Ratio=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.mRatio,jdbcType=VARCHAR}
-       </foreach>
-       ,CreateTime=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.createtime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,ForValue=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.forvalue,jdbcType=DECIMAL}
-       </foreach>
-       ,RevValue=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.revvalue,jdbcType=DECIMAL}
-       </foreach>
-       ,PressValue=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.pressvalue,jdbcType=DECIMAL}
-       </foreach>
-       ,RealValue=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.realvalue,jdbcType=DECIMAL}
-       </foreach>
-       ,SumValue=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.sumvalue,jdbcType=DECIMAL}
-       </foreach>
-       ,CelVal=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.celval,jdbcType=DECIMAL}
-       </foreach>
-       ,NetVal=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.netval,jdbcType=DECIMAL}
-       </foreach>
-       ,IsStat=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.isstat,jdbcType=CHAR}
-       </foreach>
-       ,DeviceId=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.deviceid,jdbcType=VARCHAR}
-       </foreach>
-       ,ReadTime=
-       <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
-          when #{item.meterid,jdbcType=DECIMAL} then #{item.readtime,jdbcType=TIMESTAMP}
-       </foreach>
-     where MeterId in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.meterid,jdbcType=DECIMAL}
-     </foreach> 
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from EMS_WATER_REALTIME
-    where MeterId in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
-      #{id}
-    </foreach>
-  </delete>
-  <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-      <select id="getWaterListByArmMeter" resultMap="BaseResultMap">
-        SELECT MeterId, PhoneNo, AddressCode, M_UserType, M_Type
-             , M_Name, M_DoorNo, M_PipeDn, M_Material, M_Ratio, CreateTime
-             , ForValue, RevValue, PressValue, RealValue, SumValue, CelVal
-             , NetVal, IsStat, DeviceId FROM ARM_Meter WITH (NOLOCK) where CreateTime >= '2021-08-01'
-<!--        FROM Meter_Base.dbo.ARM_Meter-->
-    </select>
-  <select id="getcalpoint"
-          resultType="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint">
-    SELECT * FROM T_RM_CALPOINT WHERE ITEMID  not in
-    (SELECT t.ITEMID FROM T_RM_CALPOINT t JOIN FORMULA f ON t.ITEMID =f.CODE)
-  </select>
-  <select id="getWaterTenMinutes" resultMap="BaseResultMap">
-    SELECT w.FORVALUE AS SUMVALUE,
-<!--(w.FORVALUE - w.REVVALUE) -->
-    c.BTYPE2 AS M_TYPE,  c.SOURCE_TYPE AS M_MATERIAL
-    FROM T_RM_LOCATION l
-    JOIN T_RM_CALPOINT c ON l.ID = c.LOCATEID
-    AND c.ENERGYTYPEID = 'W'
-    LEFT JOIN EMS_WATER_REALTIME w ON l.BCODE = w.ADDRESSCODE
-    ORDER BY TO_NUMBER(regexp_substr(l.ID,'[0-9.]+'))
-  </select>
-  <insert id="insertWaterTenMinutes" parameterType="java.util.HashMap">
-    INSERT INTO EMS_WATER_TIMING(TMSTMP, TIM,
-    YZGXS_YSX, YLT_ZWATER_ACC2, BWFDZ_CYS_ZYLLJ, LG1_SCXINS_ACC2, SJ2_YRXINS_ACC,
-    SJ2_YRXINS_ACC2, JH1_GLXINS_ACC, YLT_HQXINS_ACC, YJ_SC_FOLW1, YSJ_CYS_TO_LG,
-    ESJ_CYS_TO_LG, YSJ_CYS_ACC, ESJ_CYS_ACC, BWFDZ_CYWATER_ACC, EJH_XS_HQ_JLS_ACC) VALUES
-    (to_date (#{clock1,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' ),
-    to_date (#{clock2,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' ),
-    0.00, 0.00, 0.00, 0.00, 0.00,
-    0.00, 0.00, 0.00, 0.00, 0.00,
-    0.00, 0.00, 0.00, 0.00, 0.00
-    )
-  </insert>
-  <update id="updateWaterTenMinutes" parameterType="java.util.HashMap">
-    update EMS_WATER_TIMING
-    <set>
-      <if test="clock2 != null and clock2 != ''">
-        TIM = to_date (#{clock2,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' )
-      </if>
-      ${sql}
-    </set>
-    where TMSTMP =to_date (#{clock1,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' )
-  </update>
-  <update id="updateWaterMinutes" parameterType="java.util.HashMap">
-    update ${table}
-    <set>
-      <if test="clock != null and clock2 != ''">
-        TMSTMP = to_date (#{clock,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' )
-      </if>
-      ${sql}
-    </set>
-  </update>
-</mapper>

+ 0 - 348
src/main/java/com/steerinfo/ems/emswaterrealtime/model/EmsWaterRealtime.java

@@ -1,348 +0,0 @@
-package com.steerinfo.ems.emswaterrealtime.model;
-
-import com.steerinfo.framework.model.IBasePO;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.math.BigDecimal;
-
-@ApiModel(value="null")
-public class EmsWaterRealtime implements IBasePO<String> {
-    /**
-     * 表主键(MeterId,DECIMAL,0)
-     */
-    @ApiModelProperty(value="表主键",required=true)
-    private String meterid;
-
-    /**
-     * SIM卡号(PhoneNo,VARCHAR,11)
-     */
-    @ApiModelProperty(value="SIM卡号",required=true)
-    private String phoneno;
-
-    /**
-     * 地址编码(AddressCode,VARCHAR,10)
-     */
-    @ApiModelProperty(value="地址编码",required=true)
-    private String addresscode;
-
-    /**
-     * 用水类型(M_UserType,VARCHAR,20)
-     */
-    @ApiModelProperty(value="用水类型",required=true)
-    private String mUsertype;
-
-    /**
-     * 站点类型(M_Type,VARCHAR,50)
-     */
-    @ApiModelProperty(value="站点类型",required=false)
-    private String mType;
-
-    /**
-     * 站点名称(M_Name,VARCHAR,50)
-     */
-    @ApiModelProperty(value="站点名称",required=false)
-    private String mName;
-
-    /**
-     * 户号(M_DoorNo,VARCHAR,20)
-     */
-    @ApiModelProperty(value="户号",required=false)
-    private String mDoorno;
-
-    /**
-     * 管径大小(M_PipeDn,VARCHAR,20)
-     */
-    @ApiModelProperty(value="管径大小",required=false)
-    private String mPipedn;
-
-    /**
-     * 管线材质(M_Material,VARCHAR,20)
-     */
-    @ApiModelProperty(value="管线材质",required=false)
-    private String mMaterial;
-
-    /**
-     * 变比(M_Ratio,VARCHAR,5)
-     */
-    @ApiModelProperty(value="变比",required=false)
-    private String mRatio;
-
-    /**
-     * 刷新时间(CreateTime,TIMESTAMP,7)
-     */
-    @ApiModelProperty(value="刷新时间",required=false)
-    private String createtime;
-
-    /**
-     * 正向读数(ForValue,DECIMAL,9)
-     */
-    @ApiModelProperty(value="正向读数",required=false)
-    private BigDecimal forvalue;
-
-    /**
-     * 反向读数(RevValue,DECIMAL,9)
-     */
-    @ApiModelProperty(value="反向读数",required=false)
-    private BigDecimal revvalue;
-
-    /**
-     * 管道压力(PressValue,DECIMAL,9)
-     */
-    @ApiModelProperty(value="管道压力",required=false)
-    private BigDecimal pressvalue;
-
-    /**
-     * 瞬时流量(RealValue,DECIMAL,9)
-     */
-    @ApiModelProperty(value="瞬时流量",required=false)
-    private BigDecimal realvalue;
-
-    /**
-     * 累计流量(SumValue,DECIMAL,9)
-     */
-    @ApiModelProperty(value="累计流量",required=false)
-    private BigDecimal sumvalue;
-
-    /**
-     * 电池电压(CelVal,DECIMAL,5)
-     */
-    @ApiModelProperty(value="电池电压",required=false)
-    private BigDecimal celval;
-
-    /**
-     * 网络信号(NetVal,DECIMAL,38)
-     */
-    @ApiModelProperty(value="网络信号",required=false)
-    private BigDecimal netval;
-
-    /**
-     * 状态标识(IsStat,CHAR,1)
-     */
-    @ApiModelProperty(value="状态标识",required=false)
-    private String isstat;
-
-    /**
-     * 设备id(DeviceId,VARCHAR,20)
-     */
-    @ApiModelProperty(value="设备id",required=false)
-    private String deviceid;
-
-    /**
-     * 读取时间(ReadTime,TIMESTAMP,7)
-     */
-    @ApiModelProperty(value="读取时间",required=false)
-    private String readtime;
-
-    private static final long serialVersionUID = 1L;
-
-    @Override
-    public String getId() {
-        return this.meterid;
-    }
-
-    @Override
-    public void setId(String meterid) {
-        this.meterid = meterid;
-    }
-
-    public String getMeterid() {
-        return meterid;
-    }
-
-    public void setMeterid(String meterid) {
-        this.meterid = meterid;
-    }
-
-    public String getPhoneno() {
-        return phoneno;
-    }
-
-    public void setPhoneno(String phoneno) {
-        this.phoneno = phoneno == null ? null : phoneno.trim();
-    }
-
-    public String getAddresscode() {
-        return addresscode;
-    }
-
-    public void setAddresscode(String addresscode) {
-        this.addresscode = addresscode == null ? null : addresscode.trim();
-    }
-
-    public String getmUsertype() {
-        return mUsertype;
-    }
-
-    public void setmUsertype(String mUsertype) {
-        this.mUsertype = mUsertype == null ? null : mUsertype.trim();
-    }
-
-    public String getmType() {
-        return mType;
-    }
-
-    public void setmType(String mType) {
-        this.mType = mType == null ? null : mType.trim();
-    }
-
-    public String getmName() {
-        return mName;
-    }
-
-    public void setmName(String mName) {
-        this.mName = mName == null ? null : mName.trim();
-    }
-
-    public String getmDoorno() {
-        return mDoorno;
-    }
-
-    public void setmDoorno(String mDoorno) {
-        this.mDoorno = mDoorno == null ? null : mDoorno.trim();
-    }
-
-    public String getmPipedn() {
-        return mPipedn;
-    }
-
-    public void setmPipedn(String mPipedn) {
-        this.mPipedn = mPipedn == null ? null : mPipedn.trim();
-    }
-
-    public String getmMaterial() {
-        return mMaterial;
-    }
-
-    public void setmMaterial(String mMaterial) {
-        this.mMaterial = mMaterial == null ? null : mMaterial.trim();
-    }
-
-    public String getmRatio() {
-        return mRatio;
-    }
-
-    public void setmRatio(String mRatio) {
-        this.mRatio = mRatio == null ? null : mRatio.trim();
-    }
-
-    public String getCreatetime() {
-        return createtime;
-    }
-
-    public void setCreatetime(String createtime) {
-        this.createtime = createtime;
-    }
-
-    public BigDecimal getForvalue() {
-        return forvalue;
-    }
-
-    public void setForvalue(BigDecimal forvalue) {
-        this.forvalue = forvalue;
-    }
-
-    public BigDecimal getRevvalue() {
-        return revvalue;
-    }
-
-    public void setRevvalue(BigDecimal revvalue) {
-        this.revvalue = revvalue;
-    }
-
-    public BigDecimal getPressvalue() {
-        return pressvalue;
-    }
-
-    public void setPressvalue(BigDecimal pressvalue) {
-        this.pressvalue = pressvalue;
-    }
-
-    public BigDecimal getRealvalue() {
-        return realvalue;
-    }
-
-    public void setRealvalue(BigDecimal realvalue) {
-        this.realvalue = realvalue;
-    }
-
-    public BigDecimal getSumvalue() {
-        return sumvalue;
-    }
-
-    public void setSumvalue(BigDecimal sumvalue) {
-        this.sumvalue = sumvalue;
-    }
-
-    public BigDecimal getCelval() {
-        return celval;
-    }
-
-    public void setCelval(BigDecimal celval) {
-        this.celval = celval;
-    }
-
-    public BigDecimal getNetval() {
-        return netval;
-    }
-
-    public void setNetval(BigDecimal netval) {
-        this.netval = netval;
-    }
-
-    public String getIsstat() {
-        return isstat;
-    }
-
-    public void setIsstat(String isstat) {
-        this.isstat = isstat == null ? null : isstat.trim();
-    }
-
-    public String getDeviceid() {
-        return deviceid;
-    }
-
-    public void setDeviceid(String deviceid) {
-        this.deviceid = deviceid == null ? null : deviceid.trim();
-    }
-
-    public String getReadtime() {
-        return readtime;
-    }
-
-    public void setReadtime(String readtime) {
-        this.readtime = readtime;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", meterid=").append(meterid);
-        sb.append(", phoneno=").append(phoneno);
-        sb.append(", addresscode=").append(addresscode);
-        sb.append(", mUsertype=").append(mUsertype);
-        sb.append(", mType=").append(mType);
-        sb.append(", mName=").append(mName);
-        sb.append(", mDoorno=").append(mDoorno);
-        sb.append(", mPipedn=").append(mPipedn);
-        sb.append(", mMaterial=").append(mMaterial);
-        sb.append(", mRatio=").append(mRatio);
-        sb.append(", createtime=").append(createtime);
-        sb.append(", forvalue=").append(forvalue);
-        sb.append(", revvalue=").append(revvalue);
-        sb.append(", pressvalue=").append(pressvalue);
-        sb.append(", realvalue=").append(realvalue);
-        sb.append(", sumvalue=").append(sumvalue);
-        sb.append(", celval=").append(celval);
-        sb.append(", netval=").append(netval);
-        sb.append(", isstat=").append(isstat);
-        sb.append(", deviceid=").append(deviceid);
-        sb.append(", readtime=").append(readtime);
-        sb.append(", serialVersionUID=").append(serialVersionUID);
-        sb.append("]");
-        return sb.toString();
-    }
-}

+ 0 - 30
src/main/java/com/steerinfo/ems/emswaterrealtime/service/IEmsWaterRealtimeService.java

@@ -1,30 +0,0 @@
-package com.steerinfo.ems.emswaterrealtime.service;
-
-import com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime;
-import com.steerinfo.framework.service.IBaseService;
-
-import java.util.List;
-
-/**
- * EmsWaterRealtime服务接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-08-24 07:52
- * 类描述
- * 修订历史:
- * 日期:2021-08-24
- * 作者:generator
- * 参考:
- * 描述:EmsWaterRealtime服务接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
-public interface IEmsWaterRealtimeService extends IBaseService<EmsWaterRealtime, String>{
-
-    List<EmsWaterRealtime> getWaterListByArmMeter();
-
-   int dataGeneration();
-
-    void getcalpoint();
-
-    void getWaterTenMinutes();
-}

+ 0 - 172
src/main/java/com/steerinfo/ems/emswaterrealtime/service/impl/EmsWaterRealtimeServiceImpl.java

@@ -1,172 +0,0 @@
-package com.steerinfo.ems.emswaterrealtime.service.impl;
-
-import com.steerinfo.auth.utils.JwtUtil;
-import com.steerinfo.ems.Utils.DateUtils;
-import com.steerinfo.ems.emswaterrealtime.mapper.EmsWaterRealtimeMapper;
-import com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime;
-import com.steerinfo.ems.emswaterrealtime.service.IEmsWaterRealtimeService;
-import com.steerinfo.ems.formula.model.Formula;
-import com.steerinfo.ems.formula.service.IFormulaService;
-import com.steerinfo.ems.ifmesemsswapfile.service.impl.IfMesEmsSwapfileServiceImpl;
-import com.steerinfo.ems.trmcalpoint.model.TRmCalpoint;
-import com.steerinfo.framework.datasource.DataSourceKey;
-import com.steerinfo.framework.datasource.TargetDataSource;
-import com.steerinfo.framework.mapper.IBaseMapper;
-import com.steerinfo.framework.service.impl.BaseServiceImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * EmsWaterRealtime服务实现:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-08-24 07:52
- * 类描述
- * 修订历史:
- * 日期:2021-08-24
- * 作者:generator
- * 参考:
- * 描述:EmsWaterRealtime服务实现
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
-@Service(value = "emsWaterRealtimeService")
-public class EmsWaterRealtimeServiceImpl extends BaseServiceImpl<EmsWaterRealtime, String> implements IEmsWaterRealtimeService {
-
-    private static final Logger logger = LoggerFactory.getLogger(IfMesEmsSwapfileServiceImpl.class);
-
-    @Autowired
-    private EmsWaterRealtimeMapper emsWaterRealtimeMapper;
-
-    @Override
-    protected IBaseMapper<EmsWaterRealtime, String> getMapper() {
-        return emsWaterRealtimeMapper;
-    }
-
-    List<EmsWaterRealtime> emsWaterRealtimeList;
-
-    @Override
-    @TargetDataSource(dataSourceKey = DataSourceKey.DB_OTHER)
-    public List<EmsWaterRealtime> getWaterListByArmMeter() {
-           // emsWaterRealtimeMapper.selectByPrimaryKey("1");//.getWaterListByArmMeter();
-        //List<EmsWaterRealtime>
-                emsWaterRealtimeList = emsWaterRealtimeMapper.getWaterListByArmMeter();
-        return emsWaterRealtimeList;
-    }
-
-    @Override
-    public int dataGeneration() {
-
-        int addSize = 0;
-        int updateSize = 0;
-        try {
-            EmsWaterRealtime model;
-            // emsWaterRealtimeMapper.selectByPrimaryKey("1");//.getWaterListByArmMeter();
-            //List<EmsWaterRealtime> emsWaterRealtimeList = getWaterListByArmMeter();
-            for (EmsWaterRealtime emsWaterRealtime : emsWaterRealtimeList){
-                emsWaterRealtime.setReadtime(DateUtils.dateStr(new Date(),"yyyy-MM-dd hh:mm:ss"));
-                model = emsWaterRealtimeMapper.selectByPrimaryKey(emsWaterRealtime.getMeterid());
-                if(model !=null){
-                    emsWaterRealtimeMapper.updateByPrimaryKey(emsWaterRealtime);
-                    updateSize+=1;
-                    continue;
-                }else {
-                    addSize+= emsWaterRealtimeMapper.insert(emsWaterRealtime);
-                }
-            }
-            String clock = DateUtils.dateStr(new Date(),"yyyy-MM-dd hh:mm:ss");
-            HashMap<String,Object> hashMap = new HashMap<String,Object>();
-            hashMap.put("clock",clock);
-            List<EmsWaterRealtime> emsWaterRealtimeList = emsWaterRealtimeMapper.getWaterTenMinutes();
-            StringBuffer sub = new StringBuffer();
-            String table="EMS_WATER";
-            for (EmsWaterRealtime emsWaterRealtime : emsWaterRealtimeList){
-                String[] tens = emsWaterRealtime.getmMaterial().split("\\.");
-                String tag = tens[1];
-                //多个表生成数据就填加table;
-                table = tens[0];
-                String sql = ","+tag + " = " + "'" + emsWaterRealtime.getSumvalue() + "'";
-                sub.append(sql);
-            }
-            hashMap.put("table",table);
-            hashMap.put("sql",sub.toString());
-            updateSize += emsWaterRealtimeMapper.updateWaterMinutes(hashMap);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-        }
-        logger.info("本次总共新增水数据条数:" + addSize);
-        logger.info("本次总共更新水数据条数:" + updateSize);
-        return addSize+updateSize;
-    }
-
-
-    @Override
-    public void getWaterTenMinutes() {
-        int addSize = 0;
-        int updateSize = 0;
-        int i = 0;
-        try {
-            EmsWaterRealtime model;
-            // emsWaterRealtimeMapper.selectByPrimaryKey("1");//.getWaterListByArmMeter();
-            String clock1 = DateUtils.dateStr(new Date(),"yyyy-MM-dd hh:mm:ss");
-            String clock2 = DateUtils.dateStr(new Date(),"yyyy-MM-dd hh:mm:ss");
-            HashMap<String,Object> hashMap = new HashMap<String,Object>();
-            hashMap.put("clock1",clock1);
-            hashMap.put("clock2",clock2);
-            addSize += emsWaterRealtimeMapper.insertWaterTenMinutes(hashMap);
-            List<EmsWaterRealtime> emsWaterRealtimeList = emsWaterRealtimeMapper.getWaterTenMinutes();
-            StringBuffer sub = new StringBuffer();
-            String table="EMS_WATER_TIMING";
-            for (EmsWaterRealtime emsWaterRealtime : emsWaterRealtimeList){
-                i++;
-                String[] tens = emsWaterRealtime.getmType().split("\\.");
-                String tag = tens[1];
-                //多个表生成数据就填加table;
-                table = tens[0];
-                String sql = ","+tag + " = " + "'" + emsWaterRealtime.getSumvalue() + "'";
-                sub.append(sql);
-            }
-            clock2 = DateUtils.dateStr(new Date(),"yyyy-MM-dd hh:mm:ss");
-            hashMap.put("table",table);
-            hashMap.put("clock2",clock2);
-            hashMap.put("sql",sub.toString());
-            updateSize += emsWaterRealtimeMapper.updateWaterTenMinutes(hashMap);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-        }
-        logger.info("本次总共新增水数据条数:" + addSize);
-        logger.info("本次总共更新水数据条数:" + updateSize);
-        //return addSize+updateSize;
-    }
-
-    @Autowired
-    IFormulaService formulaService;
-
-    @Override
-    public void getcalpoint() {
-        List<TRmCalpoint> tRmCalpoints = emsWaterRealtimeMapper.getcalpoint();
-        for(TRmCalpoint model : tRmCalpoints){
-            Formula formula = new Formula();
-            formula.setCode(model.getItemid());
-            String itemdesc = model.getItemdesc(); // 项目描述
-            formula.setDescription(itemdesc!=null && !itemdesc.trim().isEmpty() ? itemdesc : model.getTagAlias());
-            // formula.setClock(DateUtils.getCurrentTime("yyyyMM"));
-            formula.setClock("202001");
-            formula.setIsavailable("1");
-            formula.setRevisetime(DateUtils.getCurrentTime("yyyy-MM-dd HH:mm:ss"));
-            formula.setTablename("T_RM_CALPOINT_VALUE");
-            formula.setSourcecode("R(T_RM_CALPOINT_VALUE," + model.getItemid() + ")");
-            formula.setRevisor(JwtUtil.getUseridByToken());
-
-            formulaService.add(formula);
-        }
-
-    }
-}

+ 41 - 30
src/main/java/com/steerinfo/ems/tcm0318/controller/TCm0318Controller.java

@@ -101,37 +101,48 @@ public class TCm0318Controller extends BaseRESTfulController {
         return success(list);
     }
 
-    @ApiOperation(value="水质监测数据录入", notes="根据url的id来指定更新对象,并根据传过来的tCm0318信息来更新详细信息")
-    @ApiImplicitParams({
-            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "tCm0318", value = "详细实体tCm0318", required = true, dataType = "TCm0318")
-    })
-    //@RequiresPermissions("tcm0318:update")
-    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult update(@PathVariable String id, @RequestBody TCm0318 model) {
-        if(tCm0318Service.getById(id) == null){
-            return failed(null, "对应检测数据不存在!");
-        }
-        if(model.getTimegranid() == null || "".equals(model.getTimegranid())){
-            return failed(null, "时间粒度不能为空!");
-        }
-        if(model.getMonitordate() == null || "".equals(model.getMonitordate())){
-            model.setMonitordate(DateUtils.getCurrentTime("yyyy-MM-dd"));
-        }
-        if(model.getDatadate() == null || "".equals(model.getDatadate())){
-            model.setDatadate(DateUtils.getCurrentTime("HH:mm:ss"));
+    @ApiOperation(value="水质页面修改", notes="修改")
+    @PutMapping(value = "/")
+    public RESTfulResult updateByparams(@RequestBody TCm0318[] models){
+        for (TCm0318 model : models) {
+            tCm0318Service.updateByparams(model);
         }
-        if("DAY".equals(model.getTimegranid()) && !model.getMonitordate().substring(0,10).equals(tCm0318Service.getById(id).getMonitordate())){
-            return failed(null, "检测日期错误!");
-        }
-        if("MONTH".equals(model.getTimegranid()) && !model.getMonitordate().substring(0,7).equals(tCm0318Service.getById(id).getMonitordate().substring(0,7))){
-            return failed(null, "检测日期错误!");
-        }
-        LOGGER.info("水质监测数据录入表修改前的数据是" + tCm0318Service.getById(id).toString());
-        model.setRecordid(id);
-        TCm0318 tCm0318 = tCm0318Service.modify(model);
-        LOGGER.info("水质监测数据录入表修改后的数据是" + tCm0318.toString());
-        return success(tCm0318);
+        return success();
     }
 
+//    @ApiOperation(value="水质监测数据录入", notes="根据url的id来指定更新对象,并根据传过来的tCm0318信息来更新详细信息")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+//            @ApiImplicitParam(name = "tCm0318", value = "详细实体tCm0318", required = true, dataType = "TCm0318")
+//    })
+//    //@RequiresPermissions("tcm0318:update")
+//    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+//    public RESTfulResult update(@PathVariable String id, @RequestBody TCm0318 model) {
+//        if(tCm0318Service.getById(id) == null){
+//            return failed(null, "对应检测数据不存在!");
+//        }
+//        if(model.getTimegranid() == null || "".equals(model.getTimegranid())){
+//            return failed(null, "时间粒度不能为空!");
+//        }
+//        if(model.getMonitordate() == null || "".equals(model.getMonitordate())){
+//            model.setMonitordate(DateUtils.getCurrentTime("yyyy-MM-dd"));
+//        }
+//        if(model.getDatadate() == null || "".equals(model.getDatadate())){
+//            model.setDatadate(DateUtils.getCurrentTime("HH:mm:ss"));
+//        }
+//        if("DAY".equals(model.getTimegranid()) && !model.getMonitordate().substring(0,10).equals(tCm0318Service.getById(id).getMonitordate())){
+//            return failed(null, "检测日期错误!");
+//        }
+//        if("MONTH".equals(model.getTimegranid()) && !model.getMonitordate().substring(0,7).equals(tCm0318Service.getById(id).getMonitordate().substring(0,7))){
+//            return failed(null, "检测日期错误!");
+//        }
+//        LOGGER.info("水质监测数据录入表修改前的数据是" + tCm0318Service.getById(id).toString());
+//        model.setRecordid(id);
+//        TCm0318 tCm0318 = tCm0318Service.modify(model);
+//        LOGGER.info("水质监测数据录入表修改后的数据是" + tCm0318.toString());
+//        return success(tCm0318);
+//    }
+
+
+
 }

+ 20 - 2
src/main/java/com/steerinfo/ems/tcm0318/mapper/TCm0318Mapper.java

@@ -3,7 +3,6 @@ package com.steerinfo.ems.tcm0318.mapper;
 import com.steerinfo.ems.tcm0318.model.TCm0318;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import org.apache.ibatis.annotations.Mapper;
-
 import java.util.List;
 import java.util.Map;
 
@@ -13,7 +12,7 @@ public interface TCm0318Mapper extends IBaseMapper<TCm0318, String> {
     void deleteprevious(Map<String, Object> parameters);
     String checkmaxdate(String planid);
     List<TCm0318> qualityassessment(Map<String, Object> parameters);
-    
+
     /**
      * 水质历史数据对比分析查询
      * @param parameters
@@ -21,4 +20,23 @@ public interface TCm0318Mapper extends IBaseMapper<TCm0318, String> {
      */
     List<Map<String, Object>> datacomparison(Map<String, Object> parameters);
     List<TCm0318> getByCode(Map<String, Object> parameters);
+    //获取炼钢数据
+    List<TCm0318> getDataAsLg();
+    //获取冶炼厂数据
+    List<TCm0318> getDataAsYlc();
+    //获取一高线数据
+    List<TCm0318> getDataAsYgx();
+    //获取二高线数据
+    List<TCm0318> getDataAsEgx();
+    //获取发电厂数据
+    List<TCm0318> getDataAsFdc();
+    //获取机焦厂数据
+    List<TCm0318> getDataAsJjc();
+    //获取污水车间数据
+    List<TCm0318> getDataAsWscj();
+    //获取相对的数据
+    TCm0318 selectByparams(TCm0318 tCm0318);
+    //修改
+    int updateByparams(TCm0318 tCm0318);
+
 }

+ 896 - 39
src/main/java/com/steerinfo/ems/tcm0318/mapper/TCm0318Mapper.xml

@@ -7,7 +7,7 @@
     <result column="DATADATE" jdbcType="VARCHAR" property="datadate" />
     <result column="DATASTATE" jdbcType="VARCHAR" property="datastate" />
     <result column="DETECTIONDEPARTMENT" jdbcType="VARCHAR" property="detectiondepartment" />
-    <result column="MONITORDATE" jdbcType="VARCHAR" property="monitordate" />
+    <result column="MONITORDATE" jdbcType="TIMESTAMP" property="monitordate" />
     <result column="MONITORINGVALUE" jdbcType="DECIMAL" property="monitoringvalue" />
     <result column="NOTE" jdbcType="VARCHAR" property="note" />
     <result column="PLANID" jdbcType="VARCHAR" property="planid" />
@@ -44,7 +44,7 @@
     MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, SYSTEMNAME, UNIT, BATCHNO,
     TIMEGRANID, INSERT_TIME, DATASOURCE
     from T_CM_0318
-    where DATASOURCE = 'MANUAL'
+    <where>
         <if test="detectiondepartment != null and detectiondepartment != ''">
             and DETECTIONDEPARTMENT = #{detectiondepartment}
         </if>
@@ -60,12 +60,12 @@
         <if test="systemname != null and systemname != ''">
             and SYSTEMNAME = #{systemname}
         </if>
-        <if test="timegranid != null and timegranid != ''">
-            and TIMEGRANID = #{timegranid, jdbcType=VARCHAR}
-        </if>
-        <if test="monitordate != null and monitordate != ''">
-            and MONITORDATE = #{monitordate, jdbcType=VARCHAR}
+        <if test="startTime != null and startTime != '' and endTime != null and endTime !='' ">
+            and
+            MONITORDATE
+            between to_date(#{startTime}, 'yyyy-mm-dd') and to_date(#{endTime}, 'yyyy-mm-dd')
         </if>
+    </where>
     ORDER BY MONITORDATE, DATADATE
   </select>
 
@@ -75,35 +75,32 @@
     MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, SYSTEMNAME, UNIT, BATCHNO,
     TIMEGRANID, INSERT_TIME
     from T_CM_0318
-    <where>
-      <if test="analyst != null and analyst != ''">
-        and ANALYST like '%${analyst, jdbcType=VARCHAR}%'
-      </if>
-      <if test="detectiondepartment != null and detectiondepartment != ''">
-        and DETECTIONDEPARTMENT = #{detectiondepartment, jdbcType=VARCHAR}
-      </if>
-      <if test="powermonitorname != null and powermonitorname != ''">
-        and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}
-      </if>
-      <if test="sitem != null and sitem != ''">
-          and SITEM = #{sitem}
-      </if>
-      <if test="systemname != null and systemname != ''">
-        and SYSTEMNAME = #{systemname, jdbcType=VARCHAR}
-      </if>
-      <if test="datasource != null and datasource != ''">
-        and DATASOURCE = #{datasource,jdbcType=VARCHAR}
-      </if>
-      <if test="timegranid != null and timegranid != ''">
-        and TIMEGRANID = #{timegranid, jdbcType=VARCHAR}
-      </if>
-      <if test="monitordate != null and monitordate != ''">
-        and MONITORDATE &gt;= #{monitordate, jdbcType=VARCHAR}
-      </if>
-      <if test="monitordatee != null and monitordatee != ''">
-        and MONITORDATE &lt;= #{monitordatee, jdbcType=VARCHAR}
-      </if>
-    </where>
+<!--    <where>-->
+<!--      <if test="analyst != null and analyst != ''">-->
+<!--        and ANALYST like '%${analyst, jdbcType=VARCHAR}%'-->
+<!--      </if>-->
+<!--      <if test="detectiondepartment != null and detectiondepartment != ''">-->
+<!--        and DETECTIONDEPARTMENT = #{detectiondepartment, jdbcType=VARCHAR}-->
+<!--      </if>-->
+<!--      <if test="powermonitorname != null and powermonitorname != ''">-->
+<!--        and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}-->
+<!--      </if>-->
+<!--      <if test="sitem != null and sitem != ''">-->
+<!--          and SITEM = #{sitem}-->
+<!--      </if>-->
+<!--      <if test="systemname != null and systemname != ''">-->
+<!--        and SYSTEMNAME = #{systemname, jdbcType=VARCHAR}-->
+<!--      </if>-->
+<!--      <if test="datasource != null and datasource != ''">-->
+<!--        and DATASOURCE = #{datasource,jdbcType=VARCHAR}-->
+<!--      </if>-->
+<!--      <if test="monitordate != null">-->
+<!--        and MONITORDATE &gt;= #{monitordate, jdbcType=TIMESTAMP}-->
+<!--      </if>-->
+<!--      <if test="monitordatee != null and monitordatee != ''">-->
+<!--        and MONITORDATE &lt;= #{monitordatee, jdbcType=VARCHAR}-->
+<!--      </if>-->
+<!--    </where>-->
     ORDER BY MONITORDATE, DATADATE
   </select>
 
@@ -216,8 +213,8 @@
     and a.SYSTEMNAME = c.SYSTEMNAME
     and a.POWERMONITORNAME = c.POWERMONITORNAME
     and a.SITEM = c.ITEMNAME
-    <if test="monitordate != null and monitordate != ''">
-      and instr( a.MONITORDATE, #{monitordate, jdbcType=VARCHAR}) &gt; 0
+    <if test="monitordate != null ">
+      and instr( a.MONITORDATE, #{monitordate, jdbcType=TIMESTAMP}) &gt; 0
     </if>
     <if test="detectiondepartment != null and detectiondepartment != ''">
       and a.DETECTIONDEPARTMENT = #{detectiondepartment, jdbcType=VARCHAR}
@@ -237,7 +234,7 @@
     ANALYST, INSERT_TIME, MONITORDATE, DATADATE, MONITORINGVALUE, DATASOURCE)
     values ( #{recordid, jdbcType=DECIMAL}, #{planid, jdbcType=VARCHAR}, #{detectiondepartment, jdbcType=VARCHAR},
     #{powermonitorname, jdbcType=VARCHAR}, #{sitem, jdbcType=VARCHAR}, #{systemname, jdbcType=VARCHAR}, #{unit, jdbcType=VARCHAR},
-    #{timegranid, jdbcType=VARCHAR}, #{analyst, jdbcType=VARCHAR}, #{inserttime, jdbcType=VARCHAR}, #{monitordate, jdbcType=VARCHAR},
+    #{timegranid, jdbcType=VARCHAR}, #{analyst, jdbcType=VARCHAR}, #{inserttime, jdbcType=VARCHAR}, #{monitordate, jdbcType=TIMESTAMP},
     #{datadate, jdbcType=VARCHAR}, #{monitoringvalue, jdbcType=VARCHAR}, #{datasource, jdbcType=VARCHAR}
     )
   </insert>
@@ -297,4 +294,864 @@
     </set>
     where RECORDID = #{recordid,jdbcType=VARCHAR}
   </update>
+    <!--获取炼钢厂数据-->
+  <select id="getDataAsLg"  resultMap="BaseResultMap">
+    select 'QualityInspectionCenter' as detectiondepartment, '大宗' as analyst, t.*, t1.unit
+  from (select sitem,
+               monitoringvalue,
+               '006' as powermonitorname,
+               'Q00006' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(ZY_ZY1PWS_BOD40 as
+                                                             '100001',
+                                                             ZY_ZY1PWS_COD90 as
+                                                             '100002',
+                                                             ZY_ZY1PWS_TN12 as
+                                                             '100003',
+                                                             ZY_ZY1PWS_NH3N10 as
+                                                             '100004',
+                                                             ZY_ZY1PWS_SS450 as
+                                                             '100005',
+                                                             ZY_ZY1PWS_PH69 as
+                                                             '100006',
+                                                             ZY_ZY1PWS_Y5 as
+                                                             '100007',
+                                                             ZY_ZY1PWS_YD800 as
+                                                             '100008',
+                                                             ZY_ZY1PWS_JD430 as
+                                                             '100009',
+                                                             ZY_ZY1PWS_CL350 as
+                                                             '100010',
+                                                             ZY_ZY1PWS_DD2800 as
+                                                             '100011',
+                                                             ZY_ZY1PWS_ZD05 as
+                                                             '100012',
+                                                             ZY_ZY1PWS_FE05 as
+                                                             '100013',
+                                                             ZY_ZY1PWS_PSL as
+                                                             '100014'))
+        union
+        select sitem,
+               monitoringvalue,
+               '007' as powermonitorname,
+               'Q00007' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(YLC_SJTLPS1_BOD40 as
+                                                             '100001',
+                                                             YLC_SJTLPS1_COD90 as
+                                                             '100002',
+                                                             YLC_SJTLPS1_TN12 as
+                                                             '100003',
+                                                             YLC_SJTLPS1_NH3N10 as
+                                                             '100004',
+                                                             YLC_SJTLPS1_SS450 as
+                                                             '100005',
+                                                             YLC_SJTLPS1_PH69 as
+                                                             '100006',
+                                                             YLC_SJTLPS1_Y5 as
+                                                             '100007',
+                                                             YLC_SJTLPS1_YD800 as
+                                                             '100008',
+                                                             YLC_SJTLPS1_JD430 as
+                                                             '100009',
+                                                             YLC_SJTLPS1_CL350 as
+                                                             '100010',
+                                                             YLC_SJTLPS1_DD2800 as
+                                                             '100011',
+                                                             YLC_SJTLPS1_ZD05 as
+                                                             '100012',
+                                                             YLC_SJTLPS1_FE05 as
+                                                             '100013',
+                                                             ZY_ZY23PWS_PSL as
+                                                             '100014'))
+        union
+        select sitem,
+               monitoringvalue,
+               '008' as powermonitorname,
+               'Q00008' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(LG_RSZ_BOD40 as
+                                                             '100001',
+                                                             LG_RSZ_COD90 as
+                                                             '100002',
+                                                             LG_RSZ_TN12 as
+                                                             '100003',
+                                                             LG_RSZ_NH3N10 as
+                                                             '100004',
+                                                             LG_RSZ_SS450 as
+                                                             '100005',
+                                                             LG_RSZ_PH69 as
+                                                             '100006',
+                                                             LG_RSZ_Y5 as
+                                                             '100007',
+                                                             LG_RSZ_YD800 as
+                                                             '100008',
+                                                             LG_RSZ_JD430 as
+                                                             '100009',
+                                                             LG_RSZ_CL350 as
+                                                             '100010',
+                                                             LG_RSZ_DD2800 as
+                                                             '100011',
+                                                             LG_RSZ_ZD05 as
+                                                             '100012',
+                                                             LG_RSZ_FE05 as
+                                                             '100013',
+                                                             LG_RSZ_PSL as
+                                                             '100014'))
+        union
+        select sitem,
+               monitoringvalue,
+               '009' as powermonitorname,
+               'Q00009' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(LG_YXP_BOD40 as
+                                                             '100001',
+                                                             LG_YXP_COD90 as
+                                                             '100002',
+                                                             LG_YXP_TN12 as
+                                                             '100003',
+                                                             LG_YXP_NH3N10 as
+                                                             '100004',
+                                                             LG_YXP_SS450 as
+                                                             '100005',
+                                                             LG_YXP_PH69 as
+                                                             '100006',
+                                                             LG_YXP_Y5 as
+                                                             '100007',
+                                                             LG_YXP_YD800 as
+                                                             '100008',
+                                                             LG_YXP_JD430 as
+                                                             '100009',
+                                                             LG_YXP_CL350 as
+                                                             '100010',
+                                                             LG_YXP_DD2800 as
+                                                             '100011',
+                                                             LG_YXP_ZD05 as
+                                                             '100012',
+                                                             LG_YXP_FE05 as
+                                                             '100013',
+                                                             LG_YXP_PSL as
+                                                             '100014'))
+        union
+        select sitem,
+               monitoringvalue,
+               '010' as powermonitorname,
+               'Q00010' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(LG_JSF_BOD40 as
+                                                             '100001',
+                                                             LG_JSF_COD90 as
+                                                             '100002',
+                                                             LG_JSF_TN12 as
+                                                             '100003',
+                                                             LG_JSF_NH3N10 as
+                                                             '100004',
+                                                             LG_JSF_SS450 as
+                                                             '100005',
+                                                             LG_JSF_PH69 as
+                                                             '100006',
+                                                             LG_JSF_Y5 as
+                                                             '100007',
+                                                             LG_JSF_YD800 as
+                                                             '100008',
+                                                             LG_JSF_JD430 as
+                                                             '100009',
+                                                             LG_JSF_CL350 as
+                                                             '100010',
+                                                             LG_JSF_DD2800 as
+                                                             '100011',
+                                                             LG_JSF_ZD05 as
+                                                             '100012',
+                                                             LG_JSF_FE05 as
+                                                             '100013',
+                                                             LG_JSF_PSL as
+                                                             '100014'))) t
+  left join t_cm_0311 t1
+    on t.sitem = t1.ITEMCODE
+ where t.monitordate = to_date('2021-05-15', 'yyyy-mm-dd')
+  </select>
+
+    <!--获取冶炼厂数据-->
+    <select id="getDataAsYlc" resultMap="BaseResultMap">
+        select 'QualityInspectionCenter' as detectiondepartment,
+       '大宗' as analyst,
+       t.*,
+       t1.unit
+  from (select sitem,
+               monitoringvalue,
+               '001' as powermonitorname,
+               'Q00001' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(YLC_SJTLPS1_BOD40 as
+                                                             '100001',
+                                                             YLC_SJTLPS1_COD90 as
+                                                             '100002',
+                                                             YLC_SJTLPS1_TN12 as
+                                                             '100003',
+                                                             YLC_SJTLPS1_NH3N10 as
+                                                             '100004',
+                                                             YLC_SJTLPS1_SS450 as
+                                                             '100005',
+                                                             YLC_SJTLPS1_PH69 as
+                                                             '100006',
+                                                             YLC_SJTLPS1_Y5 as
+                                                             '100007',
+                                                             YLC_SJTLPS1_YD800 as
+                                                             '100008',
+                                                             YLC_SJTLPS1_JD430 as
+                                                             '100009',
+                                                             YLC_SJTLPS1_CL350 as
+                                                             '100010',
+                                                             YLC_SJTLPS1_DD2800 as
+                                                             '100011',
+                                                             YLC_SJTLPS1_ZD05 as
+                                                             '100012',
+                                                             YLC_SJTLPS1_FE05 as
+                                                             '100013',
+                                                             YLC_YQSDZL_PSL as
+                                                             '100014'))
+        union
+        select sitem,
+               monitoringvalue,
+               '002' as powermonitorname,
+               'Q00002' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(YLC_SJTLPS1_BOD40 as
+                                                             '100001',
+                                                             YLC_SJTLPS1_COD90 as
+                                                             '100002',
+                                                             YLC_SJTLPS1_TN12 as
+                                                             '100003',
+                                                             YLC_SJTLPS1_NH3N10 as
+                                                             '100004',
+                                                             YLC_SJTLPS1_SS450 as
+                                                             '100005',
+                                                             YLC_SJTLPS1_PH69 as
+                                                             '100006',
+                                                             YLC_SJTLPS1_Y5 as
+                                                             '100007',
+                                                             YLC_SJTLPS1_YD800 as
+                                                             '100008',
+                                                             YLC_SJTLPS1_JD430 as
+                                                             '100009',
+                                                             YLC_SJTLPS1_CL350 as
+                                                             '100010',
+                                                             YLC_SJTLPS1_DD2800 as
+                                                             '100011',
+                                                             YLC_SJTLPS1_ZD05 as
+                                                             '100012',
+                                                             YLC_SJTLPS1_FE05 as
+                                                             '100013',
+                                                             YLC_SJTLPS1_PSL as
+                                                             '100014'))
+        union
+        select sitem,
+               monitoringvalue,
+               '003' as powermonitorname,
+               'Q00003' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(YLC_SJTLPS1_BOD40 as
+                                                             '100001',
+                                                             YLC_SJTLPS1_COD90 as
+                                                             '100002',
+                                                             YLC_SJTLPS1_TN12 as
+                                                             '100003',
+                                                             YLC_SJTLPS1_NH3N10 as
+                                                             '100004',
+                                                             YLC_SJTLPS1_SS450 as
+                                                             '100005',
+                                                             YLC_SJTLPS1_PH69 as
+                                                             '100006',
+                                                             YLC_SJTLPS1_Y5 as
+                                                             '100007',
+                                                             YLC_SJTLPS1_YD800 as
+                                                             '100008',
+                                                             YLC_SJTLPS1_JD430 as
+                                                             '100009',
+                                                             YLC_SJTLPS1_CL350 as
+                                                             '100010',
+                                                             YLC_SJTLPS1_DD2800 as
+                                                             '100011',
+                                                             YLC_SJTLPS1_ZD05 as
+                                                             '100012',
+                                                             YLC_SJTLPS1_FE05 as
+                                                             '100013',
+                                                             YLC_SJTLPS2_PSL as
+                                                             '100014'
+
+                                                             ))
+        union
+        select sitem,
+               monitoringvalue,
+               '004' as powermonitorname,
+               'Q00004' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(YLC_4PSHJ_BOD40 as
+                                                             '100001',
+                                                             YLC_4PSHJ_COD90 as
+                                                             '100002',
+                                                             YLC_4PSHJ_TN12 as
+                                                             '100003',
+                                                             YLC_4PSHJ_NH3N10 as
+                                                             '100004',
+                                                             YLC_4PSHJ_SS450 as
+                                                             '100005',
+                                                             YLC_4PSHJ_PH69 as
+                                                             '100006',
+                                                             YLC_4PSHJ_Y5 as
+                                                             '100007',
+                                                             YLC_4PSHJ_YD800 as
+                                                             '100008',
+                                                             YLC_4PSHJ_JD430 as
+                                                             '100009',
+                                                             YLC_4PSHJ_CL350 as
+                                                             '100010',
+                                                             YLC_4PSHJ_DD2800 as
+                                                             '100011',
+                                                             YLC_4PSHJ_ZD05 as
+                                                             '100012',
+                                                             YLC_4PSHJ_FE05 as
+                                                             '100013',
+                                                             YLC_4PSHJ_PSL as
+                                                             '100014'))
+        union
+        select sitem,
+               monitoringvalue,
+               '005' as powermonitorname,
+               'Q00005' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(YLC_XFSTNWS_BOD40 as
+                                                             '100001',
+                                                             YLC_XFSTNWS_COD90 as
+                                                             '100002',
+                                                             YLC_XFSTNWS_TN12 as
+                                                             '100003',
+                                                             YLC_XFSTNWS_NH3N10 as
+                                                             '100004',
+                                                             YLC_XFSTNWS_SS450 as
+                                                             '100005',
+                                                             YLC_XFSTNWS_PH69 as
+                                                             '100006',
+                                                             YLC_XFSTNWS_Y5 as
+                                                             '100007',
+                                                             YLC_XFSTNWS_YD800 as
+                                                             '100008',
+                                                             YLC_XFSTNWS_JD430 as
+                                                             '100009',
+                                                             YLC_XFSTNWS_CL350 as
+                                                             '100010',
+                                                             YLC_XFSTNWS_DD2800 as
+                                                             '100011',
+                                                             YLC_XFSTNWS_ZD05 as
+                                                             '100012',
+                                                             YLC_XFSTNWS_FE05 as
+                                                             '100013',
+                                                             YLC_XFSTNWS_PSL as
+                                                             '100014'))) t
+  left join t_cm_0311 t1
+    on t.sitem = t1.ITEMCODE
+ where t.monitordate = to_date('2021-05-15', 'yyyy-mm-dd')
+    </select>
+    <!--获取一高线数据-->
+    <select id="getDataAsYgx" resultMap="BaseResultMap">
+        select 'QualityInspectionCenter' as detectiondepartment,
+       '大宗' as analyst,
+       t.*,
+       t1.unit
+  from (select sitem,
+               monitoringvalue,
+               '011' as powermonitorname,
+               'Q00011' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(GX1_WNJPS_BOD40 as
+                                                             '100001',
+                                                             GX1_WNJPS_COD90 as
+                                                             '100002',
+                                                             GX1_WNJPS_TN12 as
+                                                             '100003',
+                                                             GX1_WNJPS_NH3N10 as
+                                                             '100004',
+                                                             GX1_WNJPS_SS450 as
+                                                             '100005',
+                                                             GX1_WNJPS_PH69 as
+                                                             '100006',
+                                                             GX1_WNJPS_Y5 as
+                                                             '100007',
+                                                             GX1_WNJPS_YD800 as
+                                                             '100008',
+                                                             GX1_WNJPS_JD430 as
+                                                             '100009',
+                                                             GX1_WNJPS_CL350 as
+                                                             '100010',
+                                                             GX1_WNJPS_DD2800 as
+                                                             '100011',
+                                                             GX1_WNJPS_ZD05 as
+                                                             '100012',
+                                                             GX1_WNJPS_FE05 as
+                                                             '100013',
+                                                             GX1_WNJPS_PSL as
+                                                             '100014'))) t
+  left join t_cm_0311 t1
+    on t.sitem = t1.ITEMCODE
+ where t.monitordate = to_date('2021-05-15', 'yyyy-mm-dd')
+    </select>
+    <!--获取二高线数据-->
+    <select id="getDataAsEgx" resultMap="BaseResultMap">
+        select 'QualityInspectionCenter' as detectiondepartment,
+       '大宗' as analyst,
+       t.*,
+       t1.unit
+  from (select sitem,
+               monitoringvalue,
+               '012' as powermonitorname,
+               'Q00011' as systemname,
+               dates as monitordate
+          from ems_wscf unpivot(monitoringvalue for sitem in(GX2_WNJPS_BOD40 as
+                                                             '100001',
+                                                             GX2_WNJPS_COD90 as
+                                                             '100002',
+                                                             GX2_WNJPS_TN12 as
+                                                             '100003',
+                                                             GX2_WNJPS_NH3N10 as
+                                                             '100004',
+                                                             GX2_WNJPS_SS450 as
+                                                             '100005',
+                                                             GX2_WNJPS_PH69 as
+                                                             '100006',
+                                                             GX2_WNJPS_Y5 as
+                                                             '100007',
+                                                             GX2_WNJPS_YD800 as
+                                                             '100008',
+                                                             GX2_WNJPS_JD430 as
+                                                             '100009',
+                                                             GX2_WNJPS_CL350 as
+                                                             '100010',
+                                                             GX2_WNJPS_DD2800 as
+                                                             '100011',
+                                                             GX2_WNJPS_ZD05 as
+                                                             '100012',
+                                                             GX2_WNJPS_FE05 as
+                                                             '100013',
+                                                             GX2_WNJPS_PSL as
+                                                             '100014'))) t
+  left join t_cm_0311 t1
+    on t.sitem = t1.ITEMCODE
+ where t.monitordate = to_date('2021-05-15', 'yyyy-mm-dd')
+    </select>
+    <!--发电厂-->
+    <select id="getDataAsFdc" resultMap="BaseResultMap">
+        select 'QualityInspectionCenter' as detectiondepartment,
+               '大宗' as analyst,
+               t.*,
+               t1.unit
+          from (select sitem,
+                       monitoringvalue,
+                       '013' as powermonitorname,
+                       'Q00012' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(FDC_25MW_BOD40 as
+                                                                     '100001',
+                                                                     FDC_25MW_COD90 as
+                                                                     '100002',
+                                                                     FDC_25MW_TN12 as
+                                                                     '100003',
+                                                                     FDC_25MW_NH3N10 as
+                                                                     '100004',
+                                                                     FDC_25MW_SS450 as
+                                                                     '100005',
+                                                                     FDC_25MW_PH69 as
+                                                                     '100006',
+                                                                     FDC_25MW_Y5 as
+                                                                     '100007',
+                                                                     FDC_25MW_YD800 as
+                                                                     '100008',
+                                                                     FDC_25MW_JD430 as
+                                                                     '100009',
+                                                                     FDC_25MW_CL350 as
+                                                                     '100010',
+                                                                     FDC_25MW_DD2800 as
+                                                                     '100011',
+                                                                     FDC_25MW_ZD05 as
+                                                                     '100012',
+                                                                     FDC_25MW_FE05 as
+                                                                     '100013',
+                                                                     FDC_25MW_PSL as
+                                                                     '100014'))
+                union
+                select sitem,
+                       monitoringvalue,
+                       '014' as powermonitorname,
+                       'Q00013' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(FDC_6MW_BOD40 as
+                                                                     '100001',
+                                                                     FDC_6MW_COD90 as
+                                                                     '100002',
+                                                                     FDC_6MW_TN12 as
+                                                                     '100003',
+                                                                     FDC_6MW_NH3N10 as
+                                                                     '100004',
+                                                                     FDC_6MW_SS450 as
+                                                                     '100005',
+                                                                     FDC_6MW_PH69 as
+                                                                     '100006',
+                                                                     FDC_6MW_Y5 as
+                                                                     '100007',
+                                                                     FDC_6MW_YD800 as
+                                                                     '100008',
+                                                                     FDC_6MW_JD430 as
+                                                                     '100009',
+                                                                     FDC_6MW_CL350 as
+                                                                     '100010',
+                                                                     FDC_6MW_DD2800 as
+                                                                     '100011',
+                                                                     FDC_6MW_ZD05 as
+                                                                     '100012',
+                                                                     FDC_6MW_FE05 as
+                                                                     '100013',
+                                                                     FDC_6MW_PSL as
+                                                                     '100014'))
+                union
+                select sitem,
+                       monitoringvalue,
+                       '015' as powermonitorname,
+                       'Q00014' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(FDC_12MW_BOD40 as
+                                                                     '100001',
+                                                                     FDC_12MW_COD90 as
+                                                                     '100002',
+                                                                     FDC_12MW_TN12 as
+                                                                     '100003',
+                                                                     FDC_12MW_NH3N10 as
+                                                                     '100004',
+                                                                     FDC_12MW_SS450 as
+                                                                     '100005',
+                                                                     FDC_12MW_PH69 as
+                                                                     '100006',
+                                                                     FDC_12MW_Y5 as
+                                                                     '100007',
+                                                                     FDC_12MW_YD800 as
+                                                                     '100008',
+                                                                     FDC_12MW_JD430 as
+                                                                     '100009',
+                                                                     FDC_12MW_CL350 as
+                                                                     '100010',
+                                                                     FDC_12MW_DD2800 as
+                                                                     '100011',
+                                                                     FDC_12MW_ZD05 as
+                                                                     '100012',
+                                                                     FDC_12MW_FE05 as
+                                                                     '100013',
+                                                                     FDC_12MW_PSL as
+                                                                     '100014'))) t
+          left join t_cm_0311 t1
+            on t.sitem = t1.ITEMCODE
+         where t.monitordate = to_date('2021-05-15', 'yyyy-mm-dd')
+    </select>
+    <!--获取机焦厂数据-->
+    <select id="getDataAsJjc" resultMap="BaseResultMap">
+                select 'QualityInspectionCenter' as detectiondepartment,
+               '大宗' as analyst,
+               t.*,
+               t1.unit
+          from (select sitem,
+                       monitoringvalue,
+                       '016' as powermonitorname,
+                       'Q00015' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(JJC_SCFS_BOD40 as
+                                                                     '100001',
+                                                                     JJC_SCFS_COD90 as
+                                                                     '100002',
+                                                                     JJC_SCFS_TN12 as
+                                                                     '100003',
+                                                                     JJC_SCFS_NH3N10 as
+                                                                     '100004',
+                                                                     JJC_SCFS_SS450 as
+                                                                     '100005',
+                                                                     JJC_SCFS_PH69 as
+                                                                     '100006',
+                                                                     JJC_SCFS_Y5 as
+                                                                     '100007',
+                                                                     JJC_SCFS_YD800 as
+                                                                     '100008',
+                                                                     JJC_SCFS_JD430 as
+                                                                     '100009',
+                                                                     JJC_SCFS_CL350 as
+                                                                     '100010',
+                                                                     JJC_SCFS_DD2800 as
+                                                                     '100011',
+                                                                     JJC_SCFS_ZD05 as
+                                                                     '100012',
+                                                                     JJC_SCFS_FE05 as
+                                                                     '100013',
+                                                                     JJC_SCFS_PSL as
+                                                                     '100014'
+
+                                                                     ))
+                union
+                select sitem,
+                       monitoringvalue,
+                       '017' as powermonitorname,
+                       'Q00016' as systemname,
+                       dates
+                  from ems_wscf unpivot(monitoringvalue for sitem in(JJC_1XJT_BOD40 as
+                                                                     '100001',
+                                                                     JJC_1XJT_COD90 as
+                                                                     '100002',
+                                                                     JJC_1XJT_TN12 as
+                                                                     '100003',
+                                                                     JJC_1XJT_NH3N10 as
+                                                                     '100004',
+                                                                     JJC_1XJT_SS450 as
+                                                                     '100005',
+                                                                     JJC_1XJT_PH69 as
+                                                                     '100006',
+                                                                     JJC_1XJT_Y5 as
+                                                                     '100007',
+                                                                     JJC_1XJT_YD800 as
+                                                                     '100008',
+                                                                     JJC_1XJT_JD430 as
+                                                                     '100009',
+                                                                     JJC_1XJT_CL350 as
+                                                                     '100010',
+                                                                     JJC_1XJT_DD2800 as
+                                                                     '100011',
+                                                                     JJC_1XJT_ZD05 as
+                                                                     '100012',
+                                                                     JJC_1XJT_FE05 as
+                                                                     '100013',
+                                                                     JJC_1XJT_PSL as
+                                                                     '100014'))) t
+          left join t_cm_0311 t1
+            on t.sitem = t1.ITEMCODE
+         where t.monitordate = to_date('2021-05-15', 'yyyy-mm-dd')
+    </select>
+    <select id="getDataAsWscj" resultMap="BaseResultMap">
+            select 'QualityInspectionCenter' as detectiondepartment,
+               '大宗' as analyst,
+               t.*,
+               t1.unit
+          from (select sitem,
+                       monitoringvalue,
+                       '018' as powermonitorname,
+                       'Q00017' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(WSCJ_NQSH_BOD40 as
+                                                                     '100001',
+                                                                     WSCJ_NQSH_COD90 as
+                                                                     '100002',
+                                                                     WSCJ_NQSH_TN12 as
+                                                                     '100003',
+                                                                     WSCJ_NQSH_NH3N10 as
+                                                                     '100004',
+                                                                     WSCJ_NQSH_SS450 as
+                                                                     '100005',
+                                                                     WSCJ_NQSH_PH69 as
+                                                                     '100006',
+                                                                     WSCJ_NQSH_Y5 as
+                                                                     '100007',
+                                                                     WSCJ_NQSH_YD800 as
+                                                                     '100008',
+                                                                     WSCJ_NQSH_JD430 as
+                                                                     '100009',
+                                                                     WSCJ_NQSH_CL350 as
+                                                                     '100010',
+                                                                     WSCJ_NQSH_DD2800 as
+                                                                     '100011',
+                                                                     WSCJ_NQSH_ZD05 as
+                                                                     '100012',
+                                                                     WSCJ_NQSH_FE05 as
+                                                                     '100013',
+                                                                     WSCJ_NQSH_PSL as
+                                                                     '100014'))
+                union
+                select sitem,
+                       monitoringvalue,
+                       '019' as powermonitorname,
+                       'Q00018' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(WSCJ_NQSC_BOD40 as
+                                                                     '100001',
+                                                                     WSCJ_NQSC_COD90 as
+                                                                     '100002',
+                                                                     WSCJ_NQSC_TN12 as
+                                                                     '100003',
+                                                                     WSCJ_NQSC_NH3N10 as
+                                                                     '100004',
+                                                                     WSCJ_NQSC_SS450 as
+                                                                     '100005',
+                                                                     WSCJ_NQSC_PH69 as
+                                                                     '100006',
+                                                                     WSCJ_NQSC_Y5 as
+                                                                     '100007',
+                                                                     WSCJ_NQSC_YD800 as
+                                                                     '100008',
+                                                                     WSCJ_NQSC_JD430 as
+                                                                     '100009',
+                                                                     WSCJ_NQSC_CL350 as
+                                                                     '100010',
+                                                                     WSCJ_NQSC_DD2800 as
+                                                                     '100011',
+                                                                     WSCJ_NQSC_ZD05 as
+                                                                     '100012',
+                                                                     WSCJ_NQSC_FE05 as
+                                                                     '100013',
+                                                                     WSCJ_NQSC_PSL as
+                                                                     '100014'))
+                union
+                select sitem,
+                       monitoringvalue,
+                       '020' as powermonitorname,
+                       'Q00019' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(WSCJ_SCTJ_BOD40 as
+                                                                     '100001',
+                                                                     WSCJ_SCTJ_COD90 as
+                                                                     '100002',
+                                                                     WSCJ_SCTJ_TN12 as
+                                                                     '100003',
+                                                                     WSCJ_SCTJ_NH3N10 as
+                                                                     '100004',
+                                                                     WSCJ_SCTJ_SS450 as
+                                                                     '100005',
+                                                                     WSCJ_SCTJ_PH69 as
+                                                                     '100006',
+                                                                     WSCJ_SCTJ_Y5 as
+                                                                     '100007',
+                                                                     WSCJ_SCTJ_YD800 as
+                                                                     '100008',
+                                                                     WSCJ_SCTJ_JD430 as
+                                                                     '100009',
+                                                                     WSCJ_SCTJ_CL350 as
+                                                                     '100010',
+                                                                     WSCJ_SCTJ_DD2800 as
+                                                                     '100011',
+                                                                     WSCJ_SCTJ_ZD05 as
+                                                                     '100012',
+                                                                     WSCJ_SCTJ_FE05 as
+                                                                     '100013',
+                                                                     WSCJ_SCTJ_PSL as
+                                                                     '100014'))
+                union
+                select sitem,
+                       monitoringvalue,
+                       '021' as powermonitorname,
+                       'Q00020' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(WSCJ_SHTJ_BOD40 as
+                                                                     '100001',
+                                                                     WSCJ_SHTJ_COD90 as
+                                                                     '100002',
+                                                                     WSCJ_SHTJ_TN12 as
+                                                                     '100003',
+                                                                     WSCJ_SHTJ_NH3N10 as
+                                                                     '100004',
+                                                                     WSCJ_SHTJ_SS450 as
+                                                                     '100005',
+                                                                     WSCJ_SHTJ_PH69 as
+                                                                     '100006',
+                                                                     WSCJ_SHTJ_Y5 as
+                                                                     '100007',
+                                                                     WSCJ_SHTJ_YD800 as
+                                                                     '100008',
+                                                                     WSCJ_SHTJ_JD430 as
+                                                                     '100009',
+                                                                     WSCJ_SHTJ_CL350 as
+                                                                     '100010',
+                                                                     WSCJ_SHTJ_DD2800 as
+                                                                     '100011',
+                                                                     WSCJ_SHTJ_ZD05 as
+                                                                     '100012',
+                                                                     WSCJ_SHTJ_FE05 as
+                                                                     '100013',
+                                                                     WSCJ_SHTJ_PSL as
+                                                                     '100014'))
+                union
+                select sitem,
+                       monitoringvalue,
+                       '022' as powermonitorname,
+                       'Q00021' as systemname,
+                       dates as monitordate
+                  from ems_wscf unpivot(monitoringvalue for sitem in(WSCJ_MQSH_BOD40 as
+                                                                     '100001',
+                                                                     WSCJ_MQSH_COD90 as
+                                                                     '100002',
+                                                                     WSCJ_MQSH_TN12 as
+                                                                     '100003',
+                                                                     WSCJ_MQSH_NH3N10 as
+                                                                     '100004',
+                                                                     WSCJ_MQSH_SS450 as
+                                                                     '100005',
+                                                                     WSCJ_MQSH_PH69 as
+                                                                     '100006',
+                                                                     WSCJ_MQSH_Y5 as
+                                                                     '100007',
+                                                                     WSCJ_MQSH_YD800 as
+                                                                     '100008',
+                                                                     WSCJ_MQSH_JD430 as
+                                                                     '100009',
+                                                                     WSCJ_MQSH_CL350 as
+                                                                     '100010',
+                                                                     WSCJ_MQSH_DD2800 as
+                                                                     '100011',
+                                                                     WSCJ_MQSH_ZD05 as
+                                                                     '100012',
+                                                                     WSCJ_MQSH_FE05 as
+                                                                     '100013',
+                                                                     WSCJ_MQSH_PSL as
+                                                                     '100014'
+
+                                                                     ))) t
+          left join t_cm_0311 t1
+            on t.sitem = t1.ITEMCODE
+         where t.monitordate = to_date('2021-05-15', 'yyyy-mm-dd')
+    </select>
+    <select id="selectByparams" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348" resultMap="BaseResultMap">
+    select *
+      from T_CM_0318
+      <where>
+          <if test="systemname != null and systemname != ''">
+             and  SYSTEMNAME = #{systemname}
+          </if>
+          <if test="powermonitorname != null and powermonitorname != ''">
+             and  POWERMONITORNAME = #{powermonitorname}
+          </if>
+          <if test="sitem != null and sitem != '' ">
+              and SITEM = #{sitem}
+          </if>
+          <if test="monitordate != null">
+              and MONITORDATE = #{monitordate}
+          </if>
+      </where>
+    </select>
+    <update id="updateByparams" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
+        update T_CM_0318
+        <set>
+            <if test="monitoringvalue != null ">
+                MONITORINGVALUE = #{monitoringvalue},
+            </if>
+            <if test="note != null and note != ''">
+                NOTE = #{note}
+            </if>
+        </set>
+        <where>
+            <if test="systemname != null and systemname != ''">
+                and  SYSTEMNAME = #{systemname}
+            </if>
+            <if test="powermonitorname != null and powermonitorname != ''">
+                and  POWERMONITORNAME = #{powermonitorname}
+            </if>
+            <if test="sitem != null and sitem != '' ">
+                and SITEM = #{sitem}
+            </if>
+            <if test="unit != null and unit != ''">
+                and UNIT = #{unit}
+            </if>
+            <if test="monitordate != null">
+                and MONITORDATE = #{monitordate}
+            </if>
+        </where>
+    </update>
 </mapper>

+ 10 - 5
src/main/java/com/steerinfo/ems/tcm0318/model/TCm0318.java

@@ -1,8 +1,12 @@
 package com.steerinfo.ems.tcm0318.model;
 
+import com.alibaba.fastjson.annotation.JSONField;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModelProperty;
 
+import javax.xml.crypto.Data;
+import java.util.Date;
+
 public class TCm0318 implements IBasePO<String> {
     /**
      * 记录id(RECORDID,VARCHAR,255)
@@ -38,10 +42,11 @@ public class TCm0318 implements IBasePO<String> {
      * 监测日期(MONITORDATE,VARCHAR,40)
      */
     @ApiModelProperty(value="监测日期",required=true)
-    private String monitordate;
+    @JSONField(format = "yyyy-MM-dd")
+    private Date monitordate;
 
     /**
-     * 监测值(MONITORINGVALUE,DECIMAL,30)
+         * 监测值(MONITORINGVALUE,DECIMAL,30)
      */
     @ApiModelProperty(value="监测值",required=true)
     private Double monitoringvalue;
@@ -205,12 +210,12 @@ public class TCm0318 implements IBasePO<String> {
         this.detectiondepartment = detectiondepartment == null ? null : detectiondepartment.trim();
     }
 
-    public String getMonitordate() {
+    public Date getMonitordate() {
         return monitordate;
     }
 
-    public void setMonitordate(String monitordate) {
-        this.monitordate = monitordate == null ? null : monitordate.trim();
+    public void setMonitordate(Date monitordate) {
+        this.monitordate = monitordate;
     }
 
     public Double getMonitoringvalue() {

+ 18 - 0
src/main/java/com/steerinfo/ems/tcm0318/service/ITCm0318Service.java

@@ -33,4 +33,22 @@ public interface ITCm0318Service extends IBaseService<TCm0318, String>{
      */
     List<Map<String, Object>> datacomparison(Map<String, Object> parameters);
     List<TCm0318> getByCode(Map<String, Object> parameters);
+    //获取炼钢数据
+    public void  getDataAsLg();
+    //获取冶炼厂数据
+    public void getDataAsYlc();
+    //获取一高线数据
+    public void getDataAsYgx();
+    //获取二高线数据
+    public void getDataAsEgx();
+    //获取发电厂数据
+    public void getDataAsFdc();
+    //获取机焦厂数据
+    public void getDataAsJjc();
+    //获取污水车间数据
+    public void getDataAsWscj();
+
+    TCm0318 selectByparams(TCm0318 tCm0318);
+    //修改
+    int updateByparams(TCm0318 tCm0318);
 }

+ 103 - 3
src/main/java/com/steerinfo/ems/tcm0318/service/impl/TCm0318ServiceImpl.java

@@ -4,6 +4,7 @@ import com.github.pagehelper.util.StringUtil;
 import com.steerinfo.ems.tcm0318.mapper.TCm0318Mapper;
 import com.steerinfo.ems.tcm0318.model.TCm0318;
 import com.steerinfo.ems.tcm0318.service.ITCm0318Service;
+import com.steerinfo.ems.tcm0323.model.TCm0323;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.model.ICreatePO;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
@@ -31,9 +32,6 @@ import java.util.Map;
  */
 @Service(value = "tCm0318Service")
 public class TCm0318ServiceImpl extends BaseServiceImpl<TCm0318, String> implements ITCm0318Service {
-
-    @Autowired
-    IdGenerator idGenerator;
     @Autowired
     private TCm0318Mapper tCm0318Mapper;
 
@@ -79,4 +77,106 @@ public class TCm0318ServiceImpl extends BaseServiceImpl<TCm0318, String> impleme
         List<Map<String, Object>> rows = tCm0318Mapper.datacomparison(parameters);
         return rows;
     }
+
+    //获取炼钢数据
+    public void  getDataAsLg() {
+        List<TCm0318> dataAsLg = tCm0318Mapper.getDataAsLg();
+        for (TCm0318 tCm0318 : dataAsLg) {
+            TCm0318 tCm03181 = this.selectByparams(tCm0318);
+            if(tCm03181 != null ){
+                this.updateByparams(tCm0318);
+            }else {
+                tCm0318Mapper.insert(tCm0318);
+            }
+        }
+    }
+
+    @Override
+    public void getDataAsYlc() {
+        List<TCm0318> dataAsLg = tCm0318Mapper.getDataAsYlc();
+        for (TCm0318 tCm0318 : dataAsLg) {
+            TCm0318 tCm03181 = this.selectByparams(tCm0318);
+            if(tCm03181 != null ){
+                this.updateByparams(tCm0318);
+            }else {
+                tCm0318Mapper.insert(tCm0318);
+            }
+        }
+    }
+
+    @Override
+    public void getDataAsYgx() {
+        List<TCm0318> dataAsLg = tCm0318Mapper.getDataAsYgx();
+        for (TCm0318 tCm0318 : dataAsLg) {
+            TCm0318 tCm03181 = this.selectByparams(tCm0318);
+            if (tCm03181 != null ) {
+                this.updateByparams(tCm0318);
+            }else {
+                tCm0318Mapper.insert(tCm0318);
+            }
+        }
+    }
+
+    @Override
+    public void getDataAsEgx() {
+        List<TCm0318> dataAsLg = tCm0318Mapper.getDataAsEgx();
+        for (TCm0318 tCm0318 : dataAsLg) {
+            TCm0318 tCm03181 = this.selectByparams(tCm0318);
+            if (tCm03181 != null) {
+                this.updateByparams(tCm0318);
+            }else {
+                tCm0318Mapper.insert(tCm0318);
+            }
+        }
+    }
+
+    @Override
+    public void getDataAsFdc() {
+        List<TCm0318> dataAsLg = tCm0318Mapper.getDataAsFdc();
+        for (TCm0318 tCm0318 : dataAsLg) {
+            TCm0318 tCm03181 = this.selectByparams(tCm0318);
+            if (tCm03181 != null ) {
+                this.updateByparams(tCm0318);
+            } else {
+                tCm0318Mapper.insert(tCm0318);
+            }
+        }
+    }
+
+    @Override
+    public void getDataAsJjc() {
+        List<TCm0318> dataAsLg = tCm0318Mapper.getDataAsJjc();
+        for (TCm0318 tCm0318 : dataAsLg) {
+            TCm0318 tCm03181 = this.selectByparams(tCm0318);
+            if (tCm03181 != null ) {
+                this.updateByparams(tCm0318);
+            }else {
+                tCm0318Mapper.insert(tCm0318);
+            }
+        }
+    }
+
+    @Override
+    public void getDataAsWscj() {
+        List<TCm0318> dataAsLg = tCm0318Mapper.getDataAsWscj();
+        for (TCm0318 tCm0318 : dataAsLg) {
+            TCm0318 tCm03181 = this.selectByparams(tCm0318);
+            if(tCm03181 != null ){
+                this.updateByparams(tCm03181);
+            } else {
+                tCm0318Mapper.insert(tCm0318);
+            }
+        }
+    }
+
+    @Override
+    public TCm0318 selectByparams(TCm0318 model) {
+        return tCm0318Mapper.selectByparams(model);
+    }
+
+    @Override
+    public int updateByparams(TCm0318 tCm0318) {
+        return tCm0318Mapper.updateByparams(tCm0318);
+    }
+
 }

+ 15 - 26
src/main/java/com/steerinfo/ems/tcm0323/controller/TCm0323Controller.java

@@ -1,5 +1,6 @@
 package com.steerinfo.ems.tcm0323.controller;
 
+import com.steerinfo.ems.tcm0323.mapper.TCm0323Mapper;
 import com.steerinfo.ems.tcm0323.model.TCm0323;
 import com.steerinfo.ems.tcm0323.service.ITCm0323Service;
 import com.steerinfo.framework.controller.BaseRESTfulController;
@@ -38,6 +39,8 @@ public class TCm0323Controller extends BaseRESTfulController {
     @Autowired
     ITCm0323Service tCm0323Service;
 
+    @Autowired
+    TCm0323Mapper tCm0323Mapper;
     @ApiOperation(value="获取列表", notes="分页查询")
     @ApiImplicitParams({
         @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
@@ -86,37 +89,23 @@ public class TCm0323Controller extends BaseRESTfulController {
         @ApiImplicitParam(name = "tCm0323", value = "详细实体tCm0323", required = true, dataType = "TCm0323")
     })
     //@RequiresPermissions("tcm0323:update")
-    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult update(@PathVariable String id, @RequestBody TCm0323 model){
-        LOGGER.info("动力检测项目维护表更新前数据是" + tCm0323Service.getById(model.getItemcode()).toString());
-        model.setId(id);
-        TCm0323 tCm0323 = tCm0323Service.modify(model);
-        LOGGER.info("动力检测项目维护表更新后数据是" + tCm0323.toString());
-        return success(tCm0323);
+    @PutMapping(value = "/",produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@RequestBody TCm0323[] models){
+        for (TCm0323 model : models) {
+            tCm0323Mapper.updateByPrimaryKeySelective(model);
+        }
+        return success();
     }
 
-    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiOperation(value = "/",produces  = "application/json;charset=UTF-8")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("tcm0323:delete")
-    @DeleteMapping(value = "/{id}")
-    public RESTfulResult delete(@PathVariable String id){
-        String[] array = id.split(",");
-        if(array.length == 1){
-            LOGGER.info("动力检测项目要删除的数据是" + tCm0323Service.getById(id).toString());
-            tCm0323Service.delete(id);
-            return success();
-        }
-        else if(array.length > 1) {
-            for (int i = 0; i < array.length; i++) {
-                LOGGER.info("动力检测项目要删除的第" + (i + 1) + "条数据是" + tCm0323Service.getById(array[i]).toString());
-                tCm0323Service.delete(array[i]);
-            }
-            LOGGER.info("动力检测项目要删除数据共" + array.length + "条。");
-            return success();
-        }
-        else {
-            return failed(null, "请输入要删除的id");
+    @DeleteMapping(produces  = "application/json;charset=UTF-8")
+    public RESTfulResult delete(@RequestBody TCm0323[] models){
+        for (TCm0323 model : models) {
+            tCm0323Mapper.deleteByPrimaryKey(model.getItemcode());
         }
+        return success();
     }
 
     @ApiOperation(value="未选定的监测项目多选框", notes="(查询Unsitem的id和name")

+ 14 - 25
src/main/java/com/steerinfo/ems/tcm0325/controller/TCm0325Controller.java

@@ -2,6 +2,7 @@ package com.steerinfo.ems.tcm0325.controller;
 
 import com.steerinfo.auth.utils.JwtUtil;
 import com.steerinfo.ems.tcm0310.model.TCm0310;
+import com.steerinfo.ems.tcm0325.mapper.TCm0325Mapper;
 import com.steerinfo.ems.tcm0325.model.TCm0325;
 import com.steerinfo.ems.tcm0325.service.ITCm0325Service;
 import com.steerinfo.framework.controller.BaseRESTfulController;
@@ -28,6 +29,8 @@ public class TCm0325Controller extends BaseRESTfulController {
 
     @Autowired
     ITCm0325Service tCm0325Service;
+    @Autowired
+    TCm0325Mapper tCm0325Mapper;
 
     @ApiOperation(value="获取列表", notes="分页查询")
     @ApiImplicitParams({
@@ -83,37 +86,23 @@ public class TCm0325Controller extends BaseRESTfulController {
         @ApiImplicitParam(name = "tCm0325", value = "详细实体tCm0325", required = true, dataType = "TCm0325")
     })
     //@RequiresPermissions("trmunit:update")
-    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult update(@PathVariable String id, @RequestBody TCm0325 model){
-        LOGGER.info("动力系统表更新前数据是" + tCm0325Service.getById(model.getPowercode()).toString());
-        model.setPowercode(id);
-        TCm0325 tCm0325 = tCm0325Service.modify(model);
-        LOGGER.info("动力系统表更新后数据是" + tCm0325.toString());
-        return success(tCm0325);
+    @PutMapping(produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@RequestBody TCm0325[] models){
+        for (TCm0325 model : models) {
+            tCm0325Mapper.updateByPrimaryKeySelective(model);
+        }
+        return success(null,"修改成功");
     }
 
     @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("trmunit:delete")
-    @DeleteMapping(value = "/{id}")
-    public RESTfulResult delete(@PathVariable String id){
-        String[] array = id.split(",");
-        if(array.length == 1){
-            LOGGER.info("动力系统表要删除的数据是" + tCm0325Service.getById(id).toString());
-            tCm0325Service.delete(id);
-            return success();
-        }
-        else if(array.length > 1) {
-            for (int i = 0; i < array.length; i++) {
-                LOGGER.info("动力系统表要删除的第" + (i + 1) + "条数据是" + tCm0325Service.getById(array[i]).toString());
-                tCm0325Service.delete(array[i]);
-            }
-            LOGGER.info("动力系统表要删除数据共" + array.length + "条。");
-            return success();
-        }
-        else {
-            return failed(null, "请输入要删除的id");
+    @DeleteMapping(produces  = "application/json;charset=UTF-8")
+    public RESTfulResult delete(@RequestBody TCm0325[] models){
+        for (TCm0325 model : models) {
+            tCm0325Mapper.deleteByPrimaryKey(model.getPowercode());
         }
+        return success();
     }
 
     @ApiOperation(value = "获取 code 和 Name",notes = "获取下拉框得值")

+ 3 - 0
src/main/java/com/steerinfo/ems/tcm0325/mapper/TCm0325Mapper.xml

@@ -28,6 +28,9 @@
       <if test="usestate != null and usestate != ''">
         and USESTATE = #{usestate}
       </if>
+      <if test="sort != null">
+        and sort = #{sort}
+      </if>
     </where>
     order by SORT
   </select>

+ 42 - 18
src/main/java/com/steerinfo/ems/tcm0348/controller/TCm0348Controller.java

@@ -13,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
@@ -54,28 +55,51 @@ public class TCm0348Controller extends BaseRESTfulController {
         return success(list);
     }
 
-    @ApiOperation(value="动力监测数据录入", notes="根据url的id来指定更新对象,并根据传过来的tCm0348信息来更新详细信息")
-    @ApiImplicitParams({
-            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "tCm0348", value = "详细实体tCm0348", required = true, dataType = "TCm0348")
-    })
+//    @ApiOperation(value="动力监测数据录入", notes="根据url的id来指定更新对象,并根据传过来的tCm0348信息来更新详细信息")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+//            @ApiImplicitParam(name = "tCm0348", value = "详细实体tCm0348", required = true, dataType = "TCm0348")
+//    })
+
     //@RequiresPermissions("tcm0348:update")
-    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult update(@PathVariable String id, @RequestBody TCm0348 model) {
-        if(model.getMonitordate() != null && !"".equals(model.getMonitordate()) && model.getMonitordate().indexOf(model.getInsertTime()) == -1){
-            return failed(null, "监测日期错误,不能修改");
-        }
-        else if(model.getDatadate() != null && !"".equals(model.getDatadate()) && model.getDatadate().indexOf(model.getInsertTime()) == -1){
-            return failed(null, "监测时间错误,不能修改");
-        }else {
-            LOGGER.info("动力监测数据录入表修改前的数据是" + tCm0348Service.getById(id).toString());
-            model.setRecordid(id);
-            TCm0348 tCm0348 = tCm0348Service.modify(model);
-            LOGGER.info("动力监测数据录入表修改后的数据是" + tCm0348.toString());
-            return success(tCm0348);
+//    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+//    public RESTfulResult update(@PathVariable String id, @RequestBody TCm0348 model) {
+//        if(model.getMonitordate() != null && !"".equals(model.getMonitordate()) && model.getMonitordate().indexOf(model.getInsertTime()) == -1){
+//            return failed(null, "监测日期错误,不能修改");
+//        }
+//        else if(model.getDatadate() != null && !"".equals(model.getDatadate()) && model.getDatadate().indexOf(model.getInsertTime()) == -1){
+//            return failed(null, "监测时间错误,不能修改");
+//        }else {
+//            LOGGER.info("动力监测数据录入表修改前的数据是" + tCm0348Service.getById(id).toString());
+//            model.setRecordid(id);
+//            TCm0348 tCm0348 = tCm0348Service.modify(model);
+//            LOGGER.info("动力监测数据录入表修改后的数据是" + tCm0348.toString());
+//            return success(tCm0348);
+//        }
+//    }
+    @Transactional
+    @PutMapping(value = "/", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@RequestBody TCm0348[] models) {
+        for (TCm0348 model : models) {
+            if(model.getMonitoringvalue() == null || model.getMonitoringvalue().equals("")){
+                return  failed(null,"监测值不能为空");
+            }
+            if(model.getPowerpowersystemname() == null || model.getPowerpowersystemname().equals("")){
+                return  failed(null,"系统名称不能为空");
+            }
+            if(model.getPowermonitorname() == null || model.getPowermonitorname().equals("")){
+                return  failed(null,"监测点名称不能为空");
+            }
+            if(model.getSitem() == null || model.getPowermonitorname().equals("")){
+                return  failed(null,"监测项目不能为空");
+            }
+            tCm0348Service.updates(model);
         }
+        //System.out.println(models);
+        return success();
     }
 
+
     @ApiOperation(value="动力监测数据查询界面查询", notes="分页查询")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),

+ 4 - 0
src/main/java/com/steerinfo/ems/tcm0348/mapper/TCm0348Mapper.java

@@ -3,6 +3,7 @@ package com.steerinfo.ems.tcm0348.mapper;
 import com.steerinfo.ems.tcm0348.model.TCm0348;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -14,4 +15,7 @@ public interface TCm0348Mapper extends IBaseMapper<TCm0348, String> {
     String checkmaxdate(String planid);
     List<TCm0348> qualityassessment(Map<String, Object> parameters);
     List<TCm0348> datacomparison(Map<String, Object> parameters);
+    public List<TCm0348> getDateforbfhyd(@Param("bfhydzjdh") String bfhydzjdh);
+    //修改动力数据监测值
+    int updates(TCm0348 model);
 }

+ 81 - 8
src/main/java/com/steerinfo/ems/tcm0348/mapper/TCm0348Mapper.xml

@@ -4,7 +4,7 @@
   <resultMap id="BaseResultMap" type="com.steerinfo.ems.tcm0348.model.TCm0348">
     <id column="RECORDID" jdbcType="VARCHAR" property="recordid" />
     <result column="ANALYST" jdbcType="VARCHAR" property="analyst" />
-    <result column="DATADATE" jdbcType="VARCHAR" property="datadate" />
+    <result column="DATADATE" jdbcType="TIMESTAMP" property="datadate" />
     <result column="DATASTATE" jdbcType="VARCHAR" property="datastate" />
     <result column="MONITORDATE" jdbcType="VARCHAR" property="monitordate" />
     <result column="MONITORINGVALUE" jdbcType="DECIMAL" property="monitoringvalue" />
@@ -36,7 +36,7 @@
         ANALYST = #{analyst,jdbcType=VARCHAR},
       </if>
       <if test="datadate != null">
-        DATADATE = #{datadate,jdbcType=VARCHAR},
+        DATADATE = #{datadate,jdbcType=TIMESTAMP},
       </if>
       <if test="datastate != null">
         DATASTATE = #{datastate,jdbcType=VARCHAR},
@@ -62,7 +62,7 @@
         ANALYST = #{analyst,jdbcType=VARCHAR},
       </if>
       <if test="datadate != null">
-        DATADATE = #{datadate,jdbcType=VARCHAR},
+        DATADATE = #{datadate,jdbcType=TIMESTAMP},
       </if>
       <if test="datastate != null">
         DATASTATE = #{datastate,jdbcType=VARCHAR},
@@ -108,25 +108,31 @@
         and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
       </if>
       <if test="batchno != null and batchno != ''">
-        and BATCHNO = #{batchno, jdbcType=VARCHAR}
+        and BATCHNO like '%${batchno}%'
       </if>
       <if test="timegranid != null and timegranid != ''">
         and TIMEGRANID = #{timegranid, jdbcType=VARCHAR}
       </if>
-      <if test="monitordate != null and monitordate != ''">
-        and instr(MONITORDATE, #{monitordate, jdbcType=VARCHAR}) &gt; 0
+      <if test="sitem != null and sitem != ''">
+        and SITEM = #{sitem, jdbcType=VARCHAR}
+      </if>
+      <if test="startTime != null and startTime != '' and endTime != null and endTime !='' ">
+        and
+        to_date(MONITORDATE,'yyyymmdd hh24:mi:ss')
+        between to_date(#{startTime}, 'yyyy-mm-dd') and to_date(#{endTime}, 'yyyy-mm-dd')
       </if>
     </where>
   </select>
 
   <insert id="batchInsert" parameterType="java.util.List">
     insert into T_CM_0348
-    (RECORDID, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO, TIMEGRANID, INSERT_TIME, MONITORDATE)
+    (RECORDID, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO, TIMEGRANID, INSERT_TIME, MONITORDATE,MONITORINGVALUE,ANALYST,DATADATE)
     ( <foreach collection="list" item="item" separator="union all">
     select
     #{item.recordid, jdbcType=DECIMAL}, #{item.planid, jdbcType=VARCHAR}, #{item.powerdetecdepartment, jdbcType=VARCHAR}, #{item.powermonitorname, jdbcType=VARCHAR},
     #{item.sitem, jdbcType=VARCHAR}, #{item.powersystemname, jdbcType=VARCHAR}, #{item.unit, jdbcType=VARCHAR}, #{item.batchno, jdbcType=VARCHAR},
-    #{item.timegranid, jdbcType=VARCHAR}, #{item.inserttime, jdbcType=VARCHAR}, #{item.monitordate, jdbcType=VARCHAR}
+    #{item.timegranid, jdbcType=VARCHAR}, #{item.insertTime, jdbcType=VARCHAR}, #{item.monitordate, jdbcType=VARCHAR},#{item.monitoringvalue, jdbcType=DECIMAL},
+    #{item.analyst, jdbcType=VARCHAR}, #{item.datadate,jdbcType=TIMESTAMP}
     from dual
   </foreach> )
   </insert>
@@ -899,4 +905,71 @@
     </foreach>
   </delete>
   -->
+
+  <select id="getDateforbfhyd" parameterType="java.lang.String" resultMap="BaseResultMap">
+      select 'QualityInspectionCenter' as POWERDETECDEPARTMENT,
+         t2.powercode as POWERSYSTEMNAME,
+         t1.POWERMONITORCODE as POWERMONITORNAME ,
+         t.ITEMNAME as SITEM,
+         BFHYD_HYRQ as MONITORDATE,
+         t.BFHYD_ZJDH as BATCHNO,
+         t.MONITORINGVALUE,
+         t3.unit as UNIT,
+         t.TS as DATADATE,
+         t.BFHYD_ZJR as ANALYST
+       from BFHYD unpivot(MONITORINGVALUE for ITEMNAME
+           in(BFHYD_01,
+              BFHYD_02,
+              BFHYD_03,
+              BFHYD_04,
+              BFHYD_05,
+              BFHYD_06,
+              BFHYD_07,
+              BFHYD_08,
+              BFHYD_09,
+              BFHYD_10,
+              BFHYD_11,
+              BFHYD_12)) t
+    left join t_cm_0325 t2
+      on t.BFHYD_27 = t2.powername
+    left join t_cm_0323 t3
+      on t.ITEMNAME = t3.itemcode
+      left join t_cm_0316 t1
+    on t.BFHYD_26 = t1.powermonitorname  and t2.powercode = t1.powersystemname
+   where t.BFHYD_ZJDH = #{bfhydzjdh}
+  </select>
+  <update id="updates" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
+    update t_cm_0348
+    <set>
+      <if test="monitoringvalue != null ">
+        MONITORINGVALUE = #{monitoringvalue},
+      </if>
+      <if test="note != null and note != ''">
+        NOTE = #{note}
+      </if>
+    </set>
+    <where>
+      <if test="powermonitorname != null and powermonitorname != ''">
+        and   POWERMONITORNAME = #{powermonitorname}
+      </if>
+      <if test="batchno != null and  batchno != ''">
+        and  BATCHNO = #{batchno}
+      </if>
+      <if test="sitem != null and sitem != ''">
+        and SITEM = #{sitem}
+      </if>
+      <if test="powersystemname != null and powersystemname != ''">
+        and POWERSYSTEMNAME = #{powersystemname}
+      </if>
+      <if test="monitordate != null and monitordate != ''">
+        and MONITORDATE = #{monitordate}
+      </if>
+      <if test="unit != null and unit != ''">
+        and UNIT = #{unit}
+      </if>
+      <if test="analyst != null and analyst != ''">
+        and ANALYST = #{analyst}
+      </if>
+    </where>
+  </update>
 </mapper>

+ 14 - 4
src/main/java/com/steerinfo/ems/tcm0348/model/TCm0348.java

@@ -2,8 +2,10 @@ package com.steerinfo.ems.tcm0348.model;
 
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModelProperty;
+import oracle.sql.DATE;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 public class TCm0348 implements IBasePO<String> {
     /**
@@ -22,7 +24,7 @@ public class TCm0348 implements IBasePO<String> {
      * 上传日期(DATADATE,VARCHAR,40)
      */
     @ApiModelProperty(value="上传日期",required=true)
-    private String datadate;
+    private Date datadate;
 
     /**
      * 数据状态(DATASTATE,VARCHAR,400)
@@ -84,6 +86,14 @@ public class TCm0348 implements IBasePO<String> {
     @ApiModelProperty(value="监测项目名称",required=true)
     private String sitem;
 
+    public String getPowersystemname() {
+        return powersystemname;
+    }
+
+    public void setPowersystemname(String powersystemname) {
+        this.powersystemname = powersystemname;
+    }
+
     /**
      * 批次号(BATCHNO,VARCHAR,40)
      */
@@ -178,12 +188,12 @@ public class TCm0348 implements IBasePO<String> {
         this.analyst = analyst == null ? null : analyst.trim();
     }
 
-    public String getDatadate() {
+    public Date getDatadate() {
         return datadate;
     }
 
-    public void setDatadate(String datadate) {
-        this.datadate = datadate == null ? null : datadate.trim();
+    public void setDatadate(Date datadate) {
+        this.datadate = datadate;
     }
 
     public String getDatastate() {

+ 8 - 0
src/main/java/com/steerinfo/ems/tcm0348/service/ITCm0348Service.java

@@ -3,7 +3,10 @@ package com.steerinfo.ems.tcm0348.service;
 import com.steerinfo.ems.tcm0348.model.TCm0348;
 import com.steerinfo.framework.service.IBaseService;
 import com.steerinfo.framework.service.pagehelper.PageList;
+import org.apache.ibatis.annotations.Param;
 
+import java.text.ParseException;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -24,4 +27,9 @@ public interface ITCm0348Service extends IBaseService<TCm0348, String>{
     PageList<TCm0348> dataQuery(Map<String, Object> parameters, Integer pageNum, Integer pageSize);
     PageList<TCm0348> qualityassessment(Map<String, Object> parameters, Integer pageNum, Integer pageSize);
     PageList<TCm0348> datacomparison(Map<String, Object> parameters, Integer pageNum, Integer pageSize);
+    public List<TCm0348> getDateforbfhyd(@Param("bfhydzjdh") String bfhydzjdh);
+    //获取最新的动力质量数据
+    public void getDate() throws ParseException;
+    //修改动力数据监测值
+    int updates(TCm0348 model);
 }

+ 36 - 0
src/main/java/com/steerinfo/ems/tcm0348/service/impl/TCm0348ServiceImpl.java

@@ -1,6 +1,8 @@
 package com.steerinfo.ems.tcm0348.service.impl;
 
 import com.steerinfo.ems.Utils.DateUtils;
+import com.steerinfo.ems.bfhyd.model.Bfhyd;
+import com.steerinfo.ems.bfhyd.service.IBfhydService;
 import com.steerinfo.ems.tcm0348.mapper.TCm0348Mapper;
 import com.steerinfo.ems.tcm0348.model.TCm0348;
 import com.steerinfo.ems.tcm0348.service.ITCm0348Service;
@@ -13,6 +15,10 @@ import com.steerinfo.framework.utils.misc.IdGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -37,6 +43,9 @@ public class TCm0348ServiceImpl extends BaseServiceImpl<TCm0348, String> impleme
     @Autowired
     private TCm0348Mapper tCm0348Mapper;
 
+    @Autowired
+    private IBfhydService bfhydService;
+
     @Override
     protected IBaseMapper<TCm0348, String> getMapper() {
         return tCm0348Mapper;
@@ -68,4 +77,31 @@ public class TCm0348ServiceImpl extends BaseServiceImpl<TCm0348, String> impleme
         PageList pageInfo = new PageList(rows);
         return pageInfo;
     }
+
+    @Override
+    public List<TCm0348> getDateforbfhyd(String bfhydzjdh) {
+        return tCm0348Mapper.getDateforbfhyd(bfhydzjdh);
+    }
+
+    @Override
+    public void getDate() throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date dt = sdf.parse(DateUtils.dateStr(new Date(),"yyyy-MM-dd"));
+        Calendar rightNow = Calendar.getInstance();
+        rightNow.setTime(dt);
+        rightNow.add(Calendar.DAY_OF_MONTH, -3);
+        Date dt1 = rightNow.getTime();
+        String reStr = sdf.format(dt1);
+        List<Bfhyd> bfhyds = bfhydService.getnewNo(reStr);
+         if (bfhyds.size()>0) {
+             for (Bfhyd bfhyd : bfhyds) {
+                 List<TCm0348> dateforbfhyd = this.getDateforbfhyd(bfhyd.getBfhydZjdh());
+                 tCm0348Mapper.batchInsert(dateforbfhyd);
+             }
+         }
+        }
+    @Override
+    public int updates(TCm0348 model) {
+        return tCm0348Mapper.updates(model);
+    }
 }

+ 2 - 6
src/main/java/com/steerinfo/ems/trmworkprocmaterialvalue/mapper/TRmWorkprocMaterialValueMapper.xml

@@ -174,9 +174,7 @@
         APPORTVALUE,
         UCVALUE,
         SUMUCVALUE,
-        BZ,
-        USERID,
-        UPDATETIME
+        BZ
       )
       VALUES
         (
@@ -191,9 +189,7 @@
           #{qty,jdbcType=DECIMAL},
           0,
           0,
-          'MES' || '-' || to_char(SYSDATE,'yyyy/MM/dd HH24:mi:ss') || ' fid:' || #{fid,jdbcType=VARCHAR},
-          #{userid,jdbcType=VARCHAR},
-          #{updatetime,jdbcType=VARCHAR}
+          'MES' || '-' || to_char(SYSDATE,'yyyy/MM/dd HH24:mi:ss') || ' fid:' || #{fid,jdbcType=VARCHAR}
         )
   </insert>
 

+ 1 - 1
src/main/java/com/steerinfo/ems/trmworkprocproductvalue/service/impl/TRmWorkprocProductValueServiceImpl.java

@@ -367,7 +367,7 @@ public class TRmWorkprocProductValueServiceImpl extends BaseServiceImpl<TRmWorkp
 					insertObj.put("itemtype", "R");
 					insertObj.put("qty", swapfile.getQty());
 					insertObj.put("fid", swapfile.getFid());
-					insertObj.put("userid", "系统");
+					insertObj.put("userid", "1");
 					insertObj.put("updatetime", DateUtils.dateStr(new Date(), "yyyy-MM-dd HH:mm:ss"));
 					try {
 						int upSize = tRmWorkprocProductValueMapper.updateValue(insertObj);