|  | @@ -26,13 +26,13 @@
 | 
	
		
			
				|  |  |      <result column="MOSAICID" jdbcType="VARCHAR" property="mosaicid" />
 | 
	
		
			
				|  |  |    </resultMap>
 | 
	
		
			
				|  |  |    <sql id="columns">
 | 
	
		
			
				|  |  | -    MeterId, PhoneNo, AddressCode, M_UserType, M_Type, M_Name, M_DoorNo, M_PipeDn, M_Material, 
 | 
	
		
			
				|  |  | -    M_Ratio, CreateTime, ForValue, RevValue, PressValue, RealValue, SumValue, CelVal, 
 | 
	
		
			
				|  |  | +    MeterId, PhoneNo, AddressCode, M_UserType, M_Type, M_Name, M_DoorNo, M_PipeDn, M_Material,
 | 
	
		
			
				|  |  | +    M_Ratio, CreateTime, ForValue, RevValue, PressValue, RealValue, SumValue, CelVal,
 | 
	
		
			
				|  |  |      NetVal, IsStat, DeviceId, ReadTime, MOSAICID
 | 
	
		
			
				|  |  |    </sql>
 | 
	
		
			
				|  |  |    <sql id="columns_alias">
 | 
	
		
			
				|  |  | -    t.MeterId, t.PhoneNo, t.AddressCode, t.M_UserType, t.M_Type, t.M_Name, t.M_DoorNo, 
 | 
	
		
			
				|  |  | -    t.M_PipeDn, t.M_Material, t.M_Ratio, t.CreateTime, t.ForValue, t.RevValue, t.PressValue, 
 | 
	
		
			
				|  |  | +    t.MeterId, t.PhoneNo, t.AddressCode, t.M_UserType, t.M_Type, t.M_Name, t.M_DoorNo,
 | 
	
		
			
				|  |  | +    t.M_PipeDn, t.M_Material, t.M_Ratio, t.CreateTime, t.ForValue, t.RevValue, t.PressValue,
 | 
	
		
			
				|  |  |      t.RealValue, t.SumValue, t.CelVal, t.NetVal, t.IsStat, t.DeviceId, t.ReadTime, t.MosaicId
 | 
	
		
			
				|  |  |    </sql>
 | 
	
		
			
				|  |  |    <sql id="select">
 | 
	
	
		
			
				|  | @@ -42,7 +42,7 @@
 | 
	
		
			
				|  |  |      SELECT <include refid="columns_alias"/> FROM EMS_WATER_REALTIME t
 | 
	
		
			
				|  |  |    </sql>
 | 
	
		
			
				|  |  |    <sql id="where">
 | 
	
		
			
				|  |  | -    <where> 
 | 
	
		
			
				|  |  | +    <where>
 | 
	
		
			
				|  |  |        <if test="meterid != null">
 | 
	
		
			
				|  |  |          and MeterId = #{meterid}
 | 
	
		
			
				|  |  |        </if>
 | 
	
	
		
			
				|  | @@ -109,7 +109,7 @@
 | 
	
		
			
				|  |  |      </where>
 | 
	
		
			
				|  |  |    </sql>
 | 
	
		
			
				|  |  |    <sql id="whereLike">
 | 
	
		
			
				|  |  | -    <where> 
 | 
	
		
			
				|  |  | +    <where>
 | 
	
		
			
				|  |  |        <if test="meterid != null">
 | 
	
		
			
				|  |  |          and MeterId = #{meterid}
 | 
	
		
			
				|  |  |        </if>
 | 
	
	
		
			
				|  | @@ -181,7 +181,7 @@
 | 
	
		
			
				|  |  |    </delete>
 | 
	
		
			
				|  |  |    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
 | 
	
		
			
				|  |  |      delete from EMS_WATER_REALTIME
 | 
	
		
			
				|  |  | -    where 1!=1 
 | 
	
		
			
				|  |  | +    where 1!=1
 | 
	
		
			
				|  |  |        <if test="phoneno != null and phoneno != ''">
 | 
	
		
			
				|  |  |          or PhoneNo = #{phoneno}
 | 
	
		
			
				|  |  |        </if>
 | 
	
	
		
			
				|  | @@ -244,22 +244,22 @@
 | 
	
		
			
				|  |  |        </if>
 | 
	
		
			
				|  |  |    </delete>
 | 
	
		
			
				|  |  |    <insert id="insert" parameterType="com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime">
 | 
	
		
			
				|  |  | -    insert into EMS_WATER_REALTIME (MeterId, PhoneNo, AddressCode, 
 | 
	
		
			
				|  |  | -      M_UserType, M_Type, M_Name, 
 | 
	
		
			
				|  |  | -      M_DoorNo, M_PipeDn, M_Material, 
 | 
	
		
			
				|  |  | +    insert into EMS_WATER_REALTIME (MeterId, PhoneNo, AddressCode,
 | 
	
		
			
				|  |  | +      M_UserType, M_Type, M_Name,
 | 
	
		
			
				|  |  | +      M_DoorNo, M_PipeDn, M_Material,
 | 
	
		
			
				|  |  |        M_Ratio, CreateTime, ForValue,
 | 
	
		
			
				|  |  | -      RevValue, PressValue, RealValue, 
 | 
	
		
			
				|  |  | -      SumValue, CelVal, NetVal, 
 | 
	
		
			
				|  |  | +      RevValue, PressValue, RealValue,
 | 
	
		
			
				|  |  | +      SumValue, CelVal, NetVal,
 | 
	
		
			
				|  |  |        IsStat, DeviceId, ReadTime
 | 
	
		
			
				|  |  |        )
 | 
	
		
			
				|  |  | -    values (#{meterid,jdbcType=DECIMAL}, #{phoneno,jdbcType=VARCHAR}, #{addresscode,jdbcType=VARCHAR}, 
 | 
	
		
			
				|  |  | -      #{mUsertype,jdbcType=VARCHAR}, #{mType,jdbcType=VARCHAR}, #{mName,jdbcType=VARCHAR}, 
 | 
	
		
			
				|  |  | -      #{mDoorno,jdbcType=VARCHAR}, #{mPipedn,jdbcType=VARCHAR}, #{mMaterial,jdbcType=VARCHAR}, 
 | 
	
		
			
				|  |  | +    values (#{meterid,jdbcType=DECIMAL}, #{phoneno,jdbcType=VARCHAR}, #{addresscode,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      #{mUsertype,jdbcType=VARCHAR}, #{mType,jdbcType=VARCHAR}, #{mName,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      #{mDoorno,jdbcType=VARCHAR}, #{mPipedn,jdbcType=VARCHAR}, #{mMaterial,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  |        #{mRatio,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  |      to_date (substr( #{createtime,jdbcType=TIME}, 0, INSTR( #{createtime,jdbcType=TIME}, '.', 1, 1 )-1), 'YYYY-MM-DD HH24:MI:SS' ),
 | 
	
		
			
				|  |  |      #{forvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | -      #{revvalue,jdbcType=DECIMAL}, #{pressvalue,jdbcType=DECIMAL}, #{realvalue,jdbcType=DECIMAL}, 
 | 
	
		
			
				|  |  | -      #{sumvalue,jdbcType=DECIMAL}, #{celval,jdbcType=DECIMAL}, #{netval,jdbcType=DECIMAL}, 
 | 
	
		
			
				|  |  | +      #{revvalue,jdbcType=DECIMAL}, #{pressvalue,jdbcType=DECIMAL}, #{realvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      #{sumvalue,jdbcType=DECIMAL}, #{celval,jdbcType=DECIMAL}, #{netval,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  |        #{isstat,jdbcType=CHAR}, #{deviceid,jdbcType=VARCHAR}, to_date ( #{readtime,jdbcType=TIME} , 'YYYY-MM-DD HH24:MI:SS' )
 | 
	
		
			
				|  |  |        )
 | 
	
		
			
				|  |  |    </insert>
 | 
	
	
		
			
				|  | @@ -486,6 +486,77 @@
 | 
	
		
			
				|  |  |      </set>
 | 
	
		
			
				|  |  |      where MeterId = #{meterid,jdbcType=DECIMAL}
 | 
	
		
			
				|  |  |    </update>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  <update id="updateByAddresscodeSelective" parameterType="com.steerinfo.ems.emswaterrealtime.model.EmsWaterRealtime">
 | 
	
		
			
				|  |  | +    update EMS_WATER_REALTIME
 | 
	
		
			
				|  |  | +    <set>
 | 
	
		
			
				|  |  | +      <if test="phoneno != null">
 | 
	
		
			
				|  |  | +        PhoneNo = #{phoneno,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="mUsertype != null">
 | 
	
		
			
				|  |  | +        M_UserType = #{mUsertype,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="mType != null">
 | 
	
		
			
				|  |  | +        M_Type = #{mType,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="mName != null">
 | 
	
		
			
				|  |  | +        M_Name = #{mName,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="mDoorno != null">
 | 
	
		
			
				|  |  | +        M_DoorNo = #{mDoorno,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="mPipedn != null">
 | 
	
		
			
				|  |  | +        M_PipeDn = #{mPipedn,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="mMaterial != null">
 | 
	
		
			
				|  |  | +        M_Material = #{mMaterial,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="mRatio != null">
 | 
	
		
			
				|  |  | +        M_Ratio = #{mRatio,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="createtime != null">
 | 
	
		
			
				|  |  | +        CreateTime = #{createtime,jdbcType=TIMESTAMP},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="forvalue != null">
 | 
	
		
			
				|  |  | +        ForValue = #{forvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="revvalue != null">
 | 
	
		
			
				|  |  | +        RevValue = #{revvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="pressvalue != null">
 | 
	
		
			
				|  |  | +        PressValue = #{pressvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="realvalue != null">
 | 
	
		
			
				|  |  | +        RealValue = #{realvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="sumvalue != null">
 | 
	
		
			
				|  |  | +        SumValue = #{sumvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="celval != null">
 | 
	
		
			
				|  |  | +        CelVal = #{celval,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="netval != null">
 | 
	
		
			
				|  |  | +        NetVal = #{netval,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="isstat != null">
 | 
	
		
			
				|  |  | +        IsStat = #{isstat,jdbcType=CHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="deviceid != null">
 | 
	
		
			
				|  |  | +        DeviceId = #{deviceid,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="readtime != null">
 | 
	
		
			
				|  |  | +        ReadTime = #{readtime,jdbcType=TIMESTAMP},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +      <if test="meterid != null">
 | 
	
		
			
				|  |  | +        MeterId = #{meterid,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      </if>
 | 
	
		
			
				|  |  | +    </set>
 | 
	
		
			
				|  |  | +    <if test="addresscode != null"> where
 | 
	
		
			
				|  |  | +        AddressCode = #{addresscode,jdbcType=VARCHAR}
 | 
	
		
			
				|  |  | +    </if>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  </update>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
 | 
	
		
			
				|  |  |      <include refid="select"/>
 | 
	
		
			
				|  |  |      where MeterId = #{meterid,jdbcType=DECIMAL}
 | 
	
	
		
			
				|  | @@ -499,25 +570,25 @@
 | 
	
		
			
				|  |  |      <include refid="whereLike"/>
 | 
	
		
			
				|  |  |    </select>
 | 
	
		
			
				|  |  |    <insert id="batchInsert" parameterType="java.util.List">
 | 
	
		
			
				|  |  | -    insert into EMS_WATER_REALTIME 
 | 
	
		
			
				|  |  | -      (MeterId, 
 | 
	
		
			
				|  |  | -      PhoneNo, AddressCode, M_UserType, 
 | 
	
		
			
				|  |  | -      M_Type, M_Name, M_DoorNo, 
 | 
	
		
			
				|  |  | -      M_PipeDn, M_Material, M_Ratio, 
 | 
	
		
			
				|  |  | -      CreateTime, ForValue, RevValue, 
 | 
	
		
			
				|  |  | -      PressValue, RealValue, SumValue, 
 | 
	
		
			
				|  |  | -      CelVal, NetVal, IsStat, 
 | 
	
		
			
				|  |  | +    insert into EMS_WATER_REALTIME
 | 
	
		
			
				|  |  | +      (MeterId,
 | 
	
		
			
				|  |  | +      PhoneNo, AddressCode, M_UserType,
 | 
	
		
			
				|  |  | +      M_Type, M_Name, M_DoorNo,
 | 
	
		
			
				|  |  | +      M_PipeDn, M_Material, M_Ratio,
 | 
	
		
			
				|  |  | +      CreateTime, ForValue, RevValue,
 | 
	
		
			
				|  |  | +      PressValue, RealValue, SumValue,
 | 
	
		
			
				|  |  | +      CelVal, NetVal, IsStat,
 | 
	
		
			
				|  |  |        DeviceId, ReadTime)
 | 
	
		
			
				|  |  | -    ( <foreach collection="list" item="item" separator="union all"> 
 | 
	
		
			
				|  |  | -   select  
 | 
	
		
			
				|  |  | -      #{item.meterid,jdbcType=DECIMAL}, 
 | 
	
		
			
				|  |  | -      #{item.phoneno,jdbcType=VARCHAR}, #{item.addresscode,jdbcType=VARCHAR}, #{item.mUsertype,jdbcType=VARCHAR}, 
 | 
	
		
			
				|  |  | -      #{item.mType,jdbcType=VARCHAR}, #{item.mName,jdbcType=VARCHAR}, #{item.mDoorno,jdbcType=VARCHAR}, 
 | 
	
		
			
				|  |  | -      #{item.mPipedn,jdbcType=VARCHAR}, #{item.mMaterial,jdbcType=VARCHAR}, #{item.mRatio,jdbcType=VARCHAR}, 
 | 
	
		
			
				|  |  | -      #{item.createtime,jdbcType=TIMESTAMP}, #{item.forvalue,jdbcType=DECIMAL}, #{item.revvalue,jdbcType=DECIMAL}, 
 | 
	
		
			
				|  |  | -      #{item.pressvalue,jdbcType=DECIMAL}, #{item.realvalue,jdbcType=DECIMAL}, #{item.sumvalue,jdbcType=DECIMAL}, 
 | 
	
		
			
				|  |  | -      #{item.celval,jdbcType=DECIMAL}, #{item.netval,jdbcType=DECIMAL}, #{item.isstat,jdbcType=CHAR}, 
 | 
	
		
			
				|  |  | -      #{item.deviceid,jdbcType=VARCHAR}, #{item.readtime,jdbcType=TIMESTAMP} from dual  
 | 
	
		
			
				|  |  | +    ( <foreach collection="list" item="item" separator="union all">
 | 
	
		
			
				|  |  | +   select
 | 
	
		
			
				|  |  | +      #{item.meterid,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      #{item.phoneno,jdbcType=VARCHAR}, #{item.addresscode,jdbcType=VARCHAR}, #{item.mUsertype,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      #{item.mType,jdbcType=VARCHAR}, #{item.mName,jdbcType=VARCHAR}, #{item.mDoorno,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      #{item.mPipedn,jdbcType=VARCHAR}, #{item.mMaterial,jdbcType=VARCHAR}, #{item.mRatio,jdbcType=VARCHAR},
 | 
	
		
			
				|  |  | +      #{item.createtime,jdbcType=TIMESTAMP}, #{item.forvalue,jdbcType=DECIMAL}, #{item.revvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      #{item.pressvalue,jdbcType=DECIMAL}, #{item.realvalue,jdbcType=DECIMAL}, #{item.sumvalue,jdbcType=DECIMAL},
 | 
	
		
			
				|  |  | +      #{item.celval,jdbcType=DECIMAL}, #{item.netval,jdbcType=DECIMAL}, #{item.isstat,jdbcType=CHAR},
 | 
	
		
			
				|  |  | +      #{item.deviceid,jdbcType=VARCHAR}, #{item.readtime,jdbcType=TIMESTAMP} from dual
 | 
	
		
			
				|  |  |     </foreach> )
 | 
	
		
			
				|  |  |    </insert>
 | 
	
		
			
				|  |  |    <update id="batchUpdate" parameterType="java.util.List">
 | 
	
	
		
			
				|  | @@ -607,14 +678,14 @@
 | 
	
		
			
				|  |  |         <foreach collection="list" item="item" index="index" separator=" " open="case MeterId" close="end">
 | 
	
		
			
				|  |  |            when #{item.meterid,jdbcType=DECIMAL} then #{item.readtime,jdbcType=TIMESTAMP}
 | 
	
		
			
				|  |  |         </foreach>
 | 
	
		
			
				|  |  | -     where MeterId in 
 | 
	
		
			
				|  |  | +     where MeterId in
 | 
	
		
			
				|  |  |       <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
 | 
	
		
			
				|  |  |      #{item.meterid,jdbcType=DECIMAL}
 | 
	
		
			
				|  |  | -     </foreach> 
 | 
	
		
			
				|  |  | +     </foreach>
 | 
	
		
			
				|  |  |    </update>
 | 
	
		
			
				|  |  |    <delete id="batchDelete" parameterType="java.util.List">
 | 
	
		
			
				|  |  |      delete from EMS_WATER_REALTIME
 | 
	
		
			
				|  |  | -    where MeterId in 
 | 
	
		
			
				|  |  | +    where MeterId in
 | 
	
		
			
				|  |  |      <foreach collection="list" item="id" open="(" close=")" separator=",">
 | 
	
		
			
				|  |  |        #{id}
 | 
	
		
			
				|  |  |      </foreach>
 | 
	
	
		
			
				|  | @@ -625,8 +696,8 @@
 | 
	
		
			
				|  |  |          SELECT MeterId, PhoneNo, AddressCode, M_UserType, M_Type
 | 
	
		
			
				|  |  |               , M_Name, M_DoorNo, M_PipeDn, M_Material, M_Ratio, CreateTime
 | 
	
		
			
				|  |  |               , ForValue, RevValue, PressValue, RealValue, SumValue, CelVal
 | 
	
		
			
				|  |  | -             , NetVal, IsStat, DeviceId FROM ARM_Meter WITH (NOLOCK) where CreateTime >= #{clock}
 | 
	
		
			
				|  |  | -<!--        FROM Meter_Base.dbo.ARM_Meter-->
 | 
	
		
			
				|  |  | +             , NetVal, IsStat, DeviceId FROM ARM_Meter WITH (NOLOCK) where CreateTime >= #{clock} and  CreateTime < '2050-01-01'
 | 
	
		
			
				|  |  | +        <!--        FROM Meter_Base.dbo.ARM_Meter-->
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |    <select id="getcalpoint"
 | 
	
		
			
				|  |  |            resultType="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint">
 | 
	
	
		
			
				|  | @@ -694,4 +765,4 @@
 | 
	
		
			
				|  |  |      ))a
 | 
	
		
			
				|  |  |      <!--        FROM Meter_Base.dbo.ARM_Meter-->
 | 
	
		
			
				|  |  |    </select>
 | 
	
		
			
				|  |  | -</mapper>
 | 
	
		
			
				|  |  | +</mapper>
 |