首页 技术 正文
技术 2022年11月6日
0 收藏 661 点赞 402 浏览 10826 个字

<?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.xinwei.order.dao.OrderAlarmTblMapper” >
  <resultMap id=”BaseResultMap” type=”com.xinwei.order.entity.OrderAlarmTbl” >
    <id column=”id” property=”id” jdbcType=”BIGINT” />
    <result column=”alarm_id” property=”alarmId” jdbcType=”VARCHAR” />
    <result column=”data_id” property=”dataId” jdbcType=”VARCHAR” />
    <result column=”device_name” property=”deviceName” jdbcType=”VARCHAR” />
    <result column=”device_id” property=”deviceId” jdbcType=”VARCHAR” />
    <result column=”alarm_topic” property=”alarmTopic” jdbcType=”VARCHAR” />
    <result column=”level” property=”level” jdbcType=”VARCHAR” />
    <result column=”order_status” property=”orderStatus” jdbcType=”VARCHAR” />
    <result column=”cost_time” property=”costTime” jdbcType=”VARCHAR” />
    <result column=”proc_inst_id” property=”procInstId” jdbcType=”VARCHAR” />
    <result column=”create_time” property=”createTime” jdbcType=”TIMESTAMP” />
     <result column=”alarm_type” property=”alarmType” jdbcType=”VARCHAR” />
    <result column=”alarm_location” property=”alarmLocation” jdbcType=”VARCHAR” />
    <result column=”ext” property=”ext” jdbcType=”VARCHAR” />
    <result column=”suspend_reason” property=”suspendReason” jdbcType=”VARCHAR” />
  </resultMap>
 
      <delete id=”deleteById” parameterType=”java.lang.Long” >
        delete from order_alarm_tbl
        where id = #{id,jdbcType=BIGINT}
      </delete>
      
        <delete id=”deleteAll”>
        delete from order_alarm_tbl
      </delete>
      
        <delete id=”deleteByAlarmId” parameterType=”java.lang.String” >
        delete from order_alarm_tbl
        where alarm_id = #{alarmId,jdbcType=VARCHAR}
      </delete>
 
      <insert id=”insert” parameterType=”com.xinwei.order.entity.OrderAlarmTbl” >
        insert into order_alarm_tbl (id, alarm_id, data_id,
          device_name, device_id, alarm_topic, alarm_type, alarm_location,
          level, order_status, cost_time,
          proc_inst_id, create_time, ext,suspend_reason
          )
        values (#{id,jdbcType=BIGINT}, #{alarmId,jdbcType=VARCHAR}, #{dataId,jdbcType=VARCHAR},
          #{deviceName,jdbcType=VARCHAR}, #{deviceId,jdbcType=VARCHAR}, #{alarmTopic,jdbcType=VARCHAR},
          #{alarmType,jdbcType=VARCHAR}, #{alarmLocation,jdbcType=VARCHAR},  
          #{level,jdbcType=VARCHAR}, #{orderStatus,jdbcType=VARCHAR}, #{costTime,jdbcType=VARCHAR},
          #{procInstId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{ext,jdbcType=VARCHAR}, #{suspendReason,jdbcType=VARCHAR}
          )
      </insert>
 
     <insert id=”insertByBatch” parameterType=”java.util.List”>
        insert into order_alarm_tbl (id,alarm_id, data_id,
      device_name, device_id, alarm_topic, alarm_type, alarm_location,
      level, order_status, cost_time,
      proc_inst_id, create_time, ext,suspend_reason
      )
        values
        <foreach collection=”list” item=”item” index=”index” separator=”,”>
         ( #{item.id,jdbcType=BIGINT},#{item.alarmId,jdbcType=VARCHAR}, #{item.dataId,jdbcType=VARCHAR},
      #{item.deviceName,jdbcType=VARCHAR}, #{item.deviceId,jdbcType=VARCHAR}, #{item.alarmTopic,jdbcType=VARCHAR},
      #{item.alarmType,jdbcType=VARCHAR}, #{item.alarmLocation,jdbcType=VARCHAR},  
      #{item.level,jdbcType=VARCHAR}, #{item.orderStatus,jdbcType=VARCHAR}, #{item.costTime,jdbcType=VARCHAR},
      #{item.procInstId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.ext,jdbcType=VARCHAR}, #{item.suspendReason,jdbcType=VARCHAR}
      )
        </foreach>
    </insert>
 
  <update id=”updateByPrimaryKey” parameterType=”com.xinwei.order.entity.OrderAlarmTbl” >
    update order_alarm_tbl
    set alarm_id = #{alarmId,jdbcType=VARCHAR},
    data_id = #{dataId,jdbcType=VARCHAR},
    device_name = #{deviceName,jdbcType=VARCHAR},
    device_id = #{deviceId,jdbcType=VARCHAR},
    alarm_topic = #{alarmTopic,jdbcType=VARCHAR},
    alarm_type = #{alarmType,jdbcType=VARCHAR},
    alarm_location = #{alarmLocation,jdbcType=VARCHAR},
    level = #{level,jdbcType=VARCHAR},
    order_status = #{orderStatus,jdbcType=VARCHAR},
    cost_time = #{costTime,jdbcType=VARCHAR},
    proc_inst_id = #{procInstId,jdbcType=VARCHAR},
    create_time = #{createTime,jdbcType=TIMESTAMP},
    ext = #{ext,jdbcType=VARCHAR},
    suspend_reason = #{suspendReason,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
 
    <update id=”updateOrderStatusByDataId” parameterType=”com.xinwei.order.entity.OrderAlarmTbl” >
    update order_alarm_tbl
    set order_status = #{orderStatus,jdbcType=VARCHAR}
    where data_id = #{dataId,jdbcType=VARCHAR}
  </update>
 
   <update id=”updateSuspendReasonByDataId” parameterType=”com.xinwei.order.entity.OrderAlarmTbl” >
    update order_alarm_tbl
    set suspend_reason = #{suspendReason,jdbcType=VARCHAR}
    where data_id = #{dataId,jdbcType=VARCHAR}
  </update>
 
   <update id=”updateSuspendReasonByProcessInstId” parameterType=”com.xinwei.order.entity.OrderAlarmTbl” >
    update order_alarm_tbl
    set suspend_reason = #{suspendReason,jdbcType=VARCHAR}
    where proc_inst_id = #{procInstId,jdbcType=VARCHAR}
  </update>
 
  <select id=”selectByPrimaryKey” resultMap=”BaseResultMap” parameterType=”java.lang.Long” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic,alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    where id = #{id,jdbcType=BIGINT}
  </select>
 
    <select id=”getByDataId” resultMap=”BaseResultMap” parameterType=”java.lang.Long” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic,alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    where data_id = #{dataId,jdbcType=VARCHAR}
  </select>
 
    <select id=”getByAlarmId” resultMap=”BaseResultMap” parameterType=”java.lang.String” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic,alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    where alarm_id = #{alarmId,jdbcType=VARCHAR}
  </select>
 
   <select id=”getById” resultMap=”BaseResultMap” parameterType=”java.lang.Long” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic,alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    where id = #{id,jdbcType=BIGINT}
  </select>
 
  <select id=”countMyApplyByCondition” resultType=”java.lang.Long” >
    select count(1)
   from order_alarm_tbl
    where 1=1 <include refid=”queryString” />
  </select>
 
   <select id=”selectMyApplyByCondition” resultMap=”BaseResultMap” >
 select id, alarm_id, data_id, device_name, device_id, alarm_topic,alarm_type, alarm_location,  level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    WHERE 1=1
    <include refid=”queryString” />
    limit #{startRow},#{pageSize}
  </select>

