xieb vor 4 Jahren
Ursprung
Commit
537c4b1590
13 geänderte Dateien mit 561 neuen und 262 gelöschten Zeilen
  1. 86 60
      src/main/java/com/steerinfo/baseinfo/meterbasecarblacelist/mapper/MeterBaseCarBlacelistMapper.xml
  2. 23 8
      src/main/java/com/steerinfo/baseinfo/meterbasecarblacelist/model/MeterBaseCarBlacelist.java
  3. 50 1
      src/main/java/com/steerinfo/metermonitor/metermonitornote/mapper/MeterMonitorNoteMapper.xml
  4. 4 1
      src/main/java/com/steerinfo/metermonitor/metermonitornotecar/mapper/MeterMonitorNoteCarMapper.xml
  5. 24 0
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/controller/MeterWorkCarActualController.java
  6. 4 0
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/IMeterWorkCarActualService.java
  7. 20 1
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/impl/MeterWorkCarActualServiceImpl.java
  8. 5 7
      src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/controller/MeterWorkCarActualFirstController.java
  9. 3 1
      src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/service/IMeterWorkCarActualFirstService.java
  10. 134 6
      src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/service/impl/MeterWorkCarActualFirstServiceImpl.java
  11. 1 3
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/impl/MeterWorkRailwayActFirstServiceImpl.java
  12. 192 174
      src/main/java/com/steerinfo/meterwork/meterworkzeroalarm/mapper/MeterWorkZeroAlarmMapper.xml
  13. 15 0
      src/main/java/com/steerinfo/meterwork/meterworkzeroalarm/model/MeterWorkZeroAlarm.java

+ 86 - 60
src/main/java/com/steerinfo/baseinfo/meterbasecarblacelist/mapper/MeterBaseCarBlacelistMapper.xml

@@ -22,28 +22,29 @@
     <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
     <result column="PUNISH_TYPE_NO" jdbcType="VARCHAR" property="punishTypeNo" />
     <result column="PUNISH_TYPE_NAME" jdbcType="VARCHAR" property="punishTypeName" />
-    <result column="BLACK_LEVEL" jdbcType="VARCHAR" property="blackLevel" />
+    <result column="BLACK_LEVEL_NO" jdbcType="VARCHAR" property="blackLevelNo" />
     <result column="OPERATION_UNIT" jdbcType="VARCHAR" property="operationUnit" />
     <result column="CHANGE_MEMO" jdbcType="VARCHAR" property="changeMemo" />
+    <result column="BLACK_LEVEL_NAME" jdbcType="VARCHAR" property="blackLevelName" />
   </resultMap>
   <sql id="columns">
     BLACELIST_NO, CAR_NO, CAR_OWNER_NAME, CAR_DRIVER_NAME, CAR_UNDER_UNIT, PUNISH_REASON,
     PUNISH_RESULT, VALUE_FLAG, MEMO, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO,
     UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME, PUNISH_TYPE_NO,
-    PUNISH_TYPE_NAME, BLACK_LEVEL, OPERATION_UNIT, CHANGE_MEMO
+    PUNISH_TYPE_NAME, BLACK_LEVEL_NO, OPERATION_UNIT, CHANGE_MEMO, BLACK_LEVEL_NAME
   </sql>
   <sql id="columns_alias">
     t.BLACELIST_NO, t.CAR_NO, t.CAR_OWNER_NAME, t.CAR_DRIVER_NAME, t.CAR_UNDER_UNIT,
     t.PUNISH_REASON, t.PUNISH_RESULT, t.VALUE_FLAG, t.MEMO, t.CREATE_MAN_NO, t.CREATE_MAN_NAME,
     t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.DELETE_MAN_NO,
-    t.DELETE_MAN_NAME, t.DELETE_TIME, t.PUNISH_TYPE_NO, t.PUNISH_TYPE_NAME, t.BLACK_LEVEL,
-    t.OPERATION_UNIT, t.CHANGE_MEMO
+    t.DELETE_MAN_NAME, t.DELETE_TIME, t.PUNISH_TYPE_NO, t.PUNISH_TYPE_NAME, t.BLACK_LEVEL_NO,
+    t.OPERATION_UNIT, t.CHANGE_MEMO, t.BLACK_LEVEL_NAME
   </sql>
   <sql id="select">
-    SELECT <include refid="columns" /> FROM METER_BASE_CAR_BLACELIST
+    SELECT <include refid="columns"/> FROM METER_BASE_CAR_BLACELIST
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias" /> FROM METER_BASE_CAR_BLACELIST t
+    SELECT <include refid="columns_alias"/> FROM METER_BASE_CAR_BLACELIST t
   </sql>
   <sql id="where">
     <where>
@@ -107,8 +108,8 @@
       <if test="punishTypeName != null and punishTypeName != ''">
         and PUNISH_TYPE_NAME = #{punishTypeName}
       </if>
-      <if test="blackLevel != null and blackLevel != ''">
-        and BLACK_LEVEL = #{blackLevel}
+      <if test="blackLevelNo != null and blackLevelNo != ''">
+        and BLACK_LEVEL_NO = #{blackLevelNo}
       </if>
       <if test="operationUnit != null and operationUnit != ''">
         and OPERATION_UNIT = #{operationUnit}
@@ -116,6 +117,9 @@
       <if test="changeMemo != null and changeMemo != ''">
         and CHANGE_MEMO = #{changeMemo}
       </if>
+      <if test="blackLevelName != null and blackLevelName != ''">
+        and BLACK_LEVEL_NAME = #{blackLevelName}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -180,8 +184,8 @@
       <if test="punishTypeName != null and punishTypeName != ''">
         and PUNISH_TYPE_NAME LIKE '%${punishTypeName}%'
       </if>
-      <if test="blackLevel != null and blackLevel != ''">
-        and BLACK_LEVEL LIKE '%${blackLevel}%'
+      <if test="blackLevelNo != null and blackLevelNo != ''">
+        and BLACK_LEVEL_NO LIKE '%${blackLevelNo}%'
       </if>
       <if test="operationUnit != null and operationUnit != ''">
         and OPERATION_UNIT LIKE '%${operationUnit}%'
@@ -189,6 +193,9 @@
       <if test="changeMemo != null and changeMemo != ''">
         and CHANGE_MEMO LIKE '%${changeMemo}%'
       </if>
+      <if test="blackLevelName != null and blackLevelName != ''">
+        and BLACK_LEVEL_NAME LIKE '%${blackLevelName}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
@@ -255,8 +262,8 @@
     <if test="punishTypeName != null and punishTypeName != ''">
       or PUNISH_TYPE_NAME = #{punishTypeName}
     </if>
-    <if test="blackLevel != null and blackLevel != ''">
-      or BLACK_LEVEL = #{blackLevel}
+    <if test="blackLevelNo != null and blackLevelNo != ''">
+      or BLACK_LEVEL_NO = #{blackLevelNo}
     </if>
     <if test="operationUnit != null and operationUnit != ''">
       or OPERATION_UNIT = #{operationUnit}
