ソースを参照

Merge branch 'master' of https://git.steerinfo.com/XTEMS/xt-ems-api

lirl 3 年 前
コミット
370910ef84
21 ファイル変更1537 行追加1154 行削除
  1. 14 19
      src/main/java/com/steerinfo/auth/shiro/jwt/JwtStatelessAccessControlFilter.java
  2. 82 0
      src/main/java/com/steerinfo/ems/Utils/MosaicUtils.java
  3. 2 1
      src/main/java/com/steerinfo/ems/Utils/StrUtils.java
  4. 584 531
      src/main/java/com/steerinfo/ems/dzmaterialsf/mapper/DzMaterialSfMapper.xml
  5. 327 298
      src/main/java/com/steerinfo/ems/dzmaterialsf/model/DzMaterialSf.java
  6. 87 86
      src/main/java/com/steerinfo/ems/dzmaterialsf/service/impl/DzMaterialSfServiceImpl.java
  7. 6 10
      src/main/java/com/steerinfo/ems/emscordas/controller/EmsCordasController.java
  8. 1 0
      src/main/java/com/steerinfo/ems/emscordas/service/impl/EmsCordasServiceImpl.java
  9. 31 7
      src/main/java/com/steerinfo/ems/emsscqklg/mapper/EmsScqkLgMapper.xml
  10. 19 0
      src/main/java/com/steerinfo/ems/emsscqklg/mapper/LgReal.xml
  11. 14 0
      src/main/java/com/steerinfo/ems/emsscqklg/mapper/LgRealMapper.java
  12. 15 0
      src/main/java/com/steerinfo/ems/emsscqklg/model/EmsScqkLg.java
  13. 54 0
      src/main/java/com/steerinfo/ems/emsscqklg/model/LgReal.java
  14. 31 27
      src/main/java/com/steerinfo/ems/emsscqklg/service/EmsLgReportService.java
  15. 15 0
      src/main/java/com/steerinfo/ems/emsscqklg/service/ILgRealService.java
  16. 60 61
      src/main/java/com/steerinfo/ems/emsscqklg/service/impl/EmsScqkLgServiceImpl.java
  17. 62 0
      src/main/java/com/steerinfo/ems/emsscqklg/service/impl/LgRealImpl.java
  18. 109 109
      src/main/java/com/steerinfo/ems/rttable/service/impl/RttableServiceImpl.java
  19. 6 1
      src/main/java/com/steerinfo/ems/trmcalpoint/controller/TRmCalpointController.java
  20. 17 3
      src/main/java/com/steerinfo/task/SpringCronTask.java
  21. 1 1
      src/main/resources/bootstrap.yml

+ 14 - 19
src/main/java/com/steerinfo/auth/shiro/jwt/JwtStatelessAccessControlFilter.java

@@ -1,19 +1,5 @@
 package com.steerinfo.auth.shiro.jwt;
 
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.shiro.authc.AuthenticationException;
-import org.apache.shiro.authc.UnknownAccountException;
-import org.apache.shiro.web.filter.AccessControlFilter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
-
 import com.steerinfo.framework.cache.Caches;
 import com.steerinfo.framework.constant.ShiroConstant;
 import com.steerinfo.framework.exception.ShiroJwtException;
@@ -22,7 +8,16 @@ import com.steerinfo.framework.user.UserPayload;
 import com.steerinfo.framework.utils.jwt.JwtUtils;
 import com.steerinfo.framework.utils.text.MD5Utils;
 import com.steerinfo.framework.utils.web.HttpUtils;
-import com.steerinfo.auth.shiro.token.StatelessToken;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.UnknownAccountException;
+import org.apache.shiro.web.filter.AccessControlFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * 
@@ -105,10 +100,10 @@ public class JwtStatelessAccessControlFilter extends AccessControlFilter {
             } catch (ShiroJwtException e){
                 throw new AuthenticationException(e.getMessage());
             }