<select id=”countAll” resultType=”java.lang.Long” >
    SELECT COUNT(*)
    from order_alarm_tbl
   </select>

<select id=”getAll” resultMap=”BaseResultMap” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic, alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    limit #{startRow},#{pageSize}
  </select>
 
    <select id=”selectAll” resultMap=”BaseResultMap” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic, alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    order by create_time desc
  </select>
 
   <select id=”selectAllAlarmType” resultType=”java.lang.String” >
  SELECT DISTINCT alarm_type
    FROM order_alarm_tbl
  </select>
 
  <select id=”getSuspendTask” resultMap=”BaseResultMap” >
   SELECT * FROM order_alarm_tbl WHERE suspend_reason IS NOT null
    order by create_time desc
  </select>
 
  <select id=”countByCondition” resultType=”java.lang.Long” >
    SELECT COUNT(*)
      from order_alarm_tbl
      where 1=1
    <include refid=”queryString” />
   </select>
   
    <select id=”getByCondition” resultMap=”BaseResultMap” parameterType=”java.lang.String” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic,alarm_type, alarm_location,  level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    WHERE 1=1
    <include refid=”queryString” />
    limit #{startRow},#{pageSize}
  </select>
 
     <select id=”countExportByCondition” resultType=”java.lang.Long” >
    SELECT COUNT(*)
      from order_alarm_tbl
      where 1=1
    <include refid=”queryString” />
   </select>
 
    <select id=”exportByCondition” resultMap=”BaseResultMap” parameterType=”java.lang.String” >
     select id, alarm_id, data_id, device_name, device_id, alarm_topic,alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    WHERE 1=1
    <include refid=”queryString” />
  </select>
 
    <select id=”selectProcInstIdByCondition” resultType=”java.lang.String” >
    select proc_inst_id
    from order_alarm_tbl
    where 1=1 <include refid=”queryString” />
  </select>
 
    <select id=”countTAToDoListByCondition” resultType=”java.lang.Long” >
    SELECT COUNT(*)
      from order_alarm_tbl
      where 1=1
    <include refid=”queryTAToDoListByCondition” />
   </select>
   
    <select id=”getTAToDoListByCondition” resultMap=”BaseResultMap” parameterType=”java.lang.String” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic, alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    WHERE 1=1
    <include refid=”queryTAToDoListByCondition” />
    limit #{startRow},#{pageSize}
  </select>
 
 
    <select id=”getTAToDoListByConditionNoPage” resultMap=”BaseResultMap” parameterType=”java.lang.String” >
    select id, alarm_id, data_id, device_name, device_id, alarm_topic, alarm_type, alarm_location, level, order_status,
    cost_time, proc_inst_id, create_time, ext,suspend_reason
    from order_alarm_tbl
    WHERE 1=1
    <include refid=”queryTAToDoListByCondition” />
  </select>