@@ -264,6 +271,9 @@
     <if test="changeMemo != null and changeMemo != ''">
       or CHANGE_MEMO = #{changeMemo}
     </if>
+    <if test="blackLevelName != null and blackLevelName != ''">
+      or BLACK_LEVEL_NAME = #{blackLevelName}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasecarblacelist.model.MeterBaseCarBlacelist">
     insert into METER_BASE_CAR_BLACELIST (BLACELIST_NO, CAR_NO, CAR_OWNER_NAME,
@@ -272,16 +282,18 @@
                                           CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
                                           UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
                                           DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME,
-                                          PUNISH_TYPE_NO, PUNISH_TYPE_NAME, BLACK_LEVEL,
-                                          OPERATION_UNIT, CHANGE_MEMO)
+                                          PUNISH_TYPE_NO, PUNISH_TYPE_NAME, BLACK_LEVEL_NO,
+                                          OPERATION_UNIT, CHANGE_MEMO, BLACK_LEVEL_NAME
+    )
     values (#{blacelistNo,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, #{carOwnerName,jdbcType=VARCHAR},
             #{carDriverName,jdbcType=VARCHAR}, #{carUnderUnit,jdbcType=VARCHAR}, #{punishReason,jdbcType=VARCHAR},
             #{punishResult,jdbcType=VARCHAR}, #{valueFlag,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR},
             #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
             #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
             #{deleteManNo,jdbcType=VARCHAR}, #{deleteManName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP},
-            #{punishTypeNo,jdbcType=VARCHAR}, #{punishTypeName,jdbcType=VARCHAR}, #{blackLevel,jdbcType=VARCHAR},
-            #{operationUnit,jdbcType=VARCHAR}, #{changeMemo,jdbcType=VARCHAR})
+            #{punishTypeNo,jdbcType=VARCHAR}, #{punishTypeName,jdbcType=VARCHAR}, #{blackLevelNo,jdbcType=VARCHAR},
+            #{operationUnit,jdbcType=VARCHAR}, #{changeMemo,jdbcType=VARCHAR}, #{blackLevelName,jdbcType=VARCHAR}
+           )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasecarblacelist.model.MeterBaseCarBlacelist">
     insert into METER_BASE_CAR_BLACELIST
@@ -346,8 +358,8 @@
       <if test="punishTypeName != null">
         PUNISH_TYPE_NAME,
       </if>
-      <if test="blackLevel != null">
-        BLACK_LEVEL,
+      <if test="blackLevelNo != null">
+        BLACK_LEVEL_NO,
       </if>
       <if test="operationUnit != null">
         OPERATION_UNIT,
@@ -355,6 +367,9 @@
       <if test="changeMemo != null">
         CHANGE_MEMO,
       </if>
+      <if test="blackLevelName != null">
+        BLACK_LEVEL_NAME,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="blacelistNo != null">
@@ -417,8 +432,8 @@
       <if test="punishTypeName != null">
         #{punishTypeName,jdbcType=VARCHAR},
       </if>
-      <if test="blackLevel != null">
-        #{blackLevel,jdbcType=VARCHAR},
+      <if test="blackLevelNo != null">
+        #{blackLevelNo,jdbcType=VARCHAR},
       </if>
       <if test="operationUnit != null">
         #{operationUnit,jdbcType=VARCHAR},
@@ -426,6 +441,9 @@
       <if test="changeMemo != null">
         #{changeMemo,jdbcType=VARCHAR},
       </if>
+      <if test="blackLevelName != null">
+        #{blackLevelName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasecarblacelist.model.MeterBaseCarBlacelist">
@@ -449,9 +467,10 @@
         DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
         PUNISH_TYPE_NO = #{punishTypeNo,jdbcType=VARCHAR},
         PUNISH_TYPE_NAME = #{punishTypeName,jdbcType=VARCHAR},
-        BLACK_LEVEL = #{blackLevel,jdbcType=VARCHAR},
+        BLACK_LEVEL_NO = #{blackLevelNo,jdbcType=VARCHAR},
         OPERATION_UNIT = #{operationUnit,jdbcType=VARCHAR},
-        CHANGE_MEMO = #{changeMemo,jdbcType=VARCHAR}
+        CHANGE_MEMO = #{changeMemo,jdbcType=VARCHAR},
+        BLACK_LEVEL_NAME = #{blackLevelName,jdbcType=VARCHAR}
     where BLACELIST_NO = #{blacelistNo,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasecarblacelist.model.MeterBaseCarBlacelist">
@@ -514,8 +533,8 @@
       <if test="punishTypeName != null">
         PUNISH_TYPE_NAME = #{punishTypeName,jdbcType=VARCHAR},
       </if>
-      <if test="blackLevel != null">
-        BLACK_LEVEL = #{blackLevel,jdbcType=VARCHAR},
+      <if test="blackLevelNo != null">
+        BLACK_LEVEL_NO = #{blackLevelNo,jdbcType=VARCHAR},
       </if>
       <if test="operationUnit != null">
         OPERATION_UNIT = #{operationUnit,jdbcType=VARCHAR},
@@ -523,20 +542,23 @@
       <if test="changeMemo != null">
         CHANGE_MEMO = #{changeMemo,jdbcType=VARCHAR},
       </if>
+      <if test="blackLevelName != null">
+        BLACK_LEVEL_NAME = #{blackLevelName,jdbcType=VARCHAR},
+      </if>
     </set>
     where BLACELIST_NO = #{blacelistNo,jdbcType=VARCHAR}
   </update>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <include refid="select" />
+    <include refid="select"/>
     where BLACELIST_NO = #{blacelistNo,jdbcType=VARCHAR}
   </select>
   <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select" />
-    <include refid="where" />
+    <include refid="select"/>
+    <include refid="where"/>
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select" />
-    <include refid="whereLike" />
+    <include refid="select"/>
+    <include refid="whereLike"/>
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
     insert into METER_BASE_CAR_BLACELIST
@@ -548,8 +570,8 @@
     UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
     DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME,
     PUNISH_TYPE_NO, PUNISH_TYPE_NAME,
