| | |
| | | <?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.whyc.mapper.DevalarmDataMapper"> |
| | | <resultMap type="com.whyc.pojo.db_alarm.DevalarmData" id="almDev"> |
| | | <id column="num" property="num"/> |
| | | <result column="dev_id" property="devId"/> |
| | | <result column="alm_id" property="almId"/> |
| | | <result column="alm_signal_id" property="almSignalId"/> |
| | | <result column="alm_starttime" property="almStarttime"/> |
| | | <result column="alm_value" property="almValue"/> |
| | | <result column="alm_is_confirmed" property="almIsConfirmed"/> |
| | | <result column="confirmed_uid" property="confirmedUid"/> |
| | | <result column="confirmed_time" property="confirmedTime"/> |
| | | <result column="alm_endtime" property="almEndtime"/> |
| | | <result column="alm_cleared_type" property="almClearedType"/> |
| | | <!-- 它是用于指定从表方的引用实体属性的 --> |
| | | <association property="devInf" javaType="devInf" |
| | | select="selectDinf" |
| | | column="dev_id"> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <select id="getDAlmInf" resultType="com.whyc.pojo.db_alarm.DevalarmData"> |
| | | <select id="getDAlmInf" resultMap="almDev"> |
| | | select * from db_alarm.tb_devalarm_data |
| | | <where> |
| | | <if test="dto.devId!=null"> |
| | | and dev_id=#{dto.devId} |
| | | </if> |
| | | <if test="dto.devType!=null"> |
| | | and FLOOR(dev_id/100000000) =#{dto.devType} |
| | | </if> |
| | |
| | | ) |
| | | </where> |
| | | </select> |
| | | <select id="selectDinf" resultType="devInf" parameterType="int" > |
| | | select * from db_lithium_ram_db.tb_dev_inf where dev_id = #{dev_id} |
| | | </select> |
| | | |
| | | </mapper> |