-            // 2、生成无状态Token
-            StatelessToken token = new StatelessToken(jwt, request.getParameterMap());
-            // 3、委托给Realm进行登录
-            getSubject(request, response).login(token);
+            //// 2、生成无状态Token
+            //StatelessToken token = new StatelessToken(jwt, request.getParameterMap());
+            //// 3、委托给Realm进行登录
+            //getSubject(request, response).login(token);
         } catch (UnknownAccountException e){
             logger.debug(e.getMessage());
             return false;

+ 82 - 0
src/main/java/com/steerinfo/ems/Utils/MosaicUtils.java

@@ -0,0 +1,82 @@
+package com.steerinfo.ems.Utils;
+
+import com.client.MswebserviceStub;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.rmi.RemoteException;
+
+/**
+ * @author Shadow
+ * @create 2021-10-27 22:23
+ * @project xt-ems-api-new
+ */
+public class MosaicUtils {
+    private static final Logger logger = LoggerFactory.getLogger(MosaicUtils.class);
+
+    static MswebserviceStub.UserInfo userInfo = new MswebserviceStub.UserInfo();
+
+    public static void SetOpenConnSample(MswebserviceStub stub) {
+        try {
+            userInfo = new MswebserviceStub.UserInfo();
+            userInfo.setMdbName("scada");
+            userInfo.setMdbInstance("master");
+            userInfo.setComText("");
+            userInfo.setMIP("");
+            userInfo.setMUserID("");
+            userInfo.setMUserName("mosaic");
+            userInfo.setMUserPass("mosaic");
+            MswebserviceStub.WSConnectOpen openReq = new MswebserviceStub.WSConnectOpen();
+            MswebserviceStub.WSConnectOpenResponse openResp = null;
+            // Open
+            openReq.setUserInfo(userInfo);
+
+            openResp = stub.wSConnectOpen(openReq);
+            logger.info("打开mosaic链接成功");
+            // Save UserID
+            userInfo.setMUserID(openResp.getId());
+
+        } catch (RemoteException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            logger.info("打开mosaic链接失败");
+        }
+
+    }
+
+    // 更新点的值
+    public static void SetUpdateValue(MswebserviceStub stub, String sql) {
+        // 0x0002:5365:2e
+        MswebserviceStub.DataResult queryData = new MswebserviceStub.DataResult();
+
+        try {
+
+            //String sql = "update Ana set(Eng,User)=(100,0x0002:5365:2e) where AltId='PUMP1_SPEED' ";
+            // Dig表为 update Dig set(Cs,User)=(1,0x0002:5365:2e) update Ana set Eng='1812482' where Equip='0x06f4:0bfe:1e' AND Quantity='0x006a:489c:22'
+
+            userInfo.setComText(sql);
+            MswebserviceStub.WSQueryExecute query = new MswebserviceStub.WSQueryExecute();
+            query.setUserInfo(userInfo);
+            queryData = stub.wSQueryExecute(query);
+            //logger.info(queryData.getData());
+
+        } catch (RemoteException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    // 关闭mosaic链接
+    public static void SetCloseConnSample(MswebserviceStub stub) {
+        MswebserviceStub.WSConnectClose closeReq = new MswebserviceStub.WSConnectClose();
+        closeReq.setUserInfo(userInfo);
+        try {
+            stub.wSConnectClose(closeReq);
+            userInfo = null;
+            logger.info("关闭mosaic链接成功");
+        } catch (RemoteException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+}

+ 2 - 1
src/main/java/com/steerinfo/ems/Utils/StrUtils.java

@@ -11,13 +11,14 @@ import java.util.regex.Pattern;
  *
  */
 public class StrUtils {
+    private static final Pattern pattern = Pattern.compile("[0-9]*");
     /**
      * 判断字符串是否为正整数或小数
      * @param str
      * @return
      */
     public static boolean isNumeric(String str) {
-        Pattern pattern = Pattern.compile("[0-9]*");
+
         if (str.indexOf(".") > 0) {//判断是否有小数点
             if (str.indexOf(".") == str.lastIndexOf(".") && str.split("\\.").length == 2) { //判断是否只有一个小数点
                 return pattern.matcher(str.replace(".", "")).matches();

+ 584 - 531
src/main/java/com/steerinfo/ems/dzmaterialsf/mapper/DzMaterialSfMapper.xml

@@ -1,532 +1,585 @@
-<?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.dzmaterialsf.mapper.DzMaterialSfMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
-    <id column="GBSJ" jdbcType="VARCHAR" property="gbsj" />
-    <id column="CINVCCODE" jdbcType="VARCHAR" property="cinvccode" />
-    <id column="CINVCODE" jdbcType="VARCHAR" property="cinvcode" />
-    <id column="CWHCODE" jdbcType="VARCHAR" property="cwhcode" />
-    <result column="CINVCNAME" jdbcType="VARCHAR" property="cinvcname" />
-    <result column="CINVNAME" jdbcType="VARCHAR" property="cinvname" />
-    <result column="CINVSTD" jdbcType="VARCHAR" property="cinvstd" />
-    <result column="CWHNAME" jdbcType="VARCHAR" property="cwhname" />
-    <result column="MZ" jdbcType="DECIMAL" property="mz" />
-    <result column="PZ" jdbcType="DECIMAL" property="pz" />
-    <result column="JZ" jdbcType="DECIMAL" property="jz" />
-    <result column="TAB" jdbcType="VARCHAR" property="tab" />
-    <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
-    <result column="CREATETIME" jdbcType="VARCHAR" property="createtime" />
-    <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
-    <result column="UPDATETIME" jdbcType="VARCHAR" property="updatetime" />
-    <result column="READTIME" jdbcType="VARCHAR" property="readtime" />
-  </resultMap>
-  <sql id="columns">
-    GBSJ, CINVCCODE, CINVCODE, CWHCODE, CINVCNAME, CINVNAME, CINVSTD, CWHNAME, MZ, PZ, 
-    JZ, TAB, CREATEMAN, CREATETIME, UPDATEMAN, UPDATETIME, READTIME
-  </sql>
-  <sql id="columns_alias">
-    t.GBSJ, t.CINVCCODE, t.CINVCODE, t.CWHCODE, t.CINVCNAME, t.CINVNAME, t.CINVSTD, t.CWHNAME, 
-    t.MZ, t.PZ, t.JZ, t.TAB, t.CREATEMAN, t.CREATETIME, t.UPDATEMAN, t.UPDATETIME, t.READTIME
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns"/> FROM DZ_MATERIAL_SF
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM DZ_MATERIAL_SF t
-  </sql>
-  <sql id="where">
-    <where> 
-      <if test="gbsj != null and gbsj != ''">
-        and GBSJ = #{gbsj}
-      </if>
-      <if test="cinvccode != null and cinvccode != ''">
-        and CINVCCODE = #{cinvccode}
-      </if>
-      <if test="cinvcode != null and cinvcode != ''">
-        and CINVCODE = #{cinvcode}
-      </if>
-      <if test="cwhcode != null and cwhcode != ''">
-        and CWHCODE = #{cwhcode}
-      </if>
-      <if test="cinvcname != null and cinvcname != ''">
-        and CINVCNAME = #{cinvcname}
-      </if>
-      <if test="cinvname != null and cinvname != ''">
-        and CINVNAME = #{cinvname}
-      </if>
-      <if test="cinvstd != null and cinvstd != ''">
-        and CINVSTD = #{cinvstd}
-      </if>
-      <if test="cwhname != null and cwhname != ''">
-        and CWHNAME = #{cwhname}
-      </if>
-      <if test="mz != null">
-        and MZ = #{mz}
-      </if>
-      <if test="pz != null">
-        and PZ = #{pz}
-      </if>
-      <if test="jz != null">
-        and JZ = #{jz}
-      </if>
-      <if test="tab != null and tab != ''">
-        and TAB = #{tab}
-      </if>
-      <if test="createman != null and createman != ''">
-        and CREATEMAN = #{createman}
-      </if>
-      <if test="createtime != null and createtime != ''">
-        and CREATETIME = #{createtime}
-      </if>
-      <if test="updateman != null and updateman != ''">
-        and UPDATEMAN = #{updateman}
-      </if>
-      <if test="updatetime != null and updatetime != ''">
-        and UPDATETIME = #{updatetime}
-      </if>
-      <if test="readtime != null and readtime != ''">
-        and READTIME = #{readtime}
-      </if>
-    </where>
-  </sql>
-  <sql id="whereLike">
-    <where> 
-      <if test="gbsj != null and gbsj != ''">
-        and GBSJ LIKE '%${gbsj}%'
-      </if>
-      <if test="cinvccode != null and cinvccode != ''">
-        and CINVCCODE LIKE '%${cinvccode}%'
-      </if>
-      <if test="cinvcode != null and cinvcode != ''">
-        and CINVCODE LIKE '%${cinvcode}%'
-      </if>
-      <if test="cwhcode != null and cwhcode != ''">
-        and CWHCODE LIKE '%${cwhcode}%'
-      </if>
-      <if test="cinvcname != null and cinvcname != ''">
-        and CINVCNAME LIKE '%${cinvcname}%'
-      </if>
-      <if test="cinvname != null and cinvname != ''">
-        and CINVNAME LIKE '%${cinvname}%'
-      </if>
-      <if test="cinvstd != null and cinvstd != ''">
-        and CINVSTD LIKE '%${cinvstd}%'
-      </if>
-      <if test="cwhname != null and cwhname != ''">
-        and CWHNAME LIKE '%${cwhname}%'
-      </if>
-      <if test="mz != null">
-        and MZ = #{mz}
-      </if>
-      <if test="pz != null">
-        and PZ = #{pz}
-      </if>
-      <if test="jz != null">
-        and JZ = #{jz}
-      </if>
-      <if test="tab != null and tab != ''">
-        and TAB LIKE '%${tab}%'
-      </if>
-      <if test="createman != null and createman != ''">
-        and CREATEMAN LIKE '%${createman}%'
-      </if>
-      <if test="createtime != null and createtime != ''">
-        and CREATETIME LIKE '%${createtime}%'
-      </if>
-      <if test="updateman != null and updateman != ''">
-        and UPDATEMAN LIKE '%${updateman}%'
-      </if>
-      <if test="updatetime != null and updatetime != ''">
-        and UPDATETIME LIKE '%${updatetime}%'
-      </if>
-      <if test="readtime != null and readtime != ''">
-        and READTIME LIKE '%${readtime}%'
-      </if>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="map">
-    delete from DZ_MATERIAL_SF
-    where GBSJ = #{gbsj,jdbcType=VARCHAR}
-      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
-      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
-      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from DZ_MATERIAL_SF
-    where 1!=1 
-      <if test="cinvccode != null and cinvccode != ''">
-        or CINVCCODE = #{cinvccode}
-      </if>
-      <if test="cinvcode != null and cinvcode != ''">
-        or CINVCODE = #{cinvcode}
-      </if>
-      <if test="cwhcode != null and cwhcode != ''">
-        or CWHCODE = #{cwhcode}
-      </if>
-      <if test="cinvcname != null and cinvcname != ''">
-        or CINVCNAME = #{cinvcname}
-      </if>
-      <if test="cinvname != null and cinvname != ''">
-        or CINVNAME = #{cinvname}
-      </if>
-      <if test="cinvstd != null and cinvstd != ''">
-        or CINVSTD = #{cinvstd}
-      </if>
-      <if test="cwhname != null and cwhname != ''">
-        or CWHNAME = #{cwhname}
-      </if>
-      <if test="mz != null">
-        or MZ = #{mz}
-      </if>
-      <if test="pz != null">
-        or PZ = #{pz}
-      </if>
-      <if test="jz != null">
-        or JZ = #{jz}
-      </if>
-      <if test="tab != null and tab != ''">
-        or TAB = #{tab}
-      </if>
-      <if test="createman != null and createman != ''">
-        or CREATEMAN = #{createman}
-      </if>
-      <if test="createtime != null and createtime != ''">
-        or CREATETIME = #{createtime}
-      </if>
-      <if test="updateman != null and updateman != ''">
-        or UPDATEMAN = #{updateman}
-      </if>
-      <if test="updatetime != null and updatetime != ''">
-        or UPDATETIME = #{updatetime}
-      </if>
-      <if test="readtime != null and readtime != ''">
-        or READTIME = #{readtime}
-      </if>
-  </delete>
-  <insert id="insert" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
-    insert into DZ_MATERIAL_SF (GBSJ, CINVCCODE, CINVCODE, 
-      CWHCODE, CINVCNAME, CINVNAME, 
-      CINVSTD, CWHNAME, MZ, 
-      PZ, JZ, TAB, CREATEMAN, 
-      CREATETIME, UPDATEMAN, UPDATETIME, 
-      READTIME)
-    values (#{gbsj,jdbcType=VARCHAR}, #{cinvccode,jdbcType=VARCHAR}, #{cinvcode,jdbcType=VARCHAR}, 
-      #{cwhcode,jdbcType=VARCHAR}, #{cinvcname,jdbcType=VARCHAR}, #{cinvname,jdbcType=VARCHAR}, 
-      #{cinvstd,jdbcType=VARCHAR}, #{cwhname,jdbcType=VARCHAR}, #{mz,jdbcType=DECIMAL}, 
-      #{pz,jdbcType=DECIMAL}, #{jz,jdbcType=DECIMAL}, #{tab,jdbcType=VARCHAR}, #{createman,jdbcType=VARCHAR}, 
-      #{createtime,jdbcType=VARCHAR}, #{updateman,jdbcType=VARCHAR}, #{updatetime,jdbcType=VARCHAR}, 
-      #{readtime,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
-    insert into DZ_MATERIAL_SF
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="gbsj != null">
-        GBSJ,
-      </if>
-      <if test="cinvccode != null">
-        CINVCCODE,
-      </if>
-      <if test="cinvcode != null">
-        CINVCODE,
-      </if>
-      <if test="cwhcode != null">
-        CWHCODE,
-      </if>
-      <if test="cinvcname != null">
-        CINVCNAME,
-      </if>
-      <if test="cinvname != null">
-        CINVNAME,
-      </if>
-      <if test="cinvstd != null">
-        CINVSTD,
-      </if>
-      <if test="cwhname != null">
-        CWHNAME,
-      </if>
-      <if test="mz != null">
-        MZ,
-      </if>
-      <if test="pz != null">
-        PZ,
-      </if>
-      <if test="jz != null">
-        JZ,
-      </if>
-      <if test="tab != null">
-        TAB,
-      </if>
-      <if test="createman != null">
-        CREATEMAN,
-      </if>
-      <if test="createtime != null">
-        CREATETIME,
-      </if>
-      <if test="updateman != null">
-        UPDATEMAN,
-      </if>
-      <if test="updatetime != null">
-        UPDATETIME,
-      </if>
-      <if test="readtime != null">
-        READTIME,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="gbsj != null">
-        #{gbsj,jdbcType=VARCHAR},
-      </if>
-      <if test="cinvccode != null">
-        #{cinvccode,jdbcType=VARCHAR},
-      </if>
-      <if test="cinvcode != null">
-        #{cinvcode,jdbcType=VARCHAR},
-      </if>
-      <if test="cwhcode != null">
-        #{cwhcode,jdbcType=VARCHAR},
-      </if>
-      <if test="cinvcname != null">
-        #{cinvcname,jdbcType=VARCHAR},
-      </if>
-      <if test="cinvname != null">
-        #{cinvname,jdbcType=VARCHAR},
-      </if>
-      <if test="cinvstd != null">
-        #{cinvstd,jdbcType=VARCHAR},
-      </if>
-      <if test="cwhname != null">
-        #{cwhname,jdbcType=VARCHAR},
-      </if>
-      <if test="mz != null">
-        #{mz,jdbcType=DECIMAL},
-      </if>
-      <if test="pz != null">
-        #{pz,jdbcType=DECIMAL},
-      </if>
-      <if test="jz != null">
-        #{jz,jdbcType=DECIMAL},
-      </if>
-      <if test="tab != null">
-        #{tab,jdbcType=VARCHAR},
-      </if>
-      <if test="createman != null">
-        #{createman,jdbcType=VARCHAR},
-      </if>
-      <if test="createtime != null">
-        #{createtime,jdbcType=VARCHAR},
-      </if>
-      <if test="updateman != null">
-        #{updateman,jdbcType=VARCHAR},
-      </if>
-      <if test="updatetime != null">
-        #{updatetime,jdbcType=VARCHAR},
-      </if>
-      <if test="readtime != null">
-        #{readtime,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
-    update DZ_MATERIAL_SF
-    set CINVCNAME = #{cinvcname,jdbcType=VARCHAR},
-      CINVNAME = #{cinvname,jdbcType=VARCHAR},
-      CINVSTD = #{cinvstd,jdbcType=VARCHAR},
-      CWHNAME = #{cwhname,jdbcType=VARCHAR},
-      MZ = #{mz,jdbcType=DECIMAL},
-      PZ = #{pz,jdbcType=DECIMAL},
-      JZ = #{jz,jdbcType=DECIMAL},
-      TAB = #{tab,jdbcType=VARCHAR},
-      CREATEMAN = #{createman,jdbcType=VARCHAR},
-      CREATETIME = #{createtime,jdbcType=VARCHAR},
-      UPDATEMAN = #{updateman,jdbcType=VARCHAR},
-      UPDATETIME = #{updatetime,jdbcType=VARCHAR},
-      READTIME = #{readtime,jdbcType=VARCHAR}
-    where GBSJ = #{gbsj,jdbcType=VARCHAR}
-      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
-      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
-      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
-    update DZ_MATERIAL_SF
-    <set>
-      <if test="cinvcname != null">
-        CINVCNAME = #{cinvcname,jdbcType=VARCHAR},
-      </if>
-      <if test="cinvname != null">
-        CINVNAME = #{cinvname,jdbcType=VARCHAR},
-      </if>
-      <if test="cinvstd != null">
-        CINVSTD = #{cinvstd,jdbcType=VARCHAR},
-      </if>
-      <if test="cwhname != null">
-        CWHNAME = #{cwhname,jdbcType=VARCHAR},
-      </if>
-      <if test="mz != null">
-        MZ = #{mz,jdbcType=DECIMAL},
-      </if>
-      <if test="pz != null">
-        PZ = #{pz,jdbcType=DECIMAL},
-      </if>
-      <if test="jz != null">
-        JZ = #{jz,jdbcType=DECIMAL},
-      </if>
-      <if test="tab != null">
-        TAB = #{tab,jdbcType=VARCHAR},
-      </if>
-      <if test="createman != null">
-        CREATEMAN = #{createman,jdbcType=VARCHAR},
-      </if>
-      <if test="createtime != null">
-        CREATETIME = #{createtime,jdbcType=VARCHAR},
-      </if>
-      <if test="updateman != null">
-        UPDATEMAN = #{updateman,jdbcType=VARCHAR},
-      </if>
-      <if test="updatetime != null">
-        UPDATETIME = #{updatetime,jdbcType=VARCHAR},
-      </if>
-      <if test="readtime != null">
-        READTIME = #{readtime,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where GBSJ = #{gbsj,jdbcType=VARCHAR}
-      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
-      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
-      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where GBSJ = #{gbsj,jdbcType=VARCHAR}
-      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
-      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
-      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
-      and TAB = #{tab,jdbcType=VARCHAR}
-  </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 DZ_MATERIAL_SF 
-      (GBSJ, 
-      CINVCCODE, CINVCODE, CWHCODE, 
-      CINVCNAME, CINVNAME, CINVSTD, 
-      CWHNAME, MZ, PZ, 
-      JZ, TAB, CREATEMAN, 
-      CREATETIME, UPDATEMAN, UPDATETIME, 
-      READTIME)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.gbsj,jdbcType=VARCHAR}, 
-      #{item.cinvccode,jdbcType=VARCHAR}, #{item.cinvcode,jdbcType=VARCHAR}, #{item.cwhcode,jdbcType=VARCHAR}, 
-      #{item.cinvcname,jdbcType=VARCHAR}, #{item.cinvname,jdbcType=VARCHAR}, #{item.cinvstd,jdbcType=VARCHAR}, 
-      #{item.cwhname,jdbcType=VARCHAR}, #{item.mz,jdbcType=DECIMAL}, #{item.pz,jdbcType=DECIMAL}, 
-      #{item.jz,jdbcType=DECIMAL}, #{item.tab,jdbcType=VARCHAR}, #{item.createman,jdbcType=VARCHAR}, 
-      #{item.createtime,jdbcType=VARCHAR}, #{item.updateman,jdbcType=VARCHAR}, #{item.updatetime,jdbcType=VARCHAR}, 
-      #{item.readtime,jdbcType=VARCHAR} from dual  
-   </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-     update DZ_MATERIAL_SF
-     set
-       GBSJ=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.gbsj,jdbcType=VARCHAR}
-       </foreach>
-       ,CINVCCODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvccode,jdbcType=VARCHAR}
-       </foreach>
-       ,CINVCODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvcode,jdbcType=VARCHAR}
-       </foreach>
-       ,CWHCODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cwhcode,jdbcType=VARCHAR}
-       </foreach>
-       ,CINVCNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvcname,jdbcType=VARCHAR}
-       </foreach>
-       ,CINVNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvname,jdbcType=VARCHAR}
-       </foreach>
-       ,CINVSTD=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvstd,jdbcType=VARCHAR}
-       </foreach>
-       ,CWHNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cwhname,jdbcType=VARCHAR}
-       </foreach>
-       ,MZ=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.mz,jdbcType=DECIMAL}
-       </foreach>
-       ,PZ=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.pz,jdbcType=DECIMAL}
-       </foreach>
-       ,JZ=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.jz,jdbcType=DECIMAL}
-       </foreach>
-       ,TAB=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.tab,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATEMAN=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATETIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.createtime,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATEMAN=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATETIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=VARCHAR}
-       </foreach>
-       ,READTIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
-          when #{item.gbsj,jdbcType=VARCHAR} then #{item.readtime,jdbcType=VARCHAR}
-       </foreach>
-    where (GBSJ,CINVCCODE,CINVCODE,CWHCODE) in
-    <foreach collection="list" item="item" open="(" close=")" separator=",">
-     (#{item.gbsj, jdbcType=VARCHAR},#{item.cinvccode, jdbcType=VARCHAR},#{item.cinvcode, jdbcType=VARCHAR},#{item.cwhcode, jdbcType=VARCHAR})
-    </foreach>
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from DZ_MATERIAL_SF
-    where (GBSJ,CINVCCODE,CINVCODE,CWHCODE) in
-    <foreach collection="list" item="item" open="(" close=")" separator=",">
-     ( #{item.gbsj, jdbcType=VARCHAR}, #{item.cinvccode, jdbcType=VARCHAR}, #{item.cinvcode, jdbcType=VARCHAR}, #{item.cwhcode, jdbcType=VARCHAR})
-    </foreach>
-  </delete>
-  <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  <select id="getDzMaterialSf" resultMap="BaseResultMap" parameterType="java.lang.String" >
-    select * from (
-    SELECT CONVERT(varchar(100), gbsj, 23) as gbsj, cInvCCode, cInvCName, cInvCode, cInvName,
-    cInvStd, cWhCode, cWhName, sum(mz) as mz, sum(pz) as pz, sum(jz) as jz, 'sh' as tab
-    FROM v_nyjk_sh where gbsj >= #{gbsj,jdbcType=VARCHAR} and
-    cInvCName in('合金材料','国内矿粉','过滤材料','进口矿粉','原煤','外购精煤','国内球团','高炉干渣','进口块矿','石料')
-    group by cInvCCode, cInvCName, cInvCode, cInvName, cInvStd, cWhCode, cWhName, CONVERT(varchar(100), gbsj, 23)
-    ) as sh union all (
-    SELECT CONVERT(varchar(100), gbsj, 23) as gbsj, cInvCCode, cInvCName, cInvCode, cInvName,
-    cInvStd, cWhCode, cWhName, sum(mz) as mz, sum(pz) as pz, sum(jz) as jz, 'fh' as tab
-    FROM v_nyjk_fh where gbsj >= #{gbsj,jdbcType=VARCHAR} and
-    cInvCName in('合金材料','国内矿粉','过滤材料','进口矿粉','原煤','外购精煤','国内球团','高炉干渣','进口块矿','石料')
-    group by cInvCCode, cInvCName, cInvCode, cInvName, cInvStd, cWhCode, cWhName, CONVERT(varchar(100), [gbsj], 23))
-  </select>
+<?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.dzmaterialsf.mapper.DzMaterialSfMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
+    <id column="GBSJ" jdbcType="VARCHAR" property="gbsj" />
+    <id column="CINVCCODE" jdbcType="VARCHAR" property="cinvccode" />
+    <id column="CINVCODE" jdbcType="VARCHAR" property="cinvcode" />
+    <id column="CWHCODE" jdbcType="VARCHAR" property="cwhcode" />
+    <result column="CINVCNAME" jdbcType="VARCHAR" property="cinvcname" />
+    <result column="CINVNAME" jdbcType="VARCHAR" property="cinvname" />
+    <result column="CINVSTD" jdbcType="VARCHAR" property="cinvstd" />
+    <result column="CWHNAME" jdbcType="VARCHAR" property="cwhname" />
+    <result column="MZ" jdbcType="DECIMAL" property="mz" />
+    <result column="PZ" jdbcType="DECIMAL" property="pz" />
+    <result column="JZ" jdbcType="DECIMAL" property="jz" />
+    <result column="TAB" jdbcType="VARCHAR" property="tab" />
+    <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
+    <result column="CREATETIME" jdbcType="VARCHAR" property="createtime" />
+    <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
+    <result column="UPDATETIME" jdbcType="VARCHAR" property="updatetime" />
+    <result column="READTIME" jdbcType="VARCHAR" property="readtime" />
+    <result column="DJLX" jdbcType="VARCHAR" property="djlx" />
+    <result column="PZDL" jdbcType="VARCHAR" property="pzdl" />
+  </resultMap>
+  <sql id="columns">
+    GBSJ, CINVCCODE, CINVCODE, CWHCODE, CINVCNAME, CINVNAME, CINVSTD, CWHNAME, MZ, PZ, 
+    JZ, TAB, CREATEMAN, CREATETIME, UPDATEMAN, UPDATETIME, READTIME, DJLX, PZDL
+  </sql>
+  <sql id="columns_alias">
+    t.GBSJ, t.CINVCCODE, t.CINVCODE, t.CWHCODE, t.CINVCNAME, t.CINVNAME, t.CINVSTD, t.CWHNAME, 
+    t.MZ, t.PZ, t.JZ, t.TAB, t.CREATEMAN, t.CREATETIME, t.UPDATEMAN, t.UPDATETIME, t.READTIME,
+    t.DJLX, t.PZDL
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM DZ_MATERIAL_SF
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM DZ_MATERIAL_SF t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="gbsj != null and gbsj != ''">
+        and GBSJ = #{gbsj}
+      </if>
+      <if test="cinvccode != null and cinvccode != ''">
+        and CINVCCODE = #{cinvccode}
+      </if>
+      <if test="cinvcode != null and cinvcode != ''">
+        and CINVCODE = #{cinvcode}
+      </if>
+      <if test="cwhcode != null and cwhcode != ''">
+        and CWHCODE = #{cwhcode}
+      </if>
+      <if test="cinvcname != null and cinvcname != ''">
+        and CINVCNAME = #{cinvcname}
+      </if>
+      <if test="cinvname != null and cinvname != ''">
+        and CINVNAME = #{cinvname}
+      </if>
+      <if test="cinvstd != null and cinvstd != ''">
+        and CINVSTD = #{cinvstd}
+      </if>
+      <if test="cwhname != null and cwhname != ''">
+        and CWHNAME = #{cwhname}
+      </if>
+      <if test="mz != null">
+        and MZ = #{mz}
+      </if>
+      <if test="pz != null">
+        and PZ = #{pz}
+      </if>
+      <if test="jz != null">
+        and JZ = #{jz}
+      </if>
+      <if test="tab != null and tab != ''">
+        and TAB = #{tab}
+      </if>
+      <if test="createman != null and createman != ''">
+        and CREATEMAN = #{createman}
+      </if>
+      <if test="createtime != null and createtime != ''">
+        and CREATETIME = #{createtime}
+      </if>
+      <if test="updateman != null and updateman != ''">
+        and UPDATEMAN = #{updateman}
+      </if>
+      <if test="updatetime != null and updatetime != ''">
+        and UPDATETIME = #{updatetime}
+      </if>
+      <if test="readtime != null and readtime != ''">
+        and READTIME = #{readtime}
+      </if>
+      <if test="djlx != null and djlx != ''">
+        and DJLX = #{djlx}
+      </if>
+      <if test="pzdl != null and pzdl != ''">
+        and PZDL = #{pzdl}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="gbsj != null and gbsj != ''">
+        and GBSJ LIKE '%${gbsj}%'
+      </if>
+      <if test="cinvccode != null and cinvccode != ''">
+        and CINVCCODE LIKE '%${cinvccode}%'
+      </if>
+      <if test="cinvcode != null and cinvcode != ''">
+        and CINVCODE LIKE '%${cinvcode}%'
+      </if>
+      <if test="cwhcode != null and cwhcode != ''">
+        and CWHCODE LIKE '%${cwhcode}%'
+      </if>
+      <if test="cinvcname != null and cinvcname != ''">
+        and CINVCNAME LIKE '%${cinvcname}%'
+      </if>
+      <if test="cinvname != null and cinvname != ''">
+        and CINVNAME LIKE '%${cinvname}%'
+      </if>
+      <if test="cinvstd != null and cinvstd != ''">
+        and CINVSTD LIKE '%${cinvstd}%'
+      </if>
+      <if test="cwhname != null and cwhname != ''">
+        and CWHNAME LIKE '%${cwhname}%'
+      </if>
+      <if test="mz != null">
+        and MZ = #{mz}
+      </if>
+      <if test="pz != null">
+        and PZ = #{pz}
+      </if>
+      <if test="jz != null">
+        and JZ = #{jz}
+      </if>
+      <if test="tab != null and tab != ''">
+        and TAB LIKE '%${tab}%'
+      </if>
+      <if test="createman != null and createman != ''">
+        and CREATEMAN LIKE '%${createman}%'
+      </if>
+      <if test="createtime != null and createtime != ''">
+        and CREATETIME LIKE '%${createtime}%'
+      </if>
+      <if test="updateman != null and updateman != ''">
+        and UPDATEMAN LIKE '%${updateman}%'
+      </if>
+      <if test="updatetime != null and updatetime != ''">
+        and UPDATETIME LIKE '%${updatetime}%'
+      </if>
+      <if test="readtime != null and readtime != ''">
+        and READTIME LIKE '%${readtime}%'
+      </if>
+      <if test="djlx != null and djlx != ''">
+        and READTIME LIKE '%${djlx}%'
+      </if>
+      <if test="pzdl != null and pzdl != ''">
+        and PZDL LIKE '%${pzdl}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="map">
+    delete from DZ_MATERIAL_SF
+    where GBSJ = #{gbsj,jdbcType=VARCHAR}
+      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
+      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
+      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
+      and TAB = #{tab,jdbcType=VARCHAR}
+      and DJLX = #{djlx,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from DZ_MATERIAL_SF
+    where 1!=1 
+      <if test="cinvccode != null and cinvccode != ''">
+        or CINVCCODE = #{cinvccode}
+      </if>
+      <if test="cinvcode != null and cinvcode != ''">
+        or CINVCODE = #{cinvcode}
+      </if>
+      <if test="cwhcode != null and cwhcode != ''">
+        or CWHCODE = #{cwhcode}
+      </if>
+      <if test="cinvcname != null and cinvcname != ''">
+        or CINVCNAME = #{cinvcname}
+      </if>
+      <if test="cinvname != null and cinvname != ''">
+        or CINVNAME = #{cinvname}
+      </if>
+      <if test="cinvstd != null and cinvstd != ''">
+        or CINVSTD = #{cinvstd}
+      </if>
+      <if test="cwhname != null and cwhname != ''">
+        or CWHNAME = #{cwhname}
+      </if>
+      <if test="mz != null">
+        or MZ = #{mz}
+      </if>
+      <if test="pz != null">
+        or PZ = #{pz}
+      </if>
+      <if test="jz != null">
+        or JZ = #{jz}
+      </if>
+      <if test="tab != null and tab != ''">
+        or TAB = #{tab}
+      </if>
+      <if test="createman != null and createman != ''">
+        or CREATEMAN = #{createman}
+      </if>
+      <if test="createtime != null and createtime != ''">
+        or CREATETIME = #{createtime}
+      </if>
+      <if test="updateman != null and updateman != ''">
+        or UPDATEMAN = #{updateman}
+      </if>
+      <if test="updatetime != null and updatetime != ''">
+        or UPDATETIME = #{updatetime}
+      </if>
+      <if test="readtime != null and readtime != ''">
+        or READTIME = #{readtime}
+      </if>
+    <if test="djlx != null and djlx != ''">
+      or DJLX = #{djlx}
+    </if>
+    <if test="pzdl != null and pzdl != ''">
+      or PZDL = #{pzdl}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
+    insert into DZ_MATERIAL_SF (GBSJ, CINVCCODE, CINVCODE, 
+      CWHCODE, CINVCNAME, CINVNAME, 
+      CINVSTD, CWHNAME, MZ, 
+      PZ, JZ, TAB, CREATEMAN, 
+      CREATETIME, UPDATEMAN, UPDATETIME, 
+      READTIME,DJLX,PZDL)
+    values (#{gbsj,jdbcType=VARCHAR}, #{cinvccode,jdbcType=VARCHAR}, #{cinvcode,jdbcType=VARCHAR}, 
+      #{cwhcode,jdbcType=VARCHAR}, #{cinvcname,jdbcType=VARCHAR}, #{cinvname,jdbcType=VARCHAR}, 
+      #{cinvstd,jdbcType=VARCHAR}, #{cwhname,jdbcType=VARCHAR}, #{mz,jdbcType=DECIMAL}, 
+      #{pz,jdbcType=DECIMAL}, #{jz,jdbcType=DECIMAL}, #{tab,jdbcType=VARCHAR}, #{createman,jdbcType=VARCHAR}, 
+      #{createtime,jdbcType=VARCHAR}, #{updateman,jdbcType=VARCHAR}, #{updatetime,jdbcType=VARCHAR}, 
+      #{readtime,jdbcType=VARCHAR},#{djlx,jdbcType=VARCHAR},#{pzdl,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
+    insert into DZ_MATERIAL_SF
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="gbsj != null">
+        GBSJ,
+      </if>
+      <if test="cinvccode != null">
+        CINVCCODE,
+      </if>
+      <if test="cinvcode != null">
+        CINVCODE,
+      </if>
+      <if test="cwhcode != null">
+        CWHCODE,
+      </if>
+      <if test="cinvcname != null">
+        CINVCNAME,
+      </if>
+      <if test="cinvname != null">
+        CINVNAME,
+      </if>
+      <if test="cinvstd != null">
+        CINVSTD,
+      </if>
+      <if test="cwhname != null">
+        CWHNAME,
+      </if>
+      <if test="mz != null">
+        MZ,
+      </if>
+      <if test="pz != null">
+        PZ,
+      </if>
+      <if test="jz != null">
+        JZ,
+      </if>
+      <if test="tab != null">
+        TAB,
+      </if>
+      <if test="createman != null">
+        CREATEMAN,
+      </if>
+      <if test="createtime != null">
+        CREATETIME,
+      </if>
+      <if test="updateman != null">
+        UPDATEMAN,
+      </if>
+      <if test="updatetime != null">
+        UPDATETIME,
+      </if>
+      <if test="readtime != null">
+        READTIME,
+      </if>
+      <if test="djlx != null">
+        DJLX,
+      </if>
+      <if test="pzdl != null">
+        PZDL,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="gbsj != null">
+        #{gbsj,jdbcType=VARCHAR},
+      </if>
+      <if test="cinvccode != null">
+        #{cinvccode,jdbcType=VARCHAR},
+      </if>
+      <if test="cinvcode != null">
+        #{cinvcode,jdbcType=VARCHAR},
+      </if>
+      <if test="cwhcode != null">
+        #{cwhcode,jdbcType=VARCHAR},
+      </if>
+      <if test="cinvcname != null">
+        #{cinvcname,jdbcType=VARCHAR},
+      </if>
+      <if test="cinvname != null">
+        #{cinvname,jdbcType=VARCHAR},
+      </if>
+      <if test="cinvstd != null">
+        #{cinvstd,jdbcType=VARCHAR},
+      </if>
+      <if test="cwhname != null">
+        #{cwhname,jdbcType=VARCHAR},
+      </if>
+      <if test="mz != null">
+        #{mz,jdbcType=DECIMAL},
+      </if>
+      <if test="pz != null">
+        #{pz,jdbcType=DECIMAL},
+      </if>
+      <if test="jz != null">
+        #{jz,jdbcType=DECIMAL},
+      </if>
+      <if test="tab != null">
+        #{tab,jdbcType=VARCHAR},
+      </if>
+      <if test="createman != null">
+        #{createman,jdbcType=VARCHAR},
+      </if>
+      <if test="createtime != null">
+        #{createtime,jdbcType=VARCHAR},
+      </if>
+      <if test="updateman != null">
+        #{updateman,jdbcType=VARCHAR},
+      </if>
+      <if test="updatetime != null">
+        #{updatetime,jdbcType=VARCHAR},
+      </if>
+      <if test="readtime != null">
+        #{readtime,jdbcType=VARCHAR},
+      </if>
+      <if test="djlx != null">
+        #{djlx,jdbcType=VARCHAR},
+      </if>
+      <if test="pzdl != null">
+        #{pzdl,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
+    update DZ_MATERIAL_SF
+    set CINVCNAME = #{cinvcname,jdbcType=VARCHAR},
+      CINVNAME = #{cinvname,jdbcType=VARCHAR},
+      CINVSTD = #{cinvstd,jdbcType=VARCHAR},
+      CWHNAME = #{cwhname,jdbcType=VARCHAR},
+      MZ = #{mz,jdbcType=DECIMAL},
+      PZ = #{pz,jdbcType=DECIMAL},
+      JZ = #{jz,jdbcType=DECIMAL},
+      TAB = #{tab,jdbcType=VARCHAR},
+      CREATEMAN = #{createman,jdbcType=VARCHAR},
+      CREATETIME = #{createtime,jdbcType=VARCHAR},
+      UPDATEMAN = #{updateman,jdbcType=VARCHAR},
+      UPDATETIME = #{updatetime,jdbcType=VARCHAR},
+      READTIME = #{readtime,jdbcType=VARCHAR},
+      DJLX = #{djlx,jdbcType=VARCHAR}
+    where GBSJ = #{gbsj,jdbcType=VARCHAR}
+      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
+      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
+      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
+      and TAB = #{tab,jdbcType=VARCHAR}
+      and djlx = #{djlx,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf">
+    update DZ_MATERIAL_SF
+    <set>
+      <if test="cinvcname != null">
+        CINVCNAME = #{cinvcname,jdbcType=VARCHAR},
+      </if>
+      <if test="cinvname != null">
+        CINVNAME = #{cinvname,jdbcType=VARCHAR},
+      </if>
+      <if test="cinvstd != null">
+        CINVSTD = #{cinvstd,jdbcType=VARCHAR},
+      </if>
+      <if test="cwhname != null">
+        CWHNAME = #{cwhname,jdbcType=VARCHAR},
+      </if>
+      <if test="mz != null">
+        MZ = #{mz,jdbcType=DECIMAL},
+      </if>
+      <if test="pz != null">
+        PZ = #{pz,jdbcType=DECIMAL},
+      </if>
+      <if test="jz != null">
+        JZ = #{jz,jdbcType=DECIMAL},
+      </if>
+      <if test="tab != null">
+        TAB = #{tab,jdbcType=VARCHAR},
+      </if>
+      <if test="createman != null">
+        CREATEMAN = #{createman,jdbcType=VARCHAR},
+      </if>
+      <if test="createtime != null">
+        CREATETIME = #{createtime,jdbcType=VARCHAR},
+      </if>
+      <if test="updateman != null">
+        UPDATEMAN = #{updateman,jdbcType=VARCHAR},
+      </if>
+      <if test="updatetime != null">
+        UPDATETIME = #{updatetime,jdbcType=VARCHAR},
+      </if>
+      <if test="readtime != null">
+        READTIME = #{readtime,jdbcType=VARCHAR},
+      </if>
+      <if test="djlx != null">
+        DJLX = #{djlx,jdbcType=VARCHAR},
+      </if>
+      <if test="pzdl != null">
+        PZDL = #{pzdl,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where GBSJ = #{gbsj,jdbcType=VARCHAR}
+      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
+      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
+      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
+      and TAB = #{tab,jdbcType=VARCHAR}
+      and DJLX = #{djlx,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where GBSJ = #{gbsj,jdbcType=VARCHAR}
+      and CINVCCODE = #{cinvccode,jdbcType=VARCHAR}
+      and CINVCODE = #{cinvcode,jdbcType=VARCHAR}
+      and CWHCODE = #{cwhcode,jdbcType=VARCHAR}
+      and TAB = #{tab,jdbcType=VARCHAR}
+      and DJLX = #{djlx,jdbcType=VARCHAR}
+  </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 DZ_MATERIAL_SF 
+      (GBSJ, 
+      CINVCCODE, CINVCODE, CWHCODE, 
+      CINVCNAME, CINVNAME, CINVSTD, 
+      CWHNAME, MZ, PZ, 
+      JZ, TAB, CREATEMAN, 
+      CREATETIME, UPDATEMAN, UPDATETIME, 
+      READTIME,DJLX,PZDL)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.gbsj,jdbcType=VARCHAR}, 
+      #{item.cinvccode,jdbcType=VARCHAR}, #{item.cinvcode,jdbcType=VARCHAR}, #{item.cwhcode,jdbcType=VARCHAR}, 
+      #{item.cinvcname,jdbcType=VARCHAR}, #{item.cinvname,jdbcType=VARCHAR}, #{item.cinvstd,jdbcType=VARCHAR}, 
+      #{item.cwhname,jdbcType=VARCHAR}, #{item.mz,jdbcType=DECIMAL}, #{item.pz,jdbcType=DECIMAL}, 
+      #{item.jz,jdbcType=DECIMAL}, #{item.tab,jdbcType=VARCHAR}, #{item.createman,jdbcType=VARCHAR}, 
+      #{item.createtime,jdbcType=VARCHAR}, #{item.updateman,jdbcType=VARCHAR}, #{item.updatetime,jdbcType=VARCHAR}, 
+      #{item.readtime,jdbcType=VARCHAR},#{item.djlx,jdbcType=VARCHAR},#{item.pzdl,jdbcType=VARCHAR} from dual
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update DZ_MATERIAL_SF
+     set
+       GBSJ=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.gbsj,jdbcType=VARCHAR}
+       </foreach>
+       ,CINVCCODE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvccode,jdbcType=VARCHAR}
+       </foreach>
+       ,CINVCODE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvcode,jdbcType=VARCHAR}
+       </foreach>
+       ,CWHCODE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cwhcode,jdbcType=VARCHAR}
+       </foreach>
+       ,CINVCNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvcname,jdbcType=VARCHAR}
+       </foreach>
+       ,CINVNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvname,jdbcType=VARCHAR}
+       </foreach>
+       ,CINVSTD=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cinvstd,jdbcType=VARCHAR}
+       </foreach>
+       ,CWHNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.cwhname,jdbcType=VARCHAR}
+       </foreach>
+       ,MZ=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.mz,jdbcType=DECIMAL}
+       </foreach>
+       ,PZ=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.pz,jdbcType=DECIMAL}
+       </foreach>
+       ,JZ=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.jz,jdbcType=DECIMAL}
+       </foreach>
+       ,TAB=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.tab,jdbcType=VARCHAR}
+       </foreach>
+       ,CREATEMAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
+       </foreach>
+       ,CREATETIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.createtime,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATEMAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATETIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=VARCHAR}
+       </foreach>
+       ,READTIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+          when #{item.gbsj,jdbcType=VARCHAR} then #{item.readtime,jdbcType=VARCHAR}
+       </foreach>
+    <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+      when #{item.gbsj,jdbcType=VARCHAR} then #{item.djlx,jdbcType=VARCHAR}
+    </foreach>
+    <foreach collection="list" item="item" index="index" separator=" " open="case GBSJ" close="end">
+      when #{item.gbsj,jdbcType=VARCHAR} then #{item.pzdl,jdbcType=VARCHAR}
+    </foreach>
+    where (GBSJ,CINVCCODE,CINVCODE,CWHCODE,TAB,DJLX) in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+     (#{item.gbsj, jdbcType=VARCHAR},#{item.cinvccode, jdbcType=VARCHAR},#{item.cinvcode, jdbcType=VARCHAR},#{item.cwhcode, jdbcType=VARCHAR},#{item.tab, jdbcType=VARCHAR},#{item.djlx, jdbcType=VARCHAR})
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from DZ_MATERIAL_SF
+    where (GBSJ,CINVCCODE,CINVCODE,CWHCODE,TAB,DJLX) in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+     ( #{item.gbsj, jdbcType=VARCHAR}, #{item.cinvccode, jdbcType=VARCHAR}, #{item.cinvcode, jdbcType=VARCHAR}, #{item.cwhcode, jdbcType=VARCHAR},#{item.tab, jdbcType=VARCHAR},#{item.djlx, jdbcType=VARCHAR})
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <select id="getDzMaterialSf" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select * from (
+    SELECT CONVERT(varchar(100), gbsj, 23) as gbsj, cInvCCode, cInvCName, cInvCode, cInvName,
+    cInvStd, cWhCode, cWhName, sum(mz) as mz, sum(pz) as pz, sum(jz) as jz, djlx, pzdl, 'sh' as tab
+    FROM v_nyjk_sh where gbsj >= #{gbsj,jdbcType=VARCHAR} and pzdl IS NOT NULL
+    --cInvCName in('合金材料','国内矿粉','过滤材料','进口矿粉','原煤','外购精煤','国内球团','高炉干渣','进口块矿','石料')
+    group by cInvCCode, cInvCName, cInvCode, cInvName, cInvStd, cWhCode, cWhName, CONVERT(varchar(100), gbsj, 23),djlx, pzdl
+    ) as sh union all (
+    SELECT CONVERT(varchar(100), gbsj, 23) as gbsj, cInvCCode, cInvCName, cInvCode, cInvName,
+    cInvStd, cWhCode, cWhName, sum(mz) as mz, sum(pz) as pz, sum(jz) as jz, djlx, pzdl, 'fh' as tab
+    FROM v_nyjk_fh where gbsj >= #{gbsj,jdbcType=VARCHAR} and pzdl IS NOT NULL
+    --cInvCName in('合金材料','国内矿粉','过滤材料','进口矿粉','原煤','外购精煤','国内球团','高炉干渣','进口块矿','石料')
+    group by cInvCCode, cInvCName, cInvCode, cInvName, cInvStd, cWhCode, cWhName, CONVERT(varchar(100), [gbsj], 23),djlx, pzdl)
+  </select>
 </mapper>

+ 327 - 298
src/main/java/com/steerinfo/ems/dzmaterialsf/model/DzMaterialSf.java

@@ -1,299 +1,328 @@
-package com.steerinfo.ems.dzmaterialsf.model;
-
-import com.steerinfo.framework.model.ICBasePO;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.Map;
-
-@ApiModel(value="大宗物料数据表")
-public class DzMaterialSf implements ICBasePO<DzMaterialSf> {
-    /**
-     * 日期(GBSJ,VARCHAR,20)
-     */
-    @ApiModelProperty(value="日期",required=true)
-    private String gbsj;
-
-    /**
-     * 物料类型id(CINVCCODE,VARCHAR,20)
-     */
-    @ApiModelProperty(value="物料类型id",required=true)
-    private String cinvccode;
-
-    /**
-     * 物料ID(CINVCODE,VARCHAR,20)
-     */
-    @ApiModelProperty(value="物料ID",required=true)
-    private String cinvcode;
-
-    /**
-     * 物料仓库ID(CWHCODE,VARCHAR,20)
-     */
-    @ApiModelProperty(value="物料仓库ID",required=true)
-    private String cwhcode;
-
-    /**
-     * 物料类型名称(CINVCNAME,VARCHAR,20)
-     */
-    @ApiModelProperty(value="物料类型名称",required=false)
-    private String cinvcname;
-
-    /**
-     * 物料名称(CINVNAME,VARCHAR,50)
-     */
-    @ApiModelProperty(value="物料名称",required=false)
-    private String cinvname;
-
-    /**
-     * 物料规格(备注)(CINVSTD,VARCHAR,100)
-     */
-    @ApiModelProperty(value="物料规格(备注)",required=false)
-    private String cinvstd;
-
-    /**
-     * 物料仓库名称(CWHNAME,VARCHAR,100)
-     */
-    @ApiModelProperty(value="物料仓库名称",required=false)
-    private String cwhname;
-
-    /**
-     * 毛重(MZ,DECIMAL,20)
-     */
-    @ApiModelProperty(value="毛重",required=false)
-    private BigDecimal mz;
-
-    /**
-     * 皮重(PZ,DECIMAL,20)
-     */
-    @ApiModelProperty(value="皮重",required=false)
-    private BigDecimal pz;
-
-    /**
-     * 净重(JZ,DECIMAL,20)
-     */
-    @ApiModelProperty(value="净重",required=false)
-    private BigDecimal jz;
-
-    /**
-     * 表标识(TAB,VARCHAR,10)
-     */
-    @ApiModelProperty(value="表标识",required=false)
-    private String tab;
-
-    /**
-     * 创建人(CREATEMAN,VARCHAR,50)
-     */
-    @ApiModelProperty(value="创建人",required=false)
-    private String createman;
-
-    /**
-     * 创建时间(CREATETIME,VARCHAR,50)
-     */
-    @ApiModelProperty(value="创建时间",required=false)
-    private String createtime;
-
-    /**
-     * 修改人(UPDATEMAN,VARCHAR,50)
-     */
-    @ApiModelProperty(value="修改人",required=false)
-    private String updateman;
-
-    /**
-     * 修改时间(UPDATETIME,VARCHAR,50)
-     */
-    @ApiModelProperty(value="修改时间",required=false)
-    private String updatetime;
-
-    /**
-     * 读取时间(READTIME,VARCHAR,50)
-     */
-    @ApiModelProperty(value="读取时间",required=false)
-    private String readtime;
-
-    private static final long serialVersionUID = 1L;
-
-    @Override
-    public Map<String, Object> getId() {
-        Map<String, Object> params = new HashMap<>();
-        params.put("gbsj",this.gbsj);
-        params.put("cinvccode",this.cinvccode);
-        params.put("cinvcode",this.cinvcode);
-        params.put("cwhcode",this.cwhcode);
-        params.put("tab",this.tab);
-        return params;
-    }
-
-    @Override
-    public void setId(DzMaterialSf dzMaterialSf) {
-        this.gbsj = dzMaterialSf.getGbsj();
-        this.cinvccode = dzMaterialSf.getCinvccode();
-        this.cinvcode = dzMaterialSf.getCinvcode();
-        this.cwhcode = dzMaterialSf.getCwhcode();
-        this.tab = dzMaterialSf.getTab();
-    }
-
-    public String getGbsj() {
-        return gbsj;
-    }
-
-    public void setGbsj(String gbsj) {
-        this.gbsj = gbsj == null ? null : gbsj.trim();
-    }
-
-    public String getCinvccode() {
-        return cinvccode;
-    }
-
-    public void setCinvccode(String cinvccode) {
-        this.cinvccode = cinvccode == null ? null : cinvccode.trim();
-    }
-
-    public String getCinvcode() {
-        return cinvcode;
-    }
-
-    public void setCinvcode(String cinvcode) {
-        this.cinvcode = cinvcode == null ? null : cinvcode.trim();
-    }
-
-    public String getCwhcode() {
-        return cwhcode;
-    }
-
-    public void setCwhcode(String cwhcode) {
-        this.cwhcode = cwhcode == null ? null : cwhcode.trim();
-    }
-
-    public String getCinvcname() {
-        return cinvcname;
-    }
-
-    public void setCinvcname(String cinvcname) {
-        this.cinvcname = cinvcname == null ? null : cinvcname.trim();
-    }
-
-    public String getCinvname() {
-        return cinvname;
-    }
-
-    public void setCinvname(String cinvname) {
-        this.cinvname = cinvname == null ? null : cinvname.trim();
-    }
-
-    public String getCinvstd() {
-        return cinvstd;
-    }
-
-    public void setCinvstd(String cinvstd) {
-        this.cinvstd = cinvstd == null ? null : cinvstd.trim();
-    }
-
-    public String getCwhname() {
-        return cwhname;
-    }
-
-    public void setCwhname(String cwhname) {
-        this.cwhname = cwhname == null ? null : cwhname.trim();
-    }
-
-    public BigDecimal getMz() {
-        return mz;
-    }
-
-    public void setMz(BigDecimal mz) {
-        this.mz = mz;
-    }
-
-    public BigDecimal getPz() {
-        return pz;
-    }
-
-    public void setPz(BigDecimal pz) {
-        this.pz = pz;
-    }
-
-    public BigDecimal getJz() {
-        return jz;
-    }
-
-    public void setJz(BigDecimal jz) {
-        this.jz = jz;
-    }
-
-    public String getTab() {
-        return tab;
-    }
-
-    public void setTab(String tab) {
-        this.tab = tab == null ? null : tab.trim();
-    }
-
-    public String getCreateman() {
-        return createman;
-    }
-
-    public void setCreateman(String createman) {
-        this.createman = createman == null ? null : createman.trim();
-    }
-
-    public String getCreatetime() {
-        return createtime;
-    }
-
-    public void setCreatetime(String createtime) {
-        this.createtime = createtime == null ? null : createtime.trim();
-    }
-
-    public String getUpdateman() {
-        return updateman;
-    }
-
-    public void setUpdateman(String updateman) {
-        this.updateman = updateman == null ? null : updateman.trim();
-    }
-
-    public String getUpdatetime() {
-        return updatetime;
-    }
-
-    public void setUpdatetime(String updatetime) {
-        this.updatetime = updatetime == null ? null : updatetime.trim();
-    }
-
-    public String getReadtime() {
-        return readtime;
-    }
-
-    public void setReadtime(String readtime) {
-        this.readtime = readtime == null ? null : readtime.trim();
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", gbsj=").append(gbsj);
-        sb.append(", cinvccode=").append(cinvccode);
-        sb.append(", cinvcode=").append(cinvcode);
-        sb.append(", cwhcode=").append(cwhcode);
-        sb.append(", cinvcname=").append(cinvcname);
-        sb.append(", cinvname=").append(cinvname);
-        sb.append(", cinvstd=").append(cinvstd);
-        sb.append(", cwhname=").append(cwhname);
-        sb.append(", mz=").append(mz);
-        sb.append(", pz=").append(pz);
-        sb.append(", jz=").append(jz);
-        sb.append(", tab=").append(tab);
-        sb.append(", createman=").append(createman);
-        sb.append(", createtime=").append(createtime);
-        sb.append(", updateman=").append(updateman);
-        sb.append(", updatetime=").append(updatetime);
-        sb.append(", readtime=").append(readtime);
-        sb.append(", serialVersionUID=").append(serialVersionUID);
-        sb.append("]");
-        return sb.toString();
-    }
+package com.steerinfo.ems.dzmaterialsf.model;
+
+import com.steerinfo.framework.model.ICBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Map;
+
+@ApiModel(value="大宗物料数据表")
+public class DzMaterialSf implements ICBasePO<DzMaterialSf> {
+    /**
+     * 日期(GBSJ,VARCHAR,20)
+     */
+    @ApiModelProperty(value="日期",required=true)
+    private String gbsj;
+
+    /**
+     * 物料类型id(CINVCCODE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="物料类型id",required=true)
+    private String cinvccode;
+
+    /**
+     * 物料ID(CINVCODE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="物料ID",required=true)
+    private String cinvcode;
+
+    /**
+     * 物料仓库ID(CWHCODE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="物料仓库ID",required=true)
+    private String cwhcode;
+
+    /**
+     * 物料类型名称(CINVCNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="物料类型名称",required=false)
+    private String cinvcname;
+
+    /**
+     * 物料名称(CINVNAME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="物料名称",required=false)
+    private String cinvname;
+
+    /**
+     * 物料规格(备注)(CINVSTD,VARCHAR,100)
+     */
+    @ApiModelProperty(value="物料规格(备注)",required=false)
+    private String cinvstd;
+
+    /**
+     * 物料仓库名称(CWHNAME,VARCHAR,100)
+     */
+    @ApiModelProperty(value="物料仓库名称",required=false)
+    private String cwhname;
+
+    /**
+     * 毛重(MZ,DECIMAL,20)
+     */
+    @ApiModelProperty(value="毛重",required=false)
+    private BigDecimal mz;
+
+    /**
+     * 皮重(PZ,DECIMAL,20)
+     */
+    @ApiModelProperty(value="皮重",required=false)
+    private BigDecimal pz;
+
+    /**
+     * 净重(JZ,DECIMAL,20)
+     */
+    @ApiModelProperty(value="净重",required=false)
+    private BigDecimal jz;
+
+    /**
+     * 表标识(TAB,VARCHAR,10)
+     */
+    @ApiModelProperty(value="表标识",required=false)
+    private String tab;
+
+    /**
+     * 创建人(CREATEMAN,VARCHAR,50)
+     */
+    @ApiModelProperty(value="创建人",required=false)
+    private String createman;
+
+    /**
+     * 创建时间(CREATETIME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="创建时间",required=false)
+    private String createtime;
+
+    /**
+     * 修改人(UPDATEMAN,VARCHAR,50)
+     */
+    @ApiModelProperty(value="修改人",required=false)
+    private String updateman;
+
+    /**
+     * 修改时间(UPDATETIME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="修改时间",required=false)
+    private String updatetime;
+
+    /**
+     * 读取时间(READTIME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="读取时间",required=false)
+    private String readtime;
+
+    /**
+     * 单据类型(READTIME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="单据类型",required=false)
+    private String djlx;
+
+    /**
+     * 品种(READTIME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="品种",required=false)
+    private String pzdl;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public Map<String, Object> getId() {
+        Map<String, Object> params = new HashMap<>();
+        params.put("gbsj",this.gbsj);
+        params.put("cinvccode",this.cinvccode);
+        params.put("cinvcode",this.cinvcode);
+        params.put("cwhcode",this.cwhcode);
+        params.put("tab",this.tab);
+        params.put("djlx",this.djlx);
+        return params;
+    }
+
+    @Override
+    public void setId(DzMaterialSf dzMaterialSf) {
+        this.gbsj = dzMaterialSf.getGbsj();
+        this.cinvccode = dzMaterialSf.getCinvccode();
+        this.cinvcode = dzMaterialSf.getCinvcode();
+        this.cwhcode = dzMaterialSf.getCwhcode();
+        this.tab = dzMaterialSf.getTab();
+    }
+
+    public String getGbsj() {
+        return gbsj;
+    }
+
+    public void setGbsj(String gbsj) {
+        this.gbsj = gbsj == null ? null : gbsj.trim();
+    }
+
+    public String getCinvccode() {
+        return cinvccode;
+    }
+
+    public void setCinvccode(String cinvccode) {
+        this.cinvccode = cinvccode == null ? null : cinvccode.trim();
+    }
+
+    public String getCinvcode() {
+        return cinvcode;
+    }
+
+    public void setCinvcode(String cinvcode) {
+        this.cinvcode = cinvcode == null ? null : cinvcode.trim();
+    }
+
+    public String getCwhcode() {
+        return cwhcode;
+    }
+
+    public void setCwhcode(String cwhcode) {
+        this.cwhcode = cwhcode == null ? null : cwhcode.trim();
+    }
+
+    public String getCinvcname() {
+        return cinvcname;
+    }
+
+    public void setCinvcname(String cinvcname) {
+        this.cinvcname = cinvcname == null ? null : cinvcname.trim();
+    }
+
+    public String getCinvname() {
+        return cinvname;
+    }
+
+    public void setCinvname(String cinvname) {
+        this.cinvname = cinvname == null ? null : cinvname.trim();
+    }
+
+    public String getCinvstd() {
+        return cinvstd;
+    }
+
+    public void setCinvstd(String cinvstd) {
+        this.cinvstd = cinvstd == null ? null : cinvstd.trim();
+    }
+
+    public String getCwhname() {
+        return cwhname;
+    }
+
+    public void setCwhname(String cwhname) {
+        this.cwhname = cwhname == null ? null : cwhname.trim();
+    }
+
+    public BigDecimal getMz() {
+        return mz;
+    }
+
+    public void setMz(BigDecimal mz) {
+        this.mz = mz;
+    }
+
+    public BigDecimal getPz() {
+        return pz;
+    }
+
+    public void setPz(BigDecimal pz) {
+        this.pz = pz;
+    }
+
+    public BigDecimal getJz() {
+        return jz;
+    }
+
+    public void setJz(BigDecimal jz) {
+        this.jz = jz;
+    }
+
+    public String getTab() {
+        return tab;
+    }
+
+    public void setTab(String tab) {
+        this.tab = tab == null ? null : tab.trim();
+    }
+
+    public String getCreateman() {
+        return createman;
+    }
+
+    public void setCreateman(String createman) {
+        this.createman = createman == null ? null : createman.trim();
+    }
+
+    public String getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(String createtime) {
+        this.createtime = createtime == null ? null : createtime.trim();
+    }
+
+    public String getUpdateman() {
+        return updateman;
+    }
+
+    public void setUpdateman(String updateman) {
+        this.updateman = updateman == null ? null : updateman.trim();
+    }
+
+    public String getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(String updatetime) {
+        this.updatetime = updatetime == null ? null : updatetime.trim();
+    }
+
+    public String getReadtime() {
+        return readtime;
+    }
+
+    public void setReadtime(String readtime) {
+        this.readtime = readtime == null ? null : readtime.trim();
+    }
+
+    public String getDjlx() { return djlx; }
+
+    public void setDjlx(String djlx) {
+        this.djlx = djlx;
+    }
+
+    public String getPzdl() {
+        return pzdl;
+    }
+
+    public void setPzdl(String pzdl) {
+        this.pzdl = pzdl;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", gbsj=").append(gbsj);
+        sb.append(", cinvccode=").append(cinvccode);
+        sb.append(", cinvcode=").append(cinvcode);
+        sb.append(", cwhcode=").append(cwhcode);
+        sb.append(", cinvcname=").append(cinvcname);
+        sb.append(", cinvname=").append(cinvname);
+        sb.append(", cinvstd=").append(cinvstd);
+        sb.append(", cwhname=").append(cwhname);
+        sb.append(", mz=").append(mz);
+        sb.append(", pz=").append(pz);
+        sb.append(", jz=").append(jz);
+        sb.append(", tab=").append(tab);
+        sb.append(", createman=").append(createman);
+        sb.append(", createtime=").append(createtime);
+        sb.append(", updateman=").append(updateman);
+        sb.append(", updatetime=").append(updatetime);
+        sb.append(", readtime=").append(readtime);
+        sb.append(", djlx=").append(djlx);
+        sb.append(", pzdl=").append(pzdl);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
 }

+ 87 - 86
src/main/java/com/steerinfo/ems/dzmaterialsf/service/impl/DzMaterialSfServiceImpl.java

@@ -1,86 +1,87 @@
-package com.steerinfo.ems.dzmaterialsf.service.impl;
-
-import com.steerinfo.ems.Utils.DateUtils;
-import com.steerinfo.ems.dzmaterialsf.mapper.DzMaterialSfMapper;
-import com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf;
-import com.steerinfo.ems.dzmaterialsf.service.DzMaterialSFDBServer;
-import com.steerinfo.ems.dzmaterialsf.service.IDzMaterialSfService;
-import com.steerinfo.framework.mapper.ICBaseMapper;
-import com.steerinfo.framework.service.impl.CBaseServiceImpl;
-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;
-
-/**
- * DzMaterialSf服务实现:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-10-16 08:57
- * 类描述
- * 修订历史:
- * 日期:2021-10-16
- * 作者:generator
- * 参考:
- * 描述:DzMaterialSf服务实现
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
-@Service(value = "dzMaterialSfService")
-public class DzMaterialSfServiceImpl extends CBaseServiceImpl<DzMaterialSf, String> implements IDzMaterialSfService {
-
-    private static final Logger logger = LoggerFactory.getLogger(DzMaterialSfServiceImpl.class);
-
-    @Autowired
-    private DzMaterialSfMapper dzMaterialSfMapper;
-
-    @Autowired
-    private DzMaterialSFDBServer dzMaterialSFDBServer;
-
-    @Override
-    protected ICBaseMapper<DzMaterialSf, String> getMapper() {
-        return dzMaterialSfMapper;
-    }
-
-    @Override
-    public int dataGeneration() {
-        int addSize = 0;
-        int updateSize = 0;
-        try {
-            List<DzMaterialSf> dzMaterialSfList = dzMaterialSFDBServer.getDzMaterialSf();
-            //List<DzMaterialSf> models;
-            DzMaterialSf model;
-            HashMap<String, Object> hashMap = new HashMap<>();
-            for (DzMaterialSf dzMaterialSf : dzMaterialSfList){
-                dzMaterialSf.setReadtime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
-                hashMap.put("gbsj",dzMaterialSf.getGbsj());
-                hashMap.put("cinvccode",dzMaterialSf.getCinvccode());
-                hashMap.put("cinvcode",dzMaterialSf.getCinvcode());
-                hashMap.put("cwhcode",dzMaterialSf.getCwhcode());
-                hashMap.put("tab",dzMaterialSf.getTab());
-                //model = dzMaterialSfMapper.selectByParameters(hashMap);
-                model = dzMaterialSfMapper.selectByPrimaryKey(dzMaterialSf);
-                if(model != null){
-                    dzMaterialSf.setUpdateman("系统");
-                    dzMaterialSf.setUpdatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
-                    dzMaterialSfMapper.updateByPrimaryKey(dzMaterialSf);
-                    updateSize+=1;
-                    continue;
-                }else {
-                    dzMaterialSf.setCreateman("系统");
-                    dzMaterialSf.setCreatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
-                    addSize+= dzMaterialSfMapper.insert(dzMaterialSf);
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            logger.info("本次总共新增大宗物料收发数据条数:" + addSize);
-            logger.info("本次总共更新大宗物料收发数据条数:" + updateSize);
-        }
-        return addSize+updateSize;
-    }
-}
+package com.steerinfo.ems.dzmaterialsf.service.impl;
+
+import com.steerinfo.ems.Utils.DateUtils;
+import com.steerinfo.ems.dzmaterialsf.mapper.DzMaterialSfMapper;
+import com.steerinfo.ems.dzmaterialsf.model.DzMaterialSf;
+import com.steerinfo.ems.dzmaterialsf.service.DzMaterialSFDBServer;
+import com.steerinfo.ems.dzmaterialsf.service.IDzMaterialSfService;
+import com.steerinfo.framework.mapper.ICBaseMapper;
+import com.steerinfo.framework.service.impl.CBaseServiceImpl;
+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;
+
+/**
+ * DzMaterialSf服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-16 08:57
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-16
+ * 作者:generator
+ * 参考:
+ * 描述:DzMaterialSf服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "dzMaterialSfService")
+public class DzMaterialSfServiceImpl extends CBaseServiceImpl<DzMaterialSf, String> implements IDzMaterialSfService {
+
+    private static final Logger logger = LoggerFactory.getLogger(DzMaterialSfServiceImpl.class);
+
+    @Autowired
+    private DzMaterialSfMapper dzMaterialSfMapper;
+
+    @Autowired
+    private DzMaterialSFDBServer dzMaterialSFDBServer;
+
+    @Override
+    protected ICBaseMapper<DzMaterialSf, String> getMapper() {
+        return dzMaterialSfMapper;
+    }
+
+    @Override
+    public int dataGeneration() {
+        int addSize = 0;
+        int updateSize = 0;
+        try {
+            List<DzMaterialSf> dzMaterialSfList = dzMaterialSFDBServer.getDzMaterialSf();
+            //List<DzMaterialSf> models;
+            DzMaterialSf model;
+            HashMap<String, Object> hashMap = new HashMap<>();
+            for (DzMaterialSf dzMaterialSf : dzMaterialSfList){
+                dzMaterialSf.setReadtime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
+                hashMap.put("gbsj",dzMaterialSf.getGbsj());
+                hashMap.put("cinvccode",dzMaterialSf.getCinvccode());
+                hashMap.put("cinvcode",dzMaterialSf.getCinvcode());
+                hashMap.put("cwhcode",dzMaterialSf.getCwhcode());
+                hashMap.put("tab",dzMaterialSf.getTab());
+                hashMap.put("djlx",dzMaterialSf.getDjlx());
+                //model = dzMaterialSfMapper.selectByParameters(hashMap);
+                model = dzMaterialSfMapper.selectByPrimaryKey(dzMaterialSf);
+                if(model != null){
+                    dzMaterialSf.setUpdateman("系统");
+                    dzMaterialSf.setUpdatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
+                    dzMaterialSfMapper.updateByPrimaryKey(dzMaterialSf);
+                    updateSize+=1;
+                    continue;
+                }else {
+                    dzMaterialSf.setCreateman("系统");
+                    dzMaterialSf.setCreatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
+                    addSize+= dzMaterialSfMapper.insert(dzMaterialSf);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            logger.info("本次总共新增大宗物料收发数据条数:" + addSize);
+            logger.info("本次总共更新大宗物料收发数据条数:" + updateSize);
+        }
+        return addSize+updateSize;
+    }
+}

+ 6 - 10
src/main/java/com/steerinfo/ems/emscordas/controller/EmsCordasController.java

@@ -1,20 +1,16 @@
 package com.steerinfo.ems.emscordas.controller;
 
+import com.steerinfo.ems.emscordas.service.IEmsCordasService;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
-import com.steerinfo.framework.service.pagehelper.PageList;
-import com.steerinfo.ems.emscordas.model.EmsCordas;
-import com.steerinfo.ems.emscordas.service.IEmsCordasService;
 import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,7 +38,7 @@ public class EmsCordasController extends BaseRESTfulController {
     @ApiOperation(value="获取cordas的实时数据", notes="根据url的id来获取详细信息")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("trmactvalue:view")
-    @PostMapping(value = "/gettabledata", produces  = "application/json;charset=UTF-8")
+    @PostMapping(value = "/gettabledata")
     public RESTfulResult gettabledata(@RequestBody Map<String, Object> model){
     	HashMap<String, Object> m = new HashMap<String, Object>();
     	m.put("cordasDataNames", model.get("cordasDataNames"));

+ 1 - 0
src/main/java/com/steerinfo/ems/emscordas/service/impl/EmsCordasServiceImpl.java

@@ -36,6 +36,7 @@ public class EmsCordasServiceImpl extends BaseServiceImpl<EmsCordas, String> imp
         return emsCordasMapper;
     }
 
+    @Override
     public List<Map<String, Object>> getTableData(HashMap<String, Object> m) {
         return emsCordasMapper.getTableData(m);
     };

+ 31 - 7
src/main/java/com/steerinfo/ems/emsscqklg/mapper/EmsScqkLgMapper.xml

@@ -22,15 +22,16 @@
     <result column="CZSJ" jdbcType="TIMESTAMP" property="czsj" />
     <result column="WXGPCL" jdbcType="DECIMAL" property="wxgpcl" />
     <result column="LLB" jdbcType="DECIMAL" property="llb" />
+    <result column="GSRCL" jdbcType="DECIMAL" property="gsrcl" />
   </resultMap>
   <sql id="columns">
     DATES, RCL, JTSL, SJYL, KCL, WJZL, SCLS, LL_1, LL_2, FGZL_NBHST, FGZL_WG, LLDLYL, 
-    WGFG_JFGK, WGFG_QXC, XCF, MEMO, CZR, CZSJ, WXGPCL, LLB
+    WGFG_JFGK, WGFG_QXC, XCF, MEMO, CZR, CZSJ, WXGPCL, LLB, GSRCL
   </sql>
   <sql id="columns_alias">
     t.DATES, t.RCL, t.JTSL, t.SJYL, t.KCL, t.WJZL, t.SCLS, t.LL_1, t.LL_2, t.FGZL_NBHST, 
     t.FGZL_WG, t.LLDLYL, t.WGFG_JFGK, t.WGFG_QXC, t.XCF, t.MEMO, t.CZR, t.CZSJ, t.WXGPCL, 
-    t.LLB
+    t.LLB, t.GSRCL
   </sql>
   <sql id="select">
     SELECT <include refid="columns"/> FROM EMS_SCQK_LG
@@ -100,6 +101,9 @@
       <if test="llb != null">
         and LLB = #{llb}
       </if>
+      <if test="gsrcl != null">
+        and GSRCL = #{gsrcl}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -164,6 +168,9 @@
       <if test="llb != null">
         and LLB = #{llb}
       </if>
+      <if test="gsrcl != null">
+        and GSRCL = #{gsrcl}
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.util.Date">
@@ -230,6 +237,9 @@
       <if test="llb != null">
         or LLB = #{llb}
       </if>
+    <if test="gsrcl != null">
+      or GSRCL = #{gsrcl}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.ems.emsscqklg.model.EmsScqkLg">
     insert into EMS_SCQK_LG (DATES, RCL, JTSL, 
@@ -238,14 +248,14 @@
       FGZL_WG, LLDLYL, WGFG_JFGK, 
       WGFG_QXC, XCF, MEMO, 
       CZR, CZSJ, WXGPCL, 
-      LLB)
+      LLB,GSRCL)
     values (#{dates,jdbcType=TIMESTAMP}, #{rcl,jdbcType=DECIMAL}, #{jtsl,jdbcType=DECIMAL}, 
       #{sjyl,jdbcType=DECIMAL}, #{kcl,jdbcType=DECIMAL}, #{wjzl,jdbcType=DECIMAL}, #{scls,jdbcType=DECIMAL}, 
       #{ll1,jdbcType=DECIMAL}, #{ll2,jdbcType=DECIMAL}, #{fgzlNbhst,jdbcType=DECIMAL}, 
       #{fgzlWg,jdbcType=DECIMAL}, #{lldlyl,jdbcType=DECIMAL}, #{wgfgJfgk,jdbcType=DECIMAL}, 
       #{wgfgQxc,jdbcType=DECIMAL}, #{xcf,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, 
       #{czr,jdbcType=VARCHAR}, #{czsj,jdbcType=TIMESTAMP}, #{wxgpcl,jdbcType=DECIMAL}, 
-      #{llb,jdbcType=DECIMAL})
+      #{llb,jdbcType=DECIMAL},#{gsrcl,jdbcType=DECIMAL})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.ems.emsscqklg.model.EmsScqkLg">
     insert into EMS_SCQK_LG
@@ -310,6 +320,9 @@
       <if test="llb != null">
         LLB,
       </if>
+      <if test="gsrcl != null">
+        GSRCL,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="dates != null">
@@ -372,6 +385,9 @@
       <if test="llb != null">
         #{llb,jdbcType=DECIMAL},
       </if>
+      <if test="gsrcl != null">
+        #{gsrcl,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsscqklg.model.EmsScqkLg">
@@ -394,7 +410,8 @@
       CZR = #{czr,jdbcType=VARCHAR},
       CZSJ = #{czsj,jdbcType=TIMESTAMP},
       WXGPCL = #{wxgpcl,jdbcType=DECIMAL},
-      LLB = #{llb,jdbcType=DECIMAL}
+      LLB = #{llb,jdbcType=DECIMAL},
+      GSRCL = #{gsrcl,jdbcType=DECIMAL}
     where DATES = #{dates,jdbcType=TIMESTAMP}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsscqklg.model.EmsScqkLg">
@@ -457,6 +474,9 @@
       <if test="llb != null">
         LLB = #{llb,jdbcType=DECIMAL},
       </if>
+      <if test="gsrcl != null">
+        GSRCL = #{gsrcl,jdbcType=DECIMAL},
+      </if>
     </set>
     where DATES = #{dates,jdbcType=TIMESTAMP}
   </update>
@@ -481,7 +501,7 @@
       FGZL_WG, LLDLYL, WGFG_JFGK, 
       WGFG_QXC, XCF, MEMO, 
       CZR, CZSJ, WXGPCL, 
-      LLB)
+      LLB, GSRCL)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.dates,jdbcType=TIMESTAMP}, 
@@ -491,7 +511,7 @@
       #{item.fgzlWg,jdbcType=DECIMAL}, #{item.lldlyl,jdbcType=DECIMAL}, #{item.wgfgJfgk,jdbcType=DECIMAL}, 
       #{item.wgfgQxc,jdbcType=DECIMAL}, #{item.xcf,jdbcType=DECIMAL}, #{item.memo,jdbcType=VARCHAR}, 
       #{item.czr,jdbcType=VARCHAR}, #{item.czsj,jdbcType=TIMESTAMP}, #{item.wxgpcl,jdbcType=DECIMAL}, 
-      #{item.llb,jdbcType=DECIMAL} from dual  
+      #{item.llb,jdbcType=DECIMAL}, #{item.gsrcl,jdbcType=DECIMAL} from dual
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -577,6 +597,10 @@
        <foreach collection="list" item="item" index="index" separator=" " open="case DATES" close="end">
           when #{item.dates,jdbcType=TIMESTAMP} then #{item.llb,jdbcType=DECIMAL}
        </foreach>
+    ,GSRCL=
+    <foreach collection="list" item="item" index="index" separator=" " open="case DATES" close="end">
+      when #{item.dates,jdbcType=TIMESTAMP} then #{item.gsrcl,jdbcType=DECIMAL}
+    </foreach>
      where DATES in 
      <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
     #{item.dates,jdbcType=TIMESTAMP}

+ 19 - 0
src/main/java/com/steerinfo/ems/emsscqklg/mapper/LgReal.xml

@@ -0,0 +1,19 @@
+<?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.emsscqklg.mapper.LgRealMapper">
+    <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsscqklg.model.LgReal">
+        <id column="ALTID" jdbcType="VARCHAR" property="altId"/>
+<!--        <id column="TSRCL" jdbcType="VARCHAR" property="rcl"/>-->
+<!--        <id column="ZT" jdbcType="VARCHAR" property="zt"/>-->
+        <id column="ENG" jdbcType="VARCHAR" property="eng"/>
+<!--        <id column="GPYLJ" jdbcType="VARCHAR" property="gpYlj"/>-->
+<!--        <id column="GPNLJ" jdbcType="VARCHAR" property="gpNlj"/>-->
+<!--        <id column="TSYLJ" jdbcType="VARCHAR" property="tsYlj"/>-->
+<!--        <id column="TSNLJ" jdbcType="VARCHAR" property="tsYlj"/>-->
+    </resultMap>
+    <select id="QueryLgReals"  resultMap="BaseResultMap" >
+        SELECT ALTID, ENG
+        FROM JYMES.V_EMS_LG_BOF01 UNPIVOT (	ENG FOR ALTID IN (
+        LG_MES_1ZL_REAL021, LG_MES_1ZL_REAL022, LG_MES_1ZL_REAL023, LG_MES_1ZL_REAL024, LG_MES_1ZL_REAL026, LG_MES_1ZL_REAL027, LG_MES_1ZL_REAL028, LG_MES_1ZL_REAL029, LG_MES_1ZL_REAL030, LG_MES_1ZL_REAL031, LG_MES_1ZL_REAL032, LG_MES_1ZL_REAL033, LG_MES_1ZL_REAL034, LG_MES_1ZL_REAL035, LG_MES_1ZL_REAL036, LG_MES_1ZL_REAL037, LG_MES_1ZL_REAL038, LG_MES_1ZL_REAL039, LG_MES_1ZL_REAL040, LG_MES_1ZL_REAL041, LG_MES_1ZL_REAL042, LG_MES_1ZL_REAL043, LG_MES_1ZL_REAL044, LG_MES_1ZL_REAL045, LG_MES_1ZL_REAL046, LG_MES_1ZL_REAL047, LG_MES_1ZL_REAL048, LG_MES_1ZL_REAL049 ))
+    </select>
+</mapper>

+ 14 - 0
src/main/java/com/steerinfo/ems/emsscqklg/mapper/LgRealMapper.java

@@ -0,0 +1,14 @@
+package com.steerinfo.ems.emsscqklg.mapper;
+
+import com.steerinfo.ems.emsscqklg.model.LgReal;
+
+import java.util.List;
+
+/**
+ * @author Shadow
+ * @create 2021-10-19 9:42
+ * @project xt-ems-datasource
+ */
+public interface LgRealMapper {
+    List<LgReal> QueryLgReals();
+}

+ 15 - 0
src/main/java/com/steerinfo/ems/emsscqklg/model/EmsScqkLg.java

@@ -129,6 +129,12 @@ public class EmsScqkLg implements IBasePO<Date> {
     @ApiModelProperty(value="冷料比",required=false)
     private BigDecimal llb;
 
+    /**
+     * 冷料比(LLB,DECIMAL,0)
+     */
+    @ApiModelProperty(value="钢水日产量",required=false)
+    private BigDecimal gsrcl;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -301,6 +307,14 @@ public class EmsScqkLg implements IBasePO<Date> {
         this.llb = llb;
     }
 
+    public BigDecimal getGsrcl() {
+        return gsrcl;
+    }
+
+    public void setGsrcl(BigDecimal gsrcl) {
+        this.gsrcl = gsrcl;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -327,6 +341,7 @@ public class EmsScqkLg implements IBasePO<Date> {
         sb.append(", czsj=").append(czsj);
         sb.append(", wxgpcl=").append(wxgpcl);
         sb.append(", llb=").append(llb);
+        sb.append(", gsrcl=").append(gsrcl);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 54 - 0
src/main/java/com/steerinfo/ems/emsscqklg/model/LgReal.java

@@ -0,0 +1,54 @@
+package com.steerinfo.ems.emsscqklg.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author Shadow
+ * @create 2021-10-27 21:56
+ * @project xt-ems-datasource
+ */
+@ApiModel(value="炼钢实时数据")
+public class LgReal {
+
+        /**
+         * 点位id(DATES,TIMESTAMP,7)
+         */
+        @ApiModelProperty(value="点位id",required=true)
+        private String altId;
+        /**
+         * 点位值(DATES,TIMESTAMP,7)
+         */
+        @ApiModelProperty(value="点位值",required=true)
+        private String eng;
+
+        private static final long serialVersionUID = 1L;
+
+        public String getAltId() {
+                return altId;
+        }
+
+        public void setAltId(String altId) {
+                this.altId = altId;
+        }
+
+        public String getEng() {
+                return eng;
+        }
+
+        public void setEng(String eng) {
+                this.eng = eng;
+        }
+        @Override
+        public String toString() {
+                StringBuilder sb = new StringBuilder();
+                sb.append(getClass().getSimpleName());
+                sb.append(" [");
+                sb.append("Hash = ").append(hashCode());
+                sb.append(", altid=").append(altId);
+                sb.append(", eng=").append(eng);
+                sb.append(", serialVersionUID=").append(serialVersionUID);
+                sb.append("]");
+                return sb.toString();
+        }
+}

+ 31 - 27
src/main/java/com/steerinfo/ems/emsscqklg/service/EmsLgReportService.java

@@ -1,28 +1,32 @@
-package com.steerinfo.ems.emsscqklg.service;
-
-import com.steerinfo.ems.emsscqklg.model.EmsScqkLg;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.GetMapping;
-
-import java.util.List;
-
-/**
- * EmsScqkLg服务接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-10-19 10:43
- * 类描述
- * 修订历史:
- * 日期:2021-10-19
- * 作者:generator
- * 参考:
- * 描述:EmsScqkLg服务接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
-@FeignClient(value = "xt-ems-datasource")
-@Component
-public interface EmsLgReportService {
-    @GetMapping("v1/lgreport/queryReportByTime")
-    public List<EmsScqkLg> queryReportByTime();
+package com.steerinfo.ems.emsscqklg.service;
+
+import com.steerinfo.ems.emsscqklg.model.EmsScqkLg;
+import com.steerinfo.ems.emsscqklg.model.LgReal;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
+
+import java.util.List;
+
+/**
+ * EmsScqkLg服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-19 10:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-19
+ * 作者:generator
+ * 参考:
+ * 描述:EmsScqkLg服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@FeignClient(value = "xt-ems-datasource")
+@Component
+public interface EmsLgReportService {
+    @GetMapping("v1/lgreport/queryReportByTime")
+    public List<EmsScqkLg> queryReportByTime();
+
+    @GetMapping("v1/lgReal/queryReals")
+    public List<LgReal> queryReals();
 }

+ 15 - 0
src/main/java/com/steerinfo/ems/emsscqklg/service/ILgRealService.java

@@ -0,0 +1,15 @@
+package com.steerinfo.ems.emsscqklg.service;
+
+import com.steerinfo.ems.emsscqklg.model.LgReal;
+import org.apache.axis2.AxisFault;
+
+import java.util.List;
+
+public interface ILgRealService {
+
+    /**
+     *     获取炼钢实时数据
+     */
+    public List<LgReal> QueryLgReals() throws AxisFault;
+
+}

+ 60 - 61
src/main/java/com/steerinfo/ems/emsscqklg/service/impl/EmsScqkLgServiceImpl.java

@@ -1,61 +1,60 @@
-package com.steerinfo.ems.emsscqklg.service.impl;
-
-import com.steerinfo.ems.emsscqklg.mapper.EmsScqkLgMapper;
-import com.steerinfo.ems.emsscqklg.model.EmsScqkLg;
-import com.steerinfo.ems.emsscqklg.service.EmsLgReportService;
-import com.steerinfo.ems.emsscqklg.service.IEmsScqkLgService;
-import com.steerinfo.framework.mapper.IBaseMapper;
-import com.steerinfo.framework.service.impl.BaseServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * EmsScqkLg服务实现:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-10-19 10:43
- * 类描述
- * 修订历史:
- * 日期:2021-10-19
- * 作者:generator
- * 参考:
- * 描述:EmsScqkLg服务实现
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
-@Service(value = "emsScqkLgService")
-public class EmsScqkLgServiceImpl extends BaseServiceImpl<EmsScqkLg, Date> implements IEmsScqkLgService {
-
-    @Autowired
-    private EmsScqkLgMapper emsScqkLgMapper;
-
-    @Autowired
-    private EmsLgReportService emsLgReportService;
-
-    @Override
-    protected IBaseMapper<EmsScqkLg, Date> getMapper() {
-        return emsScqkLgMapper;
-    }
-
-
-    @Override
-    public int dateGenerate() {
-       List<EmsScqkLg> emsScqkLgs =  emsLgReportService.queryReportByTime();
-       EmsScqkLg model;
-       Integer number=0;
-       for(EmsScqkLg emsScqkLg :emsScqkLgs)
-       {
-           emsScqkLg.setCzr("炼钢MES");
-           emsScqkLg.setCzsj(new Date());
-           model = emsScqkLgMapper.selectByPrimaryKey(emsScqkLg.getId());
-           if(model == null){
-              number += emsScqkLgMapper.insert(emsScqkLg);
-              continue;
-           }
-           number += emsScqkLgMapper.updateByPrimaryKeySelective(emsScqkLg);
-       }
-        return number;
-    }
-}
+package com.steerinfo.ems.emsscqklg.service.impl;
+
+import com.steerinfo.ems.emsscqklg.mapper.EmsScqkLgMapper;
+import com.steerinfo.ems.emsscqklg.model.EmsScqkLg;
+import com.steerinfo.ems.emsscqklg.service.EmsLgReportService;
+import com.steerinfo.ems.emsscqklg.service.IEmsScqkLgService;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * EmsScqkLg服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-19 10:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-19
+ * 作者:generator
+ * 参考:
+ * 描述:EmsScqkLg服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "emsScqkLgService")
+public class EmsScqkLgServiceImpl extends BaseServiceImpl<EmsScqkLg, Date> implements IEmsScqkLgService {
+
+    @Autowired
+    private EmsScqkLgMapper emsScqkLgMapper;
+
+    @Autowired
+    private EmsLgReportService emsLgReportService;
+
+    @Override
+    protected IBaseMapper<EmsScqkLg, Date> getMapper() {
+        return emsScqkLgMapper;
+    }
+
+    @Override
+    public int dateGenerate() {
+       List<EmsScqkLg> emsScqkLgs =  emsLgReportService.queryReportByTime();
+       EmsScqkLg model;
+       Integer number=0;
+       for(EmsScqkLg emsScqkLg :emsScqkLgs)
+       {
+           emsScqkLg.setCzr("炼钢MES");
+           emsScqkLg.setCzsj(new Date());
+           model = emsScqkLgMapper.selectByPrimaryKey(emsScqkLg.getId());
+           if(model == null){
+              number += emsScqkLgMapper.insert(emsScqkLg);
+              continue;
+           }
+           number += emsScqkLgMapper.updateByPrimaryKeySelective(emsScqkLg);
+       }
+        return number;
+    }
+}

+ 62 - 0
src/main/java/com/steerinfo/ems/emsscqklg/service/impl/LgRealImpl.java

@@ -0,0 +1,62 @@
+package com.steerinfo.ems.emsscqklg.service.impl;
+
+import com.client.MswebserviceStub;
+import com.steerinfo.ems.Utils.MosaicUtils;
+import com.steerinfo.ems.Utils.StrUtils;
+import com.steerinfo.ems.emsscqklg.mapper.LgRealMapper;
+import com.steerinfo.ems.emsscqklg.model.LgReal;
+import com.steerinfo.ems.emsscqklg.service.EmsLgReportService;
+import com.steerinfo.ems.emsscqklg.service.ILgRealService;
+import org.apache.axis2.AxisFault;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service("lgRealService")
+public class LgRealImpl  implements ILgRealService {
+
+    private static final Logger logger = LoggerFactory.getLogger(LgRealImpl.class);
+
+    @Autowired
+    private LgRealMapper lgRealMapper;
+
+    @Autowired
+    private EmsLgReportService emsLgReportService;
+
+
+
+
+    @Override
+    public List<LgReal> QueryLgReals() throws AxisFault {
+        List<LgReal> lgReals = emsLgReportService.queryReals();
+        MswebserviceStub stub;
+
+        if (lgReals.size() < 1) {
+            logger.info("当前没有数据");
+            return emsLgReportService.queryReals();
+        }
+        try{
+            stub = new MswebserviceStub("http://172.16.90.229:9900");
+
+            // Open
+            MosaicUtils.SetOpenConnSample(stub);
+
+            for (LgReal model : lgReals) {
+                if (!StrUtils.isNumeric(model.getEng().trim())) {
+                    continue;
+                }
+                String sql = "update Ana set Eng='"+Double.parseDouble(model.getEng().trim())+"' where AltId='"+ model.getAltId()+"'";
+                MosaicUtils.SetUpdateValue(stub, sql);
+            }
+            // Close
+            MosaicUtils.SetCloseConnSample(stub);
+        } catch (AxisFault e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return emsLgReportService.queryReals();
+    }
+}

+ 109 - 109
src/main/java/com/steerinfo/ems/rttable/service/impl/RttableServiceImpl.java

@@ -1,109 +1,109 @@
-package com.steerinfo.ems.rttable.service.impl;
-
-import com.steerinfo.ems.Utils.DateUtils;
-import com.steerinfo.ems.rttable.mapper.RttableMapper;
-import com.steerinfo.ems.rttable.model.Rttable;
-import com.steerinfo.ems.rttable.service.IRttableService;
-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.math.BigDecimal;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * Rttable服务实现:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-10-15 03:37
- * 类描述
- * 修订历史:
- * 日期:2021-10-15
- * 作者:generator
- * 参考:
- * 描述:Rttable服务实现
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
-@Service(value = "rttableService")
-public class RttableServiceImpl extends BaseServiceImpl<Rttable, BigDecimal> implements IRttableService {
-    private static final Logger logger = LoggerFactory.getLogger(RttableServiceImpl.class);
-    @Autowired
-    private RttableMapper rttableMapper;
-
-    @Override
-    protected IBaseMapper<Rttable, BigDecimal> getMapper() {
-        return rttableMapper;
-    }
-
-    @Override
-    public int dataGeneration() {
-
-        int addSize = 0;
-        int updateSize = 0;
-        try {
-            Rttable model;
-            // emsWaterRealtimeMapper.selectByPrimaryKey("1");//.getWaterListByArmMeter();
-            //List<EmsWaterRealtime> emsWaterRealtimeList = getWaterListByArmMeter();
-            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<Rttable> rttableList = rttableMapper.selectByParameters(hashMap);
-            StringBuffer sub = new StringBuffer();
-            String table="EMS_POWER";
-            for (Rttable rttable : rttableList){
-                addSize ++ ;
-                //多个表生成数据就填加table;
-                String sql = ",TAG"+ addSize+ " = " + "'" + rttable.getRtvalue() + "'";
-                sub.append(sql);
-            }
-            hashMap.put("table",table);
-            hashMap.put("sql",sub.toString());
-            updateSize += rttableMapper.updatePowerMinutes(hashMap);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            logger.info("本次总共新增动力数据条数:" + addSize);
-            logger.info("本次总共更新动力数据条数:" + updateSize);
-        }
-        return addSize+updateSize;
-    }
-
-
-    @Override
-    public int getPowerTenMinutes() {
-        int addSize = 0;
-        int updateSize = 0;
-        int i = 0;
-        try {
-            Rttable model;
-            // emsWaterRealtimeMapper.selectByPrimaryKey("1");//.getWaterListByArmMeter();
-            String clock1 = DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss");
-            HashMap<String,Object> hashMap = new HashMap<String,Object>();
-            hashMap.put("clock1",clock1);
-            addSize += rttableMapper.insertPowerTenMinutes(hashMap);
-            StringBuffer sub = new StringBuffer();
-            List<Rttable> rttableList = rttableMapper.selectByParameters(hashMap);
-            String table="EMS_POWER_TIMING";
-            for (Rttable rttable : rttableList){
-                i++;
-                String sql = "TAG"+ i+ " = " + "'" + rttable.getRtvalue() + "',";
-                sub.append(sql);
-            }
-            hashMap.put("table",table);
-            hashMap.put("sql",sub.toString());
-            updateSize += rttableMapper.updatePowerTenMinutes(hashMap);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            logger.info("本次总共新增动力十分钟数据条数:" + addSize);
-            logger.info("本次总共更新动力十分钟数据条数:" + updateSize);
-        }
-
-        return addSize+updateSize;
-    }
-}
+package com.steerinfo.ems.rttable.service.impl;
+
+import com.steerinfo.ems.Utils.DateUtils;
+import com.steerinfo.ems.rttable.mapper.RttableMapper;
+import com.steerinfo.ems.rttable.model.Rttable;
+import com.steerinfo.ems.rttable.service.IRttableService;
+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.math.BigDecimal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Rttable服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-15 03:37
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-15
+ * 作者:generator
+ * 参考:
+ * 描述:Rttable服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "rttableService")
+public class RttableServiceImpl extends BaseServiceImpl<Rttable, BigDecimal> implements IRttableService {
+    private static final Logger logger = LoggerFactory.getLogger(RttableServiceImpl.class);
+    @Autowired
+    private RttableMapper rttableMapper;
+
+    @Override
+    protected IBaseMapper<Rttable, BigDecimal> getMapper() {
+        return rttableMapper;
+    }
+
+    @Override
+    public int dataGeneration() {
+
+        int addSize = 0;
+        int updateSize = 0;
+        try {
+            Rttable model;
+            // emsWaterRealtimeMapper.selectByPrimaryKey("1");//.getWaterListByArmMeter();
+            //List<EmsWaterRealtime> emsWaterRealtimeList = getWaterListByArmMeter();
+            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<Rttable> rttableList = rttableMapper.selectByParameters(hashMap);
+            StringBuffer sub = new StringBuffer();
+            String table="EMS_POWER";
+            for (Rttable rttable : rttableList){
+                addSize ++ ;
+                //多个表生成数据就填加table;
+                String sql = ",TAG"+ addSize+ " = " + "'" + rttable.getRtvalue() + "'";
+                sub.append(sql);
+            }
+            hashMap.put("table",table);
+            hashMap.put("sql",sub.toString());
+            updateSize += rttableMapper.updatePowerMinutes(hashMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            logger.info("本次总共新增五分钟动力数据条数:" + addSize);
+            logger.info("本次总共更新五分钟动力数据条数:" + updateSize);
+        }
+        return addSize+updateSize;
+    }
+
+
+    @Override
+    public int getPowerTenMinutes() {
+        int addSize = 0;
+        int updateSize = 0;
+        int i = 0;
+        try {
+            Rttable model;
+            // emsWaterRealtimeMapper.selectByPrimaryKey("1");//.getWaterListByArmMeter();
+            String clock1 = DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss");
+            HashMap<String,Object> hashMap = new HashMap<String,Object>();
+            hashMap.put("clock1",clock1);
+            addSize += rttableMapper.insertPowerTenMinutes(hashMap);
+            StringBuffer sub = new StringBuffer();
+            List<Rttable> rttableList = rttableMapper.selectByParameters(hashMap);
+            String table="EMS_POWER_TIMING";
+            for (Rttable rttable : rttableList){
+                i++;
+                String sql = "TAG"+ i+ " = " + "'" + rttable.getRtvalue() + "',";
+                sub.append(sql);
+            }
+            hashMap.put("table",table);
+            hashMap.put("sql",sub.toString());
+            updateSize += rttableMapper.updatePowerTenMinutes(hashMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            logger.info("本次总共新增动力十分钟数据条数:" + addSize);
+            logger.info("本次总共更新动力十分钟数据条数:" + updateSize);
+        }
+
+        return addSize+updateSize;
+    }
+}

+ 6 - 1
src/main/java/com/steerinfo/ems/trmcalpoint/controller/TRmCalpointController.java

@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.text.ParseException;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -187,6 +187,7 @@ public class TRmCalpointController extends BaseRESTfulController {
         if(model.getRecTime() == null || "".equals(model.getRecTime())){
             model.setRecTime(DateUtils.getCurrentTime("yyyy-MM-dd HH:mm:ss"));
         }
+        model.setRecman(JwtUtil.getUseridByToken());
         TRmCalpoint tRmCalpoint = tRmCalpointService.add(model);
         Formula formula = new Formula();
         formula.setCode(model.getItemid());
@@ -254,6 +255,8 @@ public class TRmCalpointController extends BaseRESTfulController {
         	}
         }
         model.setItemid(id);
+        model.setUpdateman(JwtUtil.getUseridByToken());
+        model.setUpdatetime(new Date());
         List<Formula> formulaList = formulaService.getAssociatedFormula(id);
         if("0".equals(model.getUseflag()) && formulaList != null && formulaList.size() > 0){
             String ids = "";
@@ -295,6 +298,8 @@ public class TRmCalpointController extends BaseRESTfulController {
         	tl.setWorkshop(model.getNetworkid()); // 站所
         	tl.setMods(model.getTagModulus().intValue());
         	tl.setWorkprocid(model.getCostid());
+            tl.setUpdateman(JwtUtil.getUseridByToken());
+            tl.setUpdatetime(new Date());
         	tRmElectricityLocationMapper.updateByPrimaryKeySelective(tl);
         }
         LOGGER.info("计量点维护表修改前数据是" + old.toString());

+ 17 - 3
src/main/java/com/steerinfo/task/SpringCronTask.java

@@ -6,6 +6,7 @@ import com.steerinfo.ems.dzmaterialsf.service.IDzMaterialSfService;
 import com.steerinfo.ems.emsetiming.service.IEmsETimingService;
 import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
 import com.steerinfo.ems.emsscqklg.service.IEmsScqkLgService;
+import com.steerinfo.ems.emsscqklg.service.ILgRealService;
 import com.steerinfo.ems.emswaterrealtime.service.IEmsWaterRealtimeService;
 import com.steerinfo.ems.ifemsmesactitem.service.IIfEmsMesActitemService;
 import com.steerinfo.ems.ifmesemsproductorder.service.IIfMesEmsProductorderService;
@@ -44,8 +45,10 @@ import org.springframework.scheduling.support.CronTrigger;
 import org.springframework.stereotype.Service;
 
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ScheduledFuture;
 
@@ -117,6 +120,8 @@ public class SpringCronTask implements SchedulingConfigurer{
 	IRttableService rttableService;
 	@Autowired
 	IEmsScqkLgService emsScqkLgService;
+	@Autowired
+	ILgRealService lgRealService;
 	/**
 	 * SchedulingConfigurer接口的方法实现,加载后自动运行
 	 */
@@ -300,7 +305,16 @@ public class SpringCronTask implements SchedulingConfigurer{
 					 dzMaterialSfService.dataGeneration();
 					 emsScqkLgService.dateGenerate();
 					 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
-				 }
+				} //else if (taskId.equalsIgnoreCase("124")) {
+				// // 每10秒获取一次炼钢实时数据传入mosaic
+				// long start = System.currentTimeMillis();
+				// try {
+				//	 lgRealService.QueryLgReals();
+				// } catch (AxisFault e) {
+				//	 e.printStackTrace();
+				// }
+				// logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
+				//}
 //				 else if (taskId.equalsIgnoreCase("124")) {
 //					 Date now = new Date();
 //					 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -34,7 +34,7 @@ server:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://root:root@${EUREKA_HOST:172.16.90.238}:${EUREKA_PORT:8086}/eureka/
+      defaultZone: http://root:root@${EUREKA_HOST:172.16.90.225}:${EUREKA_PORT:8086}/eureka/
     metadata-map:
       cluster: ribbon
   instance: