| | |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | <result column="supplementId" property="supplementId"/> |
| | | <result column="fireLevelName" property="fireLevelName"/> |
| | | <result column="findWayName" property="findWayName"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectFirePage" resultMap="fireResultMap"> |
| | | select fire.*,sup.id supplementId from sys_fire fire |
| | | LEFT JOIN sys_fire_supplement sup ON sup.fire_id = fire.id AND sup.is_deleted = 0 |
| | | where fire.is_deleted = 0 |
| | | SELECT fire.*,sup.id supplementId,biz.dict_value fireLevelName,biz2.dict_value findWayName |
| | | FROM sys_fire fire |
| | | LEFT JOIN blade_dict_biz biz ON biz.dict_key = fire.`level` AND biz.code = 'fire_level' |
| | | LEFT JOIN blade_dict_biz biz2 ON biz2.dict_key = fire.find_way AND biz2.`code` = 'fire_find_way' |
| | | LEFT JOIN sys_fire_supplement sup ON sup.fire_id = fire.id |
| | | AND sup.is_deleted = 0 |
| | | WHERE |
| | | fire.is_deleted = 0 |
| | | <if test="fire.location !=null and fire.location !='' "> |
| | | AND fire.location = #{fire.location,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler} |
| | | </if> |
| | |
| | | <if test="fire.alarmTimeEnd !=null and fire.alarmTimeEnd !=''"> |
| | | AND DATE_FORMAT(fire.alarm_time,'%Y-%m-%d') <= #{fire.alarmTimeEnd} |
| | | </if> |
| | | <if test="fire.level !=null and fire.level !=''"> |
| | | AND fire.level = #{fire.level} |
| | | </if> |
| | | <if test="fire.fireDate !=null and fire.fireDate !=''"> |
| | | AND DATE_FORMAT(fire.alarm_time,'%Y-%m-%d') = #{fire.fireDate} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getRealtime" resultMap="fireResultMap"> |
| | | SELECT |
| | | fire.*,biz.dict_value fireLevelName,biz2.dict_value findWayName |
| | | FROM |
| | | sys_fire fire |
| | | LEFT JOIN blade_dict_biz biz ON biz.dict_key = fire.level AND biz.`code` = 'fire_level' |
| | | LEFT JOIN blade_dict_biz biz2 ON biz2.dict_key = fire.find_way AND biz2.`code` = 'fire_find_way' |
| | | WHERE |
| | | fire.is_deleted = 0 |
| | | AND DATE_FORMAT( fire.alarm_time, '%Y-%m-%d' ) >= DATE_FORMAT(DATE_SUB(now(),INTERVAL #{time} HOUR ), '%Y-%m-%d' ) |
| | | AND DATE_FORMAT( fire.alarm_time, '%Y-%m-%d' ) <= DATE_FORMAT(NOW(),'%Y-%m-%d' ) |
| | | |
| | | ORDER BY fire.alarm_time DESC |
| | | </select> |
| | | |
| | | |
| | | </mapper> |