<sql id=”queryTAToDoListByCondition”>
    
      <if test=”alarmType != null and alarmType !=””>
     and alarm_type = #{alarmType,jdbcType=VARCHAR}
    </if>
    
      <if test=”alarmLocation != null and alarmLocation !=””>
     and alarm_location = #{alarmLocation,jdbcType=VARCHAR}
    </if>
    
     <if test=”level != null and level !=””>
     and level = #{level,jdbcType=VARCHAR}
    </if>
    
     <if test=”alarmId != null and alarmId !=””>
     and alarm_id = #{alarmId,jdbcType=VARCHAR}
    </if>
    
    <if test=”deviceId != null and deviceId !=””>
     and device_id = #{deviceId,jdbcType=VARCHAR}
    </if>
    
    <if test=”alarmTopic != null and alarmTopic !=””>
     and alarm_topic LIKE ‘%${alarmTopic}%’
    </if>

</sql>
 
  <sql id=”queryString”>
     <if test=”alarmId != null and alarmId !=””>
     and alarm_id = #{alarmId,jdbcType=VARCHAR}
    </if>
    
    <if test=”deviceId != null and deviceId !=””>
     and device_id = #{deviceId,jdbcType=VARCHAR}
    </if>
    
    <if test=”alarmTopic != null and alarmTopic !=””>
     and alarm_topic LIKE ‘%${alarmTopic}%’
    </if>
    
     <if test=”startTime != null and endTime != null”>
        and DATE_FORMAT(create_time,’%m-%d-%Y’)
           between DATE_FORMAT(#{startTime,jdbcType=VARCHAR},’%m-%d-%Y’)
           and DATE_FORMAT(#{endTime,jdbcType=VARCHAR},’%m-%d-%Y’)
    </if>
 </sql>
</mapper>

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,084
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,559
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,408
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,181
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,818
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,901