| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476 |
- <?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.chinaitop.depot.tempWarn.mapper.TTempWetAlarmMapper" >
- <resultMap id="BaseResultMap" type="com.chinaitop.depot.tempWarn.model.TTempWetAlarm" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="house_id" property="houseId" jdbcType="INTEGER" />
- <result column="house_code" property="houseCode" jdbcType="VARCHAR" />
- <result column="hwxz" property="hwxz" jdbcType="INTEGER" />
- <result column="pz" property="pz" jdbcType="INTEGER" />
- <result column="threshold_value" property="thresholdValue" jdbcType="INTEGER" />
- <result column="alarm_time" property="alarmTime" jdbcType="TIMESTAMP" />
- <result column="restore_time" property="restoreTime" jdbcType="TIMESTAMP" />
- <result column="duration_days" property="durationDays" jdbcType="INTEGER" />
- <result column="approval_status" property="approvalStatus" jdbcType="VARCHAR" />
- <result column="org_id" property="orgId" jdbcType="INTEGER" />
- <result column="threshold_type" property="thresholdType" jdbcType="INTEGER" />
- <result column="temp_value" property="tempValue" jdbcType="DECIMAL" />
- <result column="process_status" property="processStatus" jdbcType="VARCHAR" />
- <result column="supervision_status" property="supervisionStatus" jdbcType="VARCHAR" />
- <!-- 下面是业务字段 -->
- <result column="yjzt" property="yjzt" jdbcType="VARCHAR" />
- <result column="clordbzt" property="clordbzt" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Example_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause" >
- <where >
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List" >
- id, house_id, house_code, hwxz, pz, threshold_value, alarm_time, restore_time, duration_days,
- approval_status, org_id, threshold_type, temp_value, process_status, supervision_status
- </sql>
- <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.tempWarn.model.TTempWetAlarmExample" >
- select
- <if test="distinct" >
- distinct
- </if>
- <include refid="Base_Column_List" />
- from t_temp_wet_alarm
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null" >
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from t_temp_wet_alarm
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from t_temp_wet_alarm
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.chinaitop.depot.tempWarn.model.TTempWetAlarmExample" >
- delete from t_temp_wet_alarm
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.chinaitop.depot.tempWarn.model.TTempWetAlarm" >
- insert into t_temp_wet_alarm (id, house_id, house_code,
- hwxz, pz, threshold_value,
- alarm_time, restore_time, duration_days,
- approval_status, org_id, threshold_type,
- temp_value, process_status, supervision_status)
- values (#{id,jdbcType=VARCHAR}, #{houseId,jdbcType=INTEGER}, #{houseCode,jdbcType=VARCHAR},
- #{hwxz,jdbcType=INTEGER}, #{pz,jdbcType=INTEGER}, #{thresholdValue,jdbcType=INTEGER},
- #{alarmTime,jdbcType=TIMESTAMP}, #{restoreTime,jdbcType=TIMESTAMP}, #{durationDays,jdbcType=INTEGER},
- #{approvalStatus,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{thresholdType,jdbcType=INTEGER},
- #{tempValue,jdbcType=DECIMAL}, #{processStatus,jdbcType=VARCHAR}, #{supervisionStatus,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.chinaitop.depot.tempWarn.model.TTempWetAlarm" >
- insert into t_temp_wet_alarm
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="houseId != null" >
- house_id,
- </if>
- <if test="houseCode != null" >
- house_code,
- </if>
- <if test="hwxz != null" >
- hwxz,
- </if>
- <if test="pz != null" >
- pz,
- </if>
- <if test="thresholdValue != null" >
- threshold_value,
- </if>
- <if test="alarmTime != null" >
- alarm_time,
- </if>
- <if test="restoreTime != null" >
- restore_time,
- </if>
- <if test="durationDays != null" >
- duration_days,
- </if>
- <if test="approvalStatus != null" >
- approval_status,
- </if>
- <if test="orgId != null" >
- org_id,
- </if>
- <if test="thresholdType != null" >
- threshold_type,
- </if>
- <if test="tempValue != null" >
- temp_value,
- </if>
- <if test="tempValue != null" >
- process_status,
- </if>
- <if test="tempValue != null" >
- supervision_status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="houseId != null" >
- #{houseId,jdbcType=INTEGER},
- </if>
- <if test="houseCode != null" >
- #{houseCode,jdbcType=VARCHAR},
- </if>
- <if test="hwxz != null" >
- #{hwxz,jdbcType=INTEGER},
- </if>
- <if test="pz != null" >
- #{pz,jdbcType=INTEGER},
- </if>
- <if test="thresholdValue != null" >
- #{thresholdValue,jdbcType=INTEGER},
- </if>
- <if test="alarmTime != null" >
- #{alarmTime,jdbcType=TIMESTAMP},
- </if>
- <if test="restoreTime != null" >
- #{restoreTime,jdbcType=TIMESTAMP},
- </if>
- <if test="durationDays != null" >
- #{durationDays,jdbcType=INTEGER},
- </if>
- <if test="approvalStatus != null" >
- #{approvalStatus,jdbcType=VARCHAR},
- </if>
- <if test="orgId != null" >
- #{orgId,jdbcType=INTEGER},
- </if>
- <if test="thresholdType != null" >
- #{thresholdType,jdbcType=INTEGER},
- </if>
- <if test="tempValue != null" >
- #{tempValue,jdbcType=DECIMAL},
- </if>
- <if test="approvalStatus != null" >
- #{processStatus,jdbcType=VARCHAR},
- </if>
- <if test="approvalStatus != null" >
- #{supervisionStatus,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.chinaitop.depot.tempWarn.model.TTempWetAlarmExample" resultType="java.lang.Integer" >
- select count(*) from t_temp_wet_alarm
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map" >
- update t_temp_wet_alarm
- <set >
- <if test="record.id != null" >
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.houseId != null" >
- house_id = #{record.houseId,jdbcType=INTEGER},
- </if>
- <if test="record.houseCode != null" >
- house_code = #{record.houseCode,jdbcType=VARCHAR},
- </if>
- <if test="record.hwxz != null" >
- hwxz = #{record.hwxz,jdbcType=INTEGER},
- </if>
- <if test="record.pz != null" >
- pz = #{record.pz,jdbcType=INTEGER},
- </if>
- <if test="record.thresholdValue != null" >
- threshold_value = #{record.thresholdValue,jdbcType=INTEGER},
- </if>
- <if test="record.alarmTime != null" >
- alarm_time = #{record.alarmTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.restoreTime != null" >
- restore_time = #{record.restoreTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.durationDays != null" >
- duration_days = #{record.durationDays,jdbcType=INTEGER},
- </if>
- <if test="record.approvalStatus != null" >
- approval_status = #{record.approvalStatus,jdbcType=VARCHAR},
- </if>
- <if test="record.orgId != null" >
- org_id = #{record.orgId,jdbcType=INTEGER},
- </if>
- <if test="record.thresholdType != null" >
- threshold_type = #{record.thresholdType,jdbcType=INTEGER},
- </if>
- <if test="record.tempValue != null" >
- temp_value = #{record.tempValue,jdbcType=DECIMAL},
- </if>
- <if test="record.approvalStatus != null" >
- process_status = #{record.processStatus,jdbcType=VARCHAR},
- </if>
- <if test="record.approvalStatus != null" >
- supervision_status = #{record.supervisionStatus,jdbcType=VARCHAR},
- </if>
- </set>
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map" >
- update t_temp_wet_alarm
- set id = #{record.id,jdbcType=VARCHAR},
- house_id = #{record.houseId,jdbcType=INTEGER},
- house_code = #{record.houseCode,jdbcType=VARCHAR},
- hwxz = #{record.hwxz,jdbcType=INTEGER},
- pz = #{record.pz,jdbcType=INTEGER},
- threshold_value = #{record.thresholdValue,jdbcType=INTEGER},
- alarm_time = #{record.alarmTime,jdbcType=TIMESTAMP},
- restore_time = #{record.restoreTime,jdbcType=TIMESTAMP},
- duration_days = #{record.durationDays,jdbcType=INTEGER},
- approval_status = #{record.approvalStatus,jdbcType=VARCHAR},
- org_id = #{record.orgId,jdbcType=INTEGER},
- threshold_type = #{record.thresholdType,jdbcType=INTEGER},
- temp_value = #{record.tempValue,jdbcType=DECIMAL},
- process_status = #{record.processStatus,jdbcType=VARCHAR},
- supervision_status = #{record.supervisionStatus,jdbcType=VARCHAR}
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.tempWarn.model.TTempWetAlarm" >
- update t_temp_wet_alarm
- <set >
- <if test="houseId != null" >
- house_id = #{houseId,jdbcType=INTEGER},
- </if>
- <if test="houseCode != null" >
- house_code = #{houseCode,jdbcType=VARCHAR},
- </if>
- <if test="hwxz != null" >
- hwxz = #{hwxz,jdbcType=INTEGER},
- </if>
- <if test="pz != null" >
- pz = #{pz,jdbcType=INTEGER},
- </if>
- <if test="thresholdValue != null" >
- threshold_value = #{thresholdValue,jdbcType=INTEGER},
- </if>
- <if test="alarmTime != null" >
- alarm_time = #{alarmTime,jdbcType=TIMESTAMP},
- </if>
- <if test="restoreTime != null" >
- restore_time = #{restoreTime,jdbcType=TIMESTAMP},
- </if>
- <if test="durationDays != null" >
- duration_days = #{durationDays,jdbcType=INTEGER},
- </if>
- <if test="approvalStatus != null" >
- approval_status = #{approvalStatus,jdbcType=VARCHAR},
- </if>
- <if test="orgId != null" >
- org_id = #{orgId,jdbcType=INTEGER},
- </if>
- <if test="thresholdType != null" >
- threshold_type = #{thresholdType,jdbcType=INTEGER},
- </if>
- <if test="tempValue != null" >
- temp_value = #{tempValue,jdbcType=DECIMAL},
- </if>
- <if test="approvalStatus != null" >
- process_status = #{processStatus,jdbcType=VARCHAR},
- </if>
- <if test="approvalStatus != null" >
- supervision_status = #{supervisionStatus,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.tempWarn.model.TTempWetAlarm" >
- update t_temp_wet_alarm
- set house_id = #{houseId,jdbcType=INTEGER},
- house_code = #{houseCode,jdbcType=VARCHAR},
- hwxz = #{hwxz,jdbcType=INTEGER},
- pz = #{pz,jdbcType=INTEGER},
- threshold_value = #{thresholdValue,jdbcType=INTEGER},
- alarm_time = #{alarmTime,jdbcType=TIMESTAMP},
- restore_time = #{restoreTime,jdbcType=TIMESTAMP},
- duration_days = #{durationDays,jdbcType=INTEGER},
- approval_status = #{approvalStatus,jdbcType=VARCHAR},
- org_id = #{orgId,jdbcType=INTEGER},
- threshold_type = #{thresholdType,jdbcType=INTEGER},
- temp_value = #{tempValue,jdbcType=DECIMAL},
- process_status = #{processStatus,jdbcType=VARCHAR},
- supervision_status = #{supervisionStatus,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="selectTempDataForToday" parameterType="string" resultType="com.chinaitop.depot.tempWarn.model.TTempWetAlarm">
- select
- t1.id,
- t1.org_id orgId,
- t1.storehouse houseCode,
- bs.storehouse_id houseId,
- kkd.hwxz,
- kkd.pz,
- t1.inh inH,
- t1.t_max tMax
- from
- t_testdata t1
- left join basic_storehouse bs on t1.org_id = bs.org_id and t1.storehouse = bs.storehouse_code
- left join lsreport_ts:data_kcgl_kcsw_default kkd on bs.org_id = kkd.unitid and bs.storehouse_id = kkd.ch
- where t1.org_id is not null
- and t1.ilq_yq = '0'
- and t1.t_time > #{now}
- </select>
- <select id="selectOneObject" parameterType="map" resultType="com.chinaitop.depot.tempWarn.model.TTempWetAlarm">
- select
- id,
- duration_days durationDays
- from
- t_temp_wet_alarm
- where
- org_id = #{orgId}
- and house_id = #{houseId}
- and threshold_type = #{thresholdType}
- and alarm_time between #{yesterday} and #{today}
- </select>
- <select id="selectAllByRestoreTimeIsNull" parameterType="string" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from
- t_temp_wet_alarm
- where
- restore_time is null
- and alarm_time < #{yesterday}
- </select>
- <select id="getModalPageList" parameterType="com.chinaitop.depot.tempWarn.param.TempWetCheckRecordPageParam" resultType="java.util.Map">
- select
- id,
- storehouse,
- t_time time,
- intemp,
- inh,
- outtemp,
- outh,
- t_max max,
- t_min min,
- t_avg avg
- from
- t_testdata
- where
- ilq_yq = #{ilqYq}
- and org_id = #{orgId}
- and storehouse = #{houseCode}
- and t_time between #{startTime} and #{endTime}
- </select>
- <select id="selectList" parameterType="com.chinaitop.depot.tempWarn.param.TTempWetAlarmPageParam" resultMap="BaseResultMap">
- select
- *
- from (
- select
- id, house_id, house_code, hwxz, pz, threshold_value, alarm_time,
- restore_time, duration_days, approval_status, org_id, threshold_type,
- temp_value, process_status, supervision_status,
- case approval_status
- when '900000' then '待处理'
- when '900001' then '处理中'
- when '900002' then '待处理 督办中'
- when '900003' then '处理中 督办中'
- when '900004' then '督办中'
- when '900005' then '二次督办中'
- when '900006' then '二次督办完成'
- when '900007' then '待督办'
- when '999999' then '处理完成'
- else ''
- end clordbzt,
- case when (restore_time is not null) and (approval_status = '999999' or approval_status = '900086') then '已解决' else'未解决' end yjzt
- from t_temp_wet_alarm
- ) a
- where 1=1
- <if test="orgId != null">
- and a.org_id=#{orgId}
- </if>
- <if test="thresholdType != null">
- and a.threshold_type=#{thresholdType}
- </if>
- <if test="pz != null">
- and a.pz=#{pz}
- </if>
- <if test="hwxz != null">
- and a.hwxz=#{hwxz}
- </if>
- <if test="alarmTime != null">
- and a.alarm_time=#{alarmTime}
- </if>
- <if test="clordbzt != null">
- and a.clordbzt=#{clordbzt}
- </if>
- <if test="yjzt != null">
- and a.yjzt=#{yjzt}
- </if>
- </select>
- </mapper>
|