|
@@ -13,10 +13,12 @@
|
|
|
<result column="UNITID" jdbcType="VARCHAR" property="unitid" />
|
|
|
<result column="BZ" jdbcType="VARCHAR" property="bz" />
|
|
|
<result column="MATERIALNO" jdbcType="VARCHAR" property="materialno"/>
|
|
|
+ <result column="TIMEGRANID" jdbcType="VARCHAR" property="timegranid"/>
|
|
|
+ <result column="ESTIMATEDVALUE" jdbcType="VARCHAR" property="estimatedvalue"/>
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
ID, MATERIALSOURCE, CLOCK, CODE, DESCRIPTION, ISAVAILABLE, REVISOR, REVISETIME,
|
|
|
- UNITID, BZ,MATERIALNO
|
|
|
+ UNITID, BZ,MATERIALNO,TIMEGRANID,ESTIMATEDVALUE
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.ID, t.MATERIALSOURCE, t.CLOCK, t.CODE, t.DESCRIPTION, t.ISAVAILABLE, t.REVISOR,
|
|
@@ -135,11 +137,11 @@
|
|
|
insert into FOLD_THE_VALUES (ID, MATERIALSOURCE, CLOCK,
|
|
|
CODE, DESCRIPTION, ISAVAILABLE,
|
|
|
REVISOR, REVISETIME,MATERIALNO,
|
|
|
- UNITID, BZ)
|
|
|
+ UNITID, BZ,TIMEGRANID,ESTIMATEDVALUE)
|
|
|
values (#{id,jdbcType=VARCHAR}, #{materialsource,jdbcType=VARCHAR}, #{clock,jdbcType=VARCHAR},
|
|
|
#{code,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{isavailable,jdbcType=VARCHAR},
|
|
|
#{revisor,jdbcType=VARCHAR}, #{revisetime,jdbcType=VARCHAR},#{materialno,jdbcType=VARCHAR},
|
|
|
- #{unitid,jdbcType=VARCHAR}, #{bz,jdbcType=VARCHAR})
|
|
|
+ #{unitid,jdbcType=VARCHAR}, #{bz,jdbcType=VARCHAR},#{timegranid,jdbcType=VARCHAR},#{estimatedvalue,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
|
|
|
insert into FOLD_THE_VALUES
|
|
@@ -218,7 +220,9 @@
|
|
|
REVISOR = #{revisor,jdbcType=VARCHAR},
|
|
|
REVISETIME = #{revisetime,jdbcType=VARCHAR},
|
|
|
UNITID = #{unitid,jdbcType=VARCHAR},
|
|
|
- BZ = #{bz,jdbcType=VARCHAR}
|
|
|
+ BZ = #{bz,jdbcType=VARCHAR},
|
|
|
+ TIMEGRANID = #{timegranid,jdbcType=VARCHAR},
|
|
|
+ ESTIMATEDVALUE = #{estimatedvalue,jdbcType=VARCHAR}
|
|
|
where ID = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
|
|
@@ -341,16 +345,101 @@
|
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
<select id="getDateForPage" parameterType="java.util.HashMap" resultType="Map">
|
|
|
select t.*, t1.id as energyid, t1.name as energyname
|
|
|
- from Fold_the_values t
|
|
|
- left join t_rm_energy t1
|
|
|
- on t.materialno = t1.bdesc1
|
|
|
+ from Fold_the_values t
|
|
|
+ left join t_rm_energy t1
|
|
|
+ on t.materialno = t1.id
|
|
|
+ <where>
|
|
|
+ <if test = "startTime != null and startTime != '' and endTime != null and endTime != '' " >
|
|
|
+ and t.clock between #{startTime} and #{endTime}
|
|
|
+ </if >
|
|
|
+ <if test = "energyname != null and energyname != '' " >
|
|
|
+ and t1.name = #{energyname}
|
|
|
+ </if >
|
|
|
+ <if test="timegranid != null and timegranid != ''">
|
|
|
+ and t.timegranid = #{timegranid}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by t.clock desc
|
|
|
+ </select>
|
|
|
+ <!---->
|
|
|
+ <select id="getNewDate" resultMap="BaseResultMap">
|
|
|
+ select t.batchno as id,
|
|
|
+ '三电厂' as materialsource,
|
|
|
+ to_char(to_date(t.monitordate, 'yyyymmdd hh24miss'),'yyyy-mm-dd') as clock,
|
|
|
+ t.monitoringvalue as estimatedvalue,
|
|
|
+ (t.MONITORINGVALUE * 0.03412 / 100) as code,
|
|
|
+ t.powersystemname as materialno
|
|
|
+ from t_cm_0348 t
|
|
|
+ where t.SITEM = 'BFHYD_05'
|
|
|
+ and t.powersystemname in ('P00006', 'P00007', 'P00008')
|
|
|
+ and t.powermonitorname in ('007', '008', '009')
|
|
|
+ and t.batchno not in (select distinct ID from FOLD_THE_VALUES)
|
|
|
+ </select>
|
|
|
+ <!--获取最近最新的数据-->
|
|
|
+ <select id="getNewOne" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ select *
|
|
|
+ from (select *
|
|
|
+ from FOLD_THE_VALUES
|
|
|
+ <where>
|
|
|
+ <if test="materialno != null and materialno !=''">
|
|
|
+ materialno = #{materialno}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by CLOCK desc)
|
|
|
+ where rownum = 1
|
|
|
+ </select>
|
|
|
+ <!--查询出昨天没有折标值的数据-->
|
|
|
+ <select id="getNozbzData" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ select distinct t.materialno
|
|
|
+ from FOLD_THE_VALUES t
|
|
|
+ where t.materialno not in
|
|
|
+ (select materialno from FOLD_THE_VALUES
|
|
|
+ <where>
|
|
|
+ <if test="clock != null and clock != ''">
|
|
|
+ clock = #{clock}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ </select>
|
|
|
+ <update id="updateByClockAndMaterialno" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
|
|
|
+ update FOLD_THE_VALUES
|
|
|
+ set
|
|
|
+ CLOCK = #{clock,jdbcType=VARCHAR},
|
|
|
+ CODE = #{code,jdbcType=VARCHAR},
|
|
|
+ ISAVAILABLE = #{isavailable,jdbcType=VARCHAR},
|
|
|
+ UNITID = #{unitid,jdbcType=VARCHAR},
|
|
|
+ TIMEGRANID = #{timegranid,jdbcType=VARCHAR},
|
|
|
+ MATERIALNO = #{materialno,jdbcType=VARCHAR}
|
|
|
<where>
|
|
|
- <if test="clock != null and clock != '' ">
|
|
|
- and t.clock = #{clock}
|
|
|
+ <if test="clock != null and clock != ''">
|
|
|
+ and CLOCK = #{clock,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="energyid != null and energyid != '' ">
|
|
|
- and t1.energyid = #{energyid}
|
|
|
+ <if test="materialno != null and materialno != ''">
|
|
|
+ and MATERIALNO = #{materialno,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</where>
|
|
|
+ </update>
|
|
|
+ <select id="getByClockAndMaterialno" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues" resultMap="BaseResultMap">
|
|
|
+ select * from FOLD_THE_VALUES
|
|
|
+ <where>
|
|
|
+ <if test="clock != null and clock != ''">
|
|
|
+ and CLOCK = #{clock,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="materialno != null and materialno != ''">
|
|
|
+ and MATERIALNO = #{materialno,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <!--获取月指标数据-->
|
|
|
+ <select id="getDateForMoth" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
+ select sum(t.ESTIMATEDVALUE) as estimatedvalue, t.MATERIALSOURCE,t.MATERIALNO
|
|
|
+ from FOLD_THE_VALUES t
|
|
|
+ <where>
|
|
|
+ <if test="startTime != null and startTime != '' and endTime != null and endTime !=''">
|
|
|
+ T.clock between #{startTime} AND
|
|
|
+ #{endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by t.MATERIALNO,MATERIALSOURCE
|
|
|
</select>
|
|
|
</mapper>
|