-    BLACK_LEVEL, OPERATION_UNIT, CHANGE_MEMO
-    )
+    BLACK_LEVEL_NO, OPERATION_UNIT,
+    CHANGE_MEMO, BLACK_LEVEL_NAME)
     ( <foreach collection="list" item="item" separator="union all">
     select
     #{item.blacelistNo,jdbcType=VARCHAR},
@@ -560,114 +582,118 @@
     #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
     #{item.deleteManNo,jdbcType=VARCHAR}, #{item.deleteManName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
     #{item.punishTypeNo,jdbcType=VARCHAR}, #{item.punishTypeName,jdbcType=VARCHAR},
-    #{item.blackLevel,jdbcType=VARCHAR}, #{item.operationUnit,jdbcType=VARCHAR}, #{item.changeMemo,jdbcType=VARCHAR}
-    from dual
+    #{item.blackLevelNo,jdbcType=VARCHAR}, #{item.operationUnit,jdbcType=VARCHAR},
+    #{item.changeMemo,jdbcType=VARCHAR}, #{item.blackLevelName,jdbcType=VARCHAR} from dual
   </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
     update METER_BASE_CAR_BLACELIST
     set
     BLACELIST_NO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.blacelistNo,jdbcType=VARCHAR}
     </foreach>
     ,CAR_NO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
     </foreach>
     ,CAR_OWNER_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.carOwnerName,jdbcType=VARCHAR}
     </foreach>
     ,CAR_DRIVER_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.carDriverName,jdbcType=VARCHAR}
     </foreach>
     ,CAR_UNDER_UNIT=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.carUnderUnit,jdbcType=VARCHAR}
     </foreach>
     ,PUNISH_REASON=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.punishReason,jdbcType=VARCHAR}
     </foreach>
     ,PUNISH_RESULT=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.punishResult,jdbcType=VARCHAR}
     </foreach>
     ,VALUE_FLAG=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
     </foreach>
     ,MEMO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
     </foreach>
     ,CREATE_MAN_NO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
     </foreach>
     ,CREATE_MAN_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
     </foreach>
     ,CREATE_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
     </foreach>
     ,UPDATE_MAN_NO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
     </foreach>
     ,UPDATE_MAN_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
     </foreach>
     ,UPDATE_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
     </foreach>
     ,DELETE_MAN_NO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
     </foreach>
     ,DELETE_MAN_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
     </foreach>
     ,DELETE_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
     </foreach>
     ,PUNISH_TYPE_NO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.punishTypeNo,jdbcType=VARCHAR}
     </foreach>
     ,PUNISH_TYPE_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.punishTypeName,jdbcType=VARCHAR}
     </foreach>
-    ,BLACK_LEVEL=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
-      when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.blackLevel,jdbcType=VARCHAR}
+    ,BLACK_LEVEL_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
+      when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.blackLevelNo,jdbcType=VARCHAR}
     </foreach>
     ,OPERATION_UNIT=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.operationUnit,jdbcType=VARCHAR}
     </foreach>
     ,CHANGE_MEMO=
-    <foreach close="end" collection="list" index="index" item="item" open="case BLACELIST_NO" separator=" ">
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
       when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.changeMemo,jdbcType=VARCHAR}
     </foreach>
+    ,BLACK_LEVEL_NAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case BLACELIST_NO" close="end">
+      when #{item.blacelistNo,jdbcType=VARCHAR} then #{item.blackLevelName,jdbcType=VARCHAR}
+    </foreach>
     where BLACELIST_NO in
-    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
       #{item.blacelistNo,jdbcType=VARCHAR}
     </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from METER_BASE_CAR_BLACELIST
     where BLACELIST_NO in
-    <foreach close=")" collection="list" item="id" open="(" separator=",">
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
       #{id}
     </foreach>
   </delete>

+ 23 - 8
src/main/java/com/steerinfo/baseinfo/meterbasecarblacelist/model/MeterBaseCarBlacelist.java

