| | |
| | | <mapper namespace="org.springblade.modules.fire.mapper.FireMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="fireResultMap" type="org.springblade.modules.fire.entity.FireEntity"> |
| | | <resultMap id="fireResultMap" type="org.springblade.modules.fire.vo.FireVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="no" property="no"/> |
| | | <result column="location" property="location" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | <result column="supplementId" property="supplementId"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectFirePage" resultMap="fireResultMap"> |
| | | select * from sys_fire where is_deleted = 0 |
| | | 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 |
| | | <if test="fire.location !=null and fire.location !='' "> |
| | | AND location = #{fire.location,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler} |
| | | AND fire.location = #{fire.location,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler} |
| | | </if> |
| | | <if test="fire.no !=null and fire.no !=''"> |
| | | AND fire.no LIKE CONCAT('%',#{fire.no},'%') |
| | | </if> |
| | | <if test="fire.address !=null and fire.address !=''"> |
| | | AND fire.address LIKE CONCAT('%',#{fire.address},'%') |
| | | </if> |
| | | <if test="fire.findWay!=null and fire.findWay !=''"> |
| | | AND fire.find_way = #{fire.findWay} |
| | | </if> |
| | | <if test="fire.status!=null and fire.status !=''"> |
| | | AND fire.status = #{fire.status} |
| | | </if> |
| | | <if test="fire.alarmTimeStart !=null and fire.alarmTimeStart !=''"> |
| | | AND DATE_FORMAT(fire.alarm_time,'%Y-%m-%d') >= #{fire.alarmTimeStart} |
| | | </if> |
| | | <if test="fire.alarmTimeEnd !=null and fire.alarmTimeEnd !=''"> |
| | | AND DATE_FORMAT(fire.alarm_time,'%Y-%m-%d') <= #{fire.alarmTimeEnd} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | <select id="getAll" 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 AND sup.id IS NULL |
| | | <if test="fire.no !=null and fire.no !=''"> |
| | | AND fire.no LIKE CONCAT('%',#{fire.no},'%') |
| | | </if> |
| | | |
| | | </select> |