@@ -126,10 +126,10 @@ public class MeterBaseCarBlacelist implements IBasePO<String> {
     private String punishTypeName;
 
     /**
-     * 黑名单级别(BLACK_LEVEL,VARCHAR,30)
+     * 黑名单级别编码(BLACK_LEVEL_NO,VARCHAR,30)
      */
-    @ApiModelProperty(value="黑名单级别",required=false)
-    private String blackLevel;
+    @ApiModelProperty(value="黑名单级别编码",required=false)
+    private String blackLevelNo;
 
     /**
      * 操作部门(OPERATION_UNIT,VARCHAR,50)
@@ -143,6 +143,12 @@ public class MeterBaseCarBlacelist implements IBasePO<String> {
     @ApiModelProperty(value="黑名单级别更改备注",required=false)
     private String changeMemo;
 
+    /**
+     * 黑名单级别名称(BLACK_LEVEL_NAME,VARCHAR,30)
+     */
+    @ApiModelProperty(value="黑名单级别名称",required=false)
+    private String blackLevelName;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -315,12 +321,12 @@ public class MeterBaseCarBlacelist implements IBasePO<String> {
         this.punishTypeName = punishTypeName == null ? null : punishTypeName.trim();
     }
 
-    public String getBlackLevel() {
-        return blackLevel;
+    public String getBlackLevelNo() {
+        return blackLevelNo;
     }
 
-    public void setBlackLevel(String blackLevel) {
-        this.blackLevel = blackLevel == null ? null : blackLevel.trim();
+    public void setBlackLevelNo(String blackLevelNo) {
+        this.blackLevelNo = blackLevelNo == null ? null : blackLevelNo.trim();
     }
 
     public String getOperationUnit() {
@@ -339,6 +345,14 @@ public class MeterBaseCarBlacelist implements IBasePO<String> {
         this.changeMemo = changeMemo == null ? null : changeMemo.trim();
     }
 
+    public String getBlackLevelName() {
+        return blackLevelName;
+    }
+
+    public void setBlackLevelName(String blackLevelName) {
+        this.blackLevelName = blackLevelName == null ? null : blackLevelName.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -365,9 +379,10 @@ public class MeterBaseCarBlacelist implements IBasePO<String> {
         sb.append(", deleteTime=").append(deleteTime);
         sb.append(", punishTypeNo=").append(punishTypeNo);
         sb.append(", punishTypeName=").append(punishTypeName);
-        sb.append(", blackLevel=").append(blackLevel);
+        sb.append(", blackLevelNo=").append(blackLevelNo);
         sb.append(", operationUnit=").append(operationUnit);
         sb.append(", changeMemo=").append(changeMemo);
+        sb.append(", blackLevelName=").append(blackLevelName);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 50 - 1
src/main/java/com/steerinfo/metermonitor/metermonitornote/mapper/MeterMonitorNoteMapper.xml

@@ -594,5 +594,54 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  
+  <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
+    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(NOTE_NO, LENGTH(NOTE_NO) - 3))),0) + 1,4,'0') NOTE_NO
+    FROM METER_monitor_note where instr(NOTE_NO,#{afl,jdbcType=VARCHAR})>0
+  </select>
+  <select id="selectView" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    SELECT <include refid="columns"/> from METER_MONITOR_NOTE_VIEW
+    <where>
+      <if test="baseSpotNo != null and baseSpotNo != ''">
+        and BASE_SPOT_NO = #{baseSpotNo}
+      </if>
+      <if test="baseSpotName != null and baseSpotName != ''">
+        and BASE_SPOT_NAME = #{baseSpotName}
+      </if>
+      <if test="operationTime1 != null and operationTime1 != ''">
+        and OPERATION_TIME >= #{operationTime1}
+      </if>
+      <if test="operationTime2 != null and operationTime2!= ''">
+        and OPERATION_TIME &lt;= #{operationTime2}
+      </if>
+      <if test="meterNoteSource != null and meterNoteSource != ''">
+        and METER_NOTE_SOURCE = #{meterNoteSource}
+      </if>
+      and base_spot_no in
+      (select t1.base_spot_no
+      from METER_BASE_SPOT_INFO t1
+      where t1.spot_type_no = #{spotTypeNo})
+    </where>
+    order  by OPERATION_TIME desc
+  </select>
+
+  <select id="selectByTime" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    SELECT <include refid="columns"/> from METER_MONITOR_NOTE
+    where BASE_SPOT_NO = #{baseSpotNo} and CAR_NO = #{carNo}
+    and to_date(OPERATION_TIME ,'yyyy-mm-dd HH24:mi:ss') >= to_date(#{operationTime},'yyyy-mm-dd HH24:mi:ss')-3/24/60
+    and to_date(OPERATION_TIME ,'yyyy-mm-dd HH24:mi:ss') &lt;= to_date(#{operationTime},'yyyy-mm-dd HH24:mi:ss') + 1/(24*60)
+  </select>
+
+  <select id="selectByType" parameterType="java.lang.String" resultMap="BaseResultMap">
+    SELECT <include refid="columns"/> from METER_MONITOR_NOTE
+    <where>
+      1 = 1
+      <if test="meterNoteSource != null and meterNoteSource != ''">
+        and METER_NOTE_SOURCE = #{meterNoteSource}
+      </if>
+      and base_spot_no in
+      (select t1.base_spot_no
+      from METER_BASE_SPOT_INFO t1
+      where t1.spot_type_no = #{spotTypeNo})
+    </where>
+  </select>
 </mapper>

+ 4 - 1
src/main/java/com/steerinfo/metermonitor/metermonitornotecar/mapper/MeterMonitorNoteCarMapper.xml

@@ -492,5 +492,8 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  
+  <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
+    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(NOTE_NO, LENGTH(NOTE_NO) - 3))),0) + 1,4,'0') NOTE_NO
+    FROM METER_monitor_note_car where instr(NOTE_NO,#{afl,jdbcType=VARCHAR})>0
+  </select>
 </mapper>

+ 24 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/controller/MeterWorkCarActualController.java

@@ -6,11 +6,16 @@ import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote;
+import com.steerinfo.meterwork.dto.CommonCombination;
 import com.steerinfo.meterwork.except.MarkerMetException;
 import com.steerinfo.meterwork.metertolimsold.mapper.MeterToLimsOldMapper;
 import com.steerinfo.meterwork.meterworkcaractual.mapper.MeterWorkCarActualMapper;
 import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
 import com.steerinfo.meterwork.meterworkcaractual.service.IMeterWorkCarActualService;
+import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
+import com.steerinfo.meterwork.meterworkrailwayactfirst.model.MeterWorkRailwayActFirst;
+import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
 import com.steerinfo.util.CommonPage;
 import com.steerinfo.util.FieldsCollector;
 import com.steerinfo.util.StringUtils;
@@ -380,6 +385,25 @@ throw new MarkerMetException(500, "操作异常!!");
         return rm;
     }
 
+    @ApiOperation(value = "数据洁净-C#端")
+    @PostMapping(value = "/clientClean")
+    public RESTfulResult clientClean(@RequestBody CommonCombination<MeterWorkCarActualFirst, MeterWorkCarActual, MeterWorkCarActualFirst, MeterWorkCarActual> model) {
+        RESTfulResult rm = failed();
+        try {
+            MeterWorkCarActual num = meterWorkCarActualService.clientClean(model.getOne(), model.getTwo());
+            return success(num);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
+
     @ApiOperation(value = "匹配委托")
     @PostMapping(value = "/matchPrediction")
     public RESTfulResult matchPrediction(@RequestParam String actualNo, String predictionNo, String note) {

+ 4 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/IMeterWorkCarActualService.java

@@ -4,6 +4,7 @@ import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.IBaseService;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
+import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
 import com.steerinfo.util.CommonPage;
 import io.micrometer.core.instrument.Meter;
 
@@ -75,4 +76,7 @@ public interface IMeterWorkCarActualService extends IBaseService<MeterWorkCarAct
 
     //根据传入时间和车号,查询给定时间段去重车号
     List<String> distinctCarNo(String carNo, String startTime, String endTime, String dataSource);
+
+    // 根据传入的一次计量数据和洁净数据实体进行洁净操作
+    MeterWorkCarActual clientClean(MeterWorkCarActualFirst first, MeterWorkCarActual net);
 }

+ 20 - 1
src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/impl/MeterWorkCarActualServiceImpl.java

@@ -453,7 +453,6 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-
     public int manualInput (MeterWorkCarActual model) {
         try {
             // 校验传入数据是否完整
@@ -465,6 +464,26 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
         }
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public MeterWorkCarActual clientClean (MeterWorkCarActualFirst first, MeterWorkCarActual net) {
+        try {
+            MeterWorkCarActual mwca = new MeterWorkCarActual();
+            if ((net.getActualFirst1No() == null || "".equals(net.getActualFirst1No())) && (net.getActualFirst2No() == null || "".equals(net.getActualFirst2No()))) {
+                throw new MarkerMetException(500, "一次计量数据编号为空!!");
+            }
+            // 判断传入净重数据中是否存在委托编号
+            if (net.getPredictionNo() == null || "".equals(net.getPredictionNo())) {
+
+            } else {
+
+            }
+            return mwca;
+        } catch (MarkerMetException e) {
+            throw e;
+        }
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public MeterWorkCarActual matchPrediction (String actualNo, String predictionNo, String note) throws MarkerMetException {

+ 5 - 7
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/controller/MeterWorkCarActualFirstController.java

@@ -167,15 +167,13 @@ public class MeterWorkCarActualFirstController extends BaseRESTfulController {
     @ApiImplicitParam(name = "meterWorkCarActualFirst", value = "详细实体meterWorkCarActualFirst", required = true, dataType = "MeterWorkCarActualFirst")
     //@RequiresPermissions("meterworkcaractualfirst:create")
     @PostMapping(value = "/add")
-    public RESTfulResult chechandadd(@RequestBody MeterWorkCarActualFirst model) {
+    public RESTfulResult chechandadd(@RequestBody CommonCombination<MeterWorkCarActualFirst, MeterMonitorNote, MeterWorkCarActual, MeterMonitorNote> com) {
         RESTfulResult rm = failed();
         try {
-            int num = meterWorkCarActualFirstService.checkandadd(model);
-            if (num >= 1) {
-                return success(num);
-            } else {
-                return failed("新增失败");
-            }
+            MeterMonitorNote note = com.getTwo();
+            MeterWorkCarActualFirst first = com.getOne();
+            RESTfulResult res = meterWorkCarActualFirstService.checkandadd(first, note);
+           return res;
         } catch (MarkerMetException e) {
             e.printStackTrace();
             rm.setMessage(e.getMessage());

+ 3 - 1
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/service/IMeterWorkCarActualFirstService.java

@@ -28,7 +28,7 @@ import java.util.Objects;
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  */
 public interface IMeterWorkCarActualFirstService extends IBaseService<MeterWorkCarActualFirst, String> {
-    int checkandadd(MeterWorkCarActualFirst model);
+    RESTfulResult checkandadd(MeterWorkCarActualFirst model, MeterMonitorNote note)  throws Exception;
 
     int checkandupdate(MeterWorkCarActualFirst model);
     int checkcarandupdate(MeterWorkCarActualFirst model);
@@ -92,6 +92,8 @@ public interface IMeterWorkCarActualFirstService extends IBaseService<MeterWorkC
 
     RESTfulResult doAddNetLianDaWf(MeterWorkCarActualFirst one, MeterWorkCarActual two, MeterMonitorNote three) throws Exception;
 
+    RESTfulResult doAddNetDouble(MeterWorkCarActualFirst secondDb, MeterWorkCarActual netDb1, MeterMonitorNote note, MeterWorkCarActual netDb2) throws Exception;
+
     RESTfulResult doCraneDbWf(MeterWorkCarActualFirst one, MeterMonitorNote two) throws Exception;
 
     RESTfulResult doCraneNetDbWf(MeterWorkCarActualFirst one, MeterWorkCarActual two, MeterMonitorNote three) throws Exception;

+ 134 - 6
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/service/impl/MeterWorkCarActualFirstServiceImpl.java

@@ -56,6 +56,7 @@ import com.steerinfo.util.AESUtil;
 import com.steerinfo.util.FieldsCollector;
 import com.steerinfo.util.HttpRequest;
 import com.steerinfo.util.StringUtils;
+import io.micrometer.core.instrument.Meter;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -156,15 +157,34 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public int checkandadd(MeterWorkCarActualFirst model) throws MarkerMetException {
+    public RESTfulResult checkandadd(MeterWorkCarActualFirst model, MeterMonitorNote note) throws Exception {
         try {
+            RESTfulResult rm = new RESTfulResult();
+            rm.setCode("200");
             ckeck1(model);
             SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
             String afl = sdf.format(new Date());
             String no = meterWorkCarActualFirstMapper.getNewID(afl);
             model.setActualFirstNo(sdf.format(new Date()) + no);
+            //6、存储图片
+            SaveImg(model);
+
+            //7、修改计量监控
+            updateMonitor(model.getBaseSpotNo());
+
+            //8、修改监控的计量作业编号
+            updateMonitorOver(model.getActualFirstNo(), model.getBaseSpotNo());
+
+            //信息加密
+            String str = model.getActualFirstNo() + "," + model.getMeterWeight() + "," + "1";
+            String enStr = encryption(str);
+
+            //保存日志
+            saveNote(note);
             int num = meterWorkCarActualFirstMapper.insertSelective(model);
-            return num;
+            rm.setData(model.getActualFirstNo());
+            rm.setMessage(enStr);
+            return rm;
         } catch (MarkerMetException e) {
             throw e;
         }
@@ -652,6 +672,15 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
         if (model.getBaseSpotName() == null || model.getBaseSpotName().equals("")) {
             throw new MarkerMetException(500, "计量点名称不能为空");
         }
+
+        // 判断是否带有委托
+        if (model.getPredictionNo() != null && !"".equals(model.getPredictionNo())) {
+            PreTrackScale pre = new PreTrackScale();
+            pre.setPredictionNo(model.getPredictionNo());
+            pre.setValueFlag("4");
+            preTrackScaleMapper.updateByPrimaryKeySelective(pre);
+        }
+
         if (StringUtils.isEmpty(model.getActualFirstNo())) {
             model.setValueFlag(DbConstants.VALID);
             model.setCheckFlag(DbConstants.INVALID);
@@ -958,6 +987,19 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(firstUpdate);
         }
 
+        // 判断当前数据是否存在委托
+        if (netDb.getPredictionNo() != null && "".equals(netDb.getPredictionNo())) {
+            MeterWorkCarActualFirst gross = meterWorkCarActualFirstMapper.selectByPrimaryKey(netDb.getActualFirst1No());
+            if ((gross.getPredictionNo() == null || "".equals(gross.getPredictionNo()))) {
+                // 如果毛重数据还未匹配委托,则匹配委托操作
+                MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(gross.getActualFirstNo(), netDb.getPredictionNo());
+                meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
+                PreTrackScale preTrackScale = new PreTrackScale();
+                preTrackScale.setValueFlag("2");
+                preTrackScaleMapper.updateByPrimaryKeySelective(preTrackScale);
+            }
+        }
+
         String no1 = meterWorkCarActualMapper.getNewID(afl);
         netDb.setActualNo(afl + no1);
         if (netDb != null && netDb.getNetWeight() != null) {
@@ -1985,10 +2027,10 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             throw new MarkerMetException(500, "参数!!");
         }
         //0、查询预报信息;判断预报车号的车号与前端传进来的车号是不是一样的;2021年5月16日
-        PreTrackScale pts = preTrackScaleMapper.selectByPrimaryKey(oci.getPredictionNo().replace("_",""));
-        if (StringUtils.isEmpty(pts.getCarNo()) || !pts.getCarNo().equals(oci.getCarNo())) {
-            throw new MarkerMetException(500, "预报中的车号【" + pts.getCarNo() + "】与界面车号不一致【" + oci.getCarNo() + "】");
-        }
+//        PreTrackScale pts = preTrackScaleMapper.selectByPrimaryKey(oci.getPredictionNo().replace("_",""));
+//        if (StringUtils.isEmpty(pts.getCarNo()) || !pts.getCarNo().equals(oci.getCarNo())) {
+//            throw new MarkerMetException(500, "预报中的车号【" + pts.getCarNo() + "】与界面车号不一致【" + oci.getCarNo() + "】");
+//        }
 
         //1、存储一次计量信息
         SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
@@ -2124,6 +2166,92 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
         return rm;
     }
 
+    /**
+     * 双委托数据洁净
+     *
+     * @param secondDb 二次计量数据
+     * @param netDb1    A-B净重数据
+     * @param netDb2    B-C净重数据
+     * @return
+     * @throws Exception
+     */
+    @Override
+    @Transactional(value = "tm", rollbackFor = Exception.class)
+    public RESTfulResult doAddNetDouble(MeterWorkCarActualFirst secondDb, MeterWorkCarActual netDb1, MeterMonitorNote note, MeterWorkCarActual netDb2) throws Exception {
+        RESTfulResult rm = new RESTfulResult();
+        rm.setCode("200");
+        //先格式化时间
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
+
+        //1、存储当前计量的数据  1.1先给一个初始状态
+        secondDb.setValueFlag("2");//洁净
+
+        //2、存储三条一次计量数据
+        // 第一条洁净数据的二次重量数据
+        String afl = formatter.format(secondDb.getCreateTime());
+        String iActualNo = meterWorkCarActualFirstMapper.getNewID(afl);
+        secondDb.setActualFirstNo(afl + iActualNo);
+        if (netDb1.getActualFirst1No() == null || "".equals(netDb1.getActualFirst1No())) {
+            netDb1.setActualFirst1No(secondDb.getActualFirstNo());
+        } else {
+            netDb1.setActualFirst2No(secondDb.getActualFirstNo());
+        }
+        meterWorkCarActualFirstMapper.insertSelective(secondDb);
+
+        // 第二条洁净数据的一次重量数据
+        MeterWorkCarActualFirst first1 = new MeterWorkCarActualFirst();
+        MeterWorkCarActualFirst first2 = new MeterWorkCarActualFirst();
+
+        //一次计量的数据修改状态
+        MeterWorkCarActualFirst firstUpdate = new MeterWorkCarActualFirst();
+
+        //6、存储洁净数据
+        String afl1 = formatter.format(netDb1.getNetTime());
+        String no = meterWorkCarActualMapper.getNewID(afl1);
+        netDb1.setActualNo(afl + no); //注意:此处生成的编号是下一次的编号;如果是一车联运不能直接返回给客户端这个编号
+
+        if (secondDb.getMeterWeight().equals(netDb1.getTareWeight())) {
+            //二次指哪个了如果跟皮重一样
+            if (StringUtils.isEmpty(netDb1.getActualFirst2No()) || netDb1.getActualFirst2No().length() < 10)
+                netDb1.setActualFirst2No(secondDb.getActualFirstNo()); //皮重编号
+            firstUpdate.setActualFirstNo(netDb1.getActualFirst1No());
+        } else {
+            if (StringUtils.isEmpty(netDb1.getActualFirst1No()) || netDb1.getActualFirst1No().length() < 10)
+                netDb1.setActualFirst1No(secondDb.getActualFirstNo()); //毛重编号
+            firstUpdate.setActualFirstNo(netDb1.getActualFirst2No());
+        }
+        if (netDb1 != null && netDb1.getNetWeight() != null) {
+            //2021年3月7日 净重保留两位小数;
+            BigDecimal net;
+            net = new BigDecimal(String.valueOf(netDb1.getNetWeight())).setScale(2, BigDecimal.ROUND_HALF_UP);
+            netDb1.setNetWeight(net);
+        }
+        meterWorkCarActualMapper.insertSelective(netDb1);
+
+
+
+        //10、存储图片
+        SaveImg(secondDb);
+
+        //11、修改计量监控
+        updateMonitor(secondDb.getBaseSpotNo());
+
+        //12、修改监控的计量作业编号
+        updateMonitorOver(secondDb.getActualFirstNo(), secondDb.getBaseSpotNo());
+
+
+        //信息加密
+        String str = netDb1.getActualNo() + "," + netDb1.getNetWeight() + "," + "2";
+        String enStr = encryption(str);
+
+        //保存日志
+        saveNote(note);
+
+        rm.setData(secondDb.getActualFirstNo());
+        rm.setMessage(enStr);
+        return rm;
+    }
+
 
     /**
      * 吊钩秤存储一次计量数据

+ 1 - 3
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/impl/MeterWorkRailwayActFirstServiceImpl.java

@@ -520,9 +520,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
 
             PreRailwayScale pls = preRailwayScaleMapper.selectByPrimaryKey(model.getPredictionNo());
             pls.setPredictionNo(model.getPredictionNo());
-            pls.setValueFlag(DbConstants.VALID); //待使用
-
-            pls.setValueFlag("4");
+            pls.setValueFlag("1");
 
             preRailwayScaleMapper.updateByPrimaryKeySelective(pls);
             MeterWorkRailwayActFirst mwcaf = meterWorkRailwayActFirstMapper.selectAndRemove(model.getActualFirstNo());

+ 192 - 174
src/main/java/com/steerinfo/meterwork/meterworkzeroalarm/mapper/MeterWorkZeroAlarmMapper.xml

@@ -18,16 +18,17 @@
     <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
     <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="MEMO" jdbcType="VARCHAR" property="memo" />
+    <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
   </resultMap>
   <sql id="columns">
-    ALARM_NO, SPOT_TYPE_NO, SPOT_TYPE_NAME, BASE_SPOT_NO, BASE_SPOT_NAME, SCALE_POINT_NO, 
-    SCALE_POINT_NAME, ZERO_WEIGHT, ZERO_TIME, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
-    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, MEMO
+    ALARM_NO, SPOT_TYPE_NO, SPOT_TYPE_NAME, BASE_SPOT_NO, BASE_SPOT_NAME, SCALE_POINT_NO,
+    SCALE_POINT_NAME, ZERO_WEIGHT, ZERO_TIME, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
+    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, MEMO, VALID_FLAG
   </sql>
   <sql id="columns_alias">
-    t.ALARM_NO, t.SPOT_TYPE_NO, t.SPOT_TYPE_NAME, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.SCALE_POINT_NO, 
-    t.SCALE_POINT_NAME, t.ZERO_WEIGHT, t.ZERO_TIME, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, 
-    t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.MEMO
+    t.ALARM_NO, t.SPOT_TYPE_NO, t.SPOT_TYPE_NAME, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.SCALE_POINT_NO,
+    t.SCALE_POINT_NAME, t.ZERO_WEIGHT, t.ZERO_TIME, t.CREATE_MAN_NO, t.CREATE_MAN_NAME,
+    t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.MEMO, t.VALID_FLAG
   </sql>
   <sql id="select">
     SELECT <include refid="columns"/> FROM METER_WORK_ZERO_ALARM
@@ -36,7 +37,7 @@
     SELECT <include refid="columns_alias"/> FROM METER_WORK_ZERO_ALARM t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="alarmNo != null and alarmNo != ''">
         and ALARM_NO = #{alarmNo}
       </if>
@@ -85,13 +86,13 @@
       <if test="memo != null and memo != ''">
         and MEMO = #{memo}
       </if>
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+      <if test="validFlag != null and validFlag != ''">
+        and VALID_FLAG = #{validFlag}
       </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="alarmNo != null and alarmNo != ''">
         and ALARM_NO LIKE '%${alarmNo}%'
       </if>
@@ -140,8 +141,8 @@
       <if test="memo != null and memo != ''">
         and MEMO LIKE '%${memo}%'
       </if>
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+      <if test="validFlag != null and validFlag != ''">
+        and VALID_FLAG LIKE '%${validFlag}%'
       </if>
     </where>
   </sql>
@@ -151,66 +152,69 @@
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from METER_WORK_ZERO_ALARM
-    where 1!=1 
-      <if test="spotTypeNo != null and spotTypeNo != ''">
-        or SPOT_TYPE_NO = #{spotTypeNo}
-      </if>
-      <if test="spotTypeName != null and spotTypeName != ''">
-        or SPOT_TYPE_NAME = #{spotTypeName}
-      </if>
-      <if test="baseSpotNo != null and baseSpotNo != ''">
-        or BASE_SPOT_NO = #{baseSpotNo}
-      </if>
-      <if test="baseSpotName != null and baseSpotName != ''">
-        or BASE_SPOT_NAME = #{baseSpotName}
-      </if>
-      <if test="scalePointNo != null and scalePointNo != ''">
-        or SCALE_POINT_NO = #{scalePointNo}
-      </if>
-      <if test="scalePointName != null and scalePointName != ''">
-        or SCALE_POINT_NAME = #{scalePointName}
-      </if>
-      <if test="zeroWeight != null">
-        or ZERO_WEIGHT = #{zeroWeight}
-      </if>
-      <if test="zeroTime != null">
-        or TO_CHAR(ZERO_TIME,'yyyy-MM-dd') = '#{zeroTime}'
-      </if>
-      <if test="createManNo != null and createManNo != ''">
-        or CREATE_MAN_NO = #{createManNo}
-      </if>
-      <if test="createManName != null and createManName != ''">
-        or CREATE_MAN_NAME = #{createManName}
-      </if>
-      <if test="createTime != null">
-        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
-      </if>
-      <if test="updateManNo != null and updateManNo != ''">
-        or UPDATE_MAN_NO = #{updateManNo}
-      </if>
-      <if test="updateManName != null and updateManName != ''">
-        or UPDATE_MAN_NAME = #{updateManName}
-      </if>
-      <if test="updateTime != null">
-        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-      </if>
-      <if test="memo != null and memo != ''">
-        or MEMO = #{memo}
-      </if>
+    where 1!=1
+    <if test="spotTypeNo != null and spotTypeNo != ''">
+      or SPOT_TYPE_NO = #{spotTypeNo}
+    </if>
+    <if test="spotTypeName != null and spotTypeName != ''">
+      or SPOT_TYPE_NAME = #{spotTypeName}
+    </if>
+    <if test="baseSpotNo != null and baseSpotNo != ''">
+      or BASE_SPOT_NO = #{baseSpotNo}
+    </if>
+    <if test="baseSpotName != null and baseSpotName != ''">
+      or BASE_SPOT_NAME = #{baseSpotName}
+    </if>
+    <if test="scalePointNo != null and scalePointNo != ''">
+      or SCALE_POINT_NO = #{scalePointNo}
+    </if>
+    <if test="scalePointName != null and scalePointName != ''">
+      or SCALE_POINT_NAME = #{scalePointName}
+    </if>
+    <if test="zeroWeight != null">
+      or ZERO_WEIGHT = #{zeroWeight}
+    </if>
+    <if test="zeroTime != null">
+      or TO_CHAR(ZERO_TIME,'yyyy-MM-dd') = '#{zeroTime}'
+    </if>
+    <if test="createManNo != null and createManNo != ''">
+      or CREATE_MAN_NO = #{createManNo}
+    </if>
+    <if test="createManName != null and createManName != ''">
+      or CREATE_MAN_NAME = #{createManName}
+    </if>
+    <if test="createTime != null">
+      or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
+    </if>
+    <if test="updateManNo != null and updateManNo != ''">
+      or UPDATE_MAN_NO = #{updateManNo}
+    </if>
+    <if test="updateManName != null and updateManName != ''">
+      or UPDATE_MAN_NAME = #{updateManName}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="memo != null and memo != ''">
+      or MEMO = #{memo}
+    </if>
+    <if test="validFlag != null and validFlag != ''">
+      or VALID_FLAG = #{validFlag}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkzeroalarm.model.MeterWorkZeroAlarm">
-    insert into METER_WORK_ZERO_ALARM (ALARM_NO, SPOT_TYPE_NO, SPOT_TYPE_NAME, 
-      BASE_SPOT_NO, BASE_SPOT_NAME, SCALE_POINT_NO, 
-      SCALE_POINT_NAME, ZERO_WEIGHT, ZERO_TIME, 
-      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
-      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
-      MEMO)
-    values (#{alarmNo,jdbcType=VARCHAR}, #{spotTypeNo,jdbcType=VARCHAR}, #{spotTypeName,jdbcType=VARCHAR}, 
-      #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, #{scalePointNo,jdbcType=VARCHAR}, 
-      #{scalePointName,jdbcType=VARCHAR}, #{zeroWeight,jdbcType=DECIMAL}, #{zeroTime,jdbcType=TIMESTAMP}, 
-      #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{memo,jdbcType=VARCHAR})
+    insert into METER_WORK_ZERO_ALARM (ALARM_NO, SPOT_TYPE_NO, SPOT_TYPE_NAME,
+                                       BASE_SPOT_NO, BASE_SPOT_NAME, SCALE_POINT_NO,
+                                       SCALE_POINT_NAME, ZERO_WEIGHT, ZERO_TIME,
+                                       CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
+                                       UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
+                                       MEMO, VALID_FLAG)
+    values (#{alarmNo,jdbcType=VARCHAR}, #{spotTypeNo,jdbcType=VARCHAR}, #{spotTypeName,jdbcType=VARCHAR},
+            #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, #{scalePointNo,jdbcType=VARCHAR},
+            #{scalePointName,jdbcType=VARCHAR}, #{zeroWeight,jdbcType=DECIMAL}, #{zeroTime,jdbcType=TIMESTAMP},
+            #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+            #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+            #{memo,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkzeroalarm.model.MeterWorkZeroAlarm">
     insert into METER_WORK_ZERO_ALARM
@@ -263,6 +267,9 @@
       <if test="memo != null">
         MEMO,
       </if>
+      <if test="validFlag != null">
+        VALID_FLAG,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="alarmNo != null">
@@ -313,25 +320,29 @@
       <if test="memo != null">
         #{memo,jdbcType=VARCHAR},
       </if>
+      <if test="validFlag != null">
+        #{validFlag,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkzeroalarm.model.MeterWorkZeroAlarm">
     update METER_WORK_ZERO_ALARM
     set SPOT_TYPE_NO = #{spotTypeNo,jdbcType=VARCHAR},
-      SPOT_TYPE_NAME = #{spotTypeName,jdbcType=VARCHAR},
-      BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
-      BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
-      SCALE_POINT_NO = #{scalePointNo,jdbcType=VARCHAR},
-      SCALE_POINT_NAME = #{scalePointName,jdbcType=VARCHAR},
-      ZERO_WEIGHT = #{zeroWeight,jdbcType=DECIMAL},
-      ZERO_TIME = #{zeroTime,jdbcType=TIMESTAMP},
-      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
-      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
-      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
-      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
-      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      MEMO = #{memo,jdbcType=VARCHAR}
+        SPOT_TYPE_NAME = #{spotTypeName,jdbcType=VARCHAR},
+        BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
+        BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
+        SCALE_POINT_NO = #{scalePointNo,jdbcType=VARCHAR},
+        SCALE_POINT_NAME = #{scalePointName,jdbcType=VARCHAR},
+        ZERO_WEIGHT = #{zeroWeight,jdbcType=DECIMAL},
+        ZERO_TIME = #{zeroTime,jdbcType=TIMESTAMP},
+        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
+        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
+        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
+        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        MEMO = #{memo,jdbcType=VARCHAR},
+        VALID_FLAG = #{validFlag,jdbcType=VARCHAR}
     where ALARM_NO = #{alarmNo,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkzeroalarm.model.MeterWorkZeroAlarm">
@@ -382,6 +393,9 @@
       <if test="memo != null">
         MEMO = #{memo,jdbcType=VARCHAR},
       </if>
+      <if test="validFlag != null">
+        VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
+      </if>
     </set>
     where ALARM_NO = #{alarmNo,jdbcType=VARCHAR}
   </update>
@@ -398,105 +412,109 @@
     <include refid="whereLike"/>
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
-    insert into METER_WORK_ZERO_ALARM 
-      (ALARM_NO, 
-      SPOT_TYPE_NO, SPOT_TYPE_NAME, BASE_SPOT_NO, 
-      BASE_SPOT_NAME, SCALE_POINT_NO, SCALE_POINT_NAME, 
-      ZERO_WEIGHT, ZERO_TIME, CREATE_MAN_NO, 
-      CREATE_MAN_NAME, CREATE_TIME, 
-      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
-      MEMO)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.alarmNo,jdbcType=VARCHAR}, 
-      #{item.spotTypeNo,jdbcType=VARCHAR}, #{item.spotTypeName,jdbcType=VARCHAR}, #{item.baseSpotNo,jdbcType=VARCHAR}, 
-      #{item.baseSpotName,jdbcType=VARCHAR}, #{item.scalePointNo,jdbcType=VARCHAR}, #{item.scalePointName,jdbcType=VARCHAR}, 
-      #{item.zeroWeight,jdbcType=DECIMAL}, #{item.zeroTime,jdbcType=TIMESTAMP}, #{item.createManNo,jdbcType=VARCHAR}, 
-      #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
-      #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
-      #{item.memo,jdbcType=VARCHAR} from dual  
-   </foreach> )
+    insert into METER_WORK_ZERO_ALARM
+    (ALARM_NO,
+    SPOT_TYPE_NO, SPOT_TYPE_NAME, BASE_SPOT_NO,
+    BASE_SPOT_NAME, SCALE_POINT_NO, SCALE_POINT_NAME,
+    ZERO_WEIGHT, ZERO_TIME, CREATE_MAN_NO,
+    CREATE_MAN_NAME, CREATE_TIME,
+    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
+    MEMO, VALID_FLAG)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.alarmNo,jdbcType=VARCHAR},
+    #{item.spotTypeNo,jdbcType=VARCHAR}, #{item.spotTypeName,jdbcType=VARCHAR}, #{item.baseSpotNo,jdbcType=VARCHAR},
+    #{item.baseSpotName,jdbcType=VARCHAR}, #{item.scalePointNo,jdbcType=VARCHAR}, #{item.scalePointName,jdbcType=VARCHAR},
+    #{item.zeroWeight,jdbcType=DECIMAL}, #{item.zeroTime,jdbcType=TIMESTAMP}, #{item.createManNo,jdbcType=VARCHAR},
+    #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
+    #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
+    #{item.memo,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR} from dual
+  </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-     update METER_WORK_ZERO_ALARM
-     set
-       ALARM_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.alarmNo,jdbcType=VARCHAR}
-       </foreach>
-       ,SPOT_TYPE_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.spotTypeNo,jdbcType=VARCHAR}
-       </foreach>
-       ,SPOT_TYPE_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.spotTypeName,jdbcType=VARCHAR}
-       </foreach>
-       ,BASE_SPOT_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
-       </foreach>
-       ,BASE_SPOT_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
-       </foreach>
-       ,SCALE_POINT_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.scalePointNo,jdbcType=VARCHAR}
-       </foreach>
-       ,SCALE_POINT_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.scalePointName,jdbcType=VARCHAR}
-       </foreach>
-       ,ZERO_WEIGHT=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.zeroWeight,jdbcType=DECIMAL}
-       </foreach>
-       ,ZERO_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.zeroTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,CREATE_MAN_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_MAN_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_MAN_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_MAN_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,MEMO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
-          when #{item.alarmNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
-       </foreach>
-     where ALARM_NO in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.alarmNo,jdbcType=VARCHAR}
-     </foreach> 
+    update METER_WORK_ZERO_ALARM
+    set
+    ALARM_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.alarmNo,jdbcType=VARCHAR}
+    </foreach>
+    ,SPOT_TYPE_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.spotTypeNo,jdbcType=VARCHAR}
+    </foreach>
+    ,SPOT_TYPE_NAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.spotTypeName,jdbcType=VARCHAR}
+    </foreach>
+    ,BASE_SPOT_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
+    </foreach>
+    ,BASE_SPOT_NAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
+    </foreach>
+    ,SCALE_POINT_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.scalePointNo,jdbcType=VARCHAR}
+    </foreach>
+    ,SCALE_POINT_NAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.scalePointName,jdbcType=VARCHAR}
+    </foreach>
+    ,ZERO_WEIGHT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.zeroWeight,jdbcType=DECIMAL}
+    </foreach>
+    ,ZERO_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.zeroTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,CREATE_MAN_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
+    </foreach>
+    ,CREATE_MAN_NAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
+    </foreach>
+    ,CREATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_MAN_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_MAN_NAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,MEMO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
+    </foreach>
+    ,VALID_FLAG=
+    <foreach collection="list" item="item" index="index" separator=" " open="case ALARM_NO" close="end">
+      when #{item.alarmNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
+    </foreach>
+    where ALARM_NO in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.alarmNo,jdbcType=VARCHAR}
+    </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from METER_WORK_ZERO_ALARM
-    where ALARM_NO in 
+    where ALARM_NO in
     <foreach collection="list" item="id" open="(" close=")" separator=",">
       #{id}
     </foreach>
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  
+
 </mapper>

+ 15 - 0
src/main/java/com/steerinfo/meterwork/meterworkzeroalarm/model/MeterWorkZeroAlarm.java

@@ -104,6 +104,12 @@ public class MeterWorkZeroAlarm implements IBasePO<String> {
     @ApiModelProperty(value="备注",required=false)
     private String memo;
 
+    /**
+     * 0为报警,1为报警解除(VALID_FLAG,VARCHAR,1)
+     */
+    @ApiModelProperty(value="0为报警,1为报警解除",required=false)
+    private String validFlag;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -244,6 +250,14 @@ public class MeterWorkZeroAlarm implements IBasePO<String> {
         this.memo = memo == null ? null : memo.trim();
     }
 
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag == null ? null : validFlag.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -266,6 +280,7 @@ public class MeterWorkZeroAlarm implements IBasePO<String> {
         sb.append(", updateManName=").append(updateManName);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", memo=").append(memo);
+        sb.append(", validFlag=").append(validFlag);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();