<?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="org.springblade.modules.jingdan.mapper.JingdanMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="jingdanResultMap" type="org.springblade.modules.jingdan.vo.JingdanVO">
|
<id column="id" property="id"/>
|
<result column="galarmPeople" property="galarmPeople"/>
|
<result column="phoneNumber" property="phoneNumber"/>
|
<result column="place" property="place"/>
|
<result column="content" property="content"/>
|
<result column="galarmTime" property="galarmTime"/>
|
<result column="waringType" property="waringType"/>
|
<result column="deviceNumber" property="deviceNumber"/>
|
<result column="type" property="type"/>
|
<result column="handleP" property="handleP"/>
|
<result column="handleTime" property="handleTime"/>
|
<result column="handName" property="handName"/>
|
<result column="level" property="level"/>
|
<result column="coordinate" property="coordinate"/>
|
<result column="jd" property="jd"/>
|
<result column="wd" property="wd"/>
|
<result column="addvcd" property="addvcd"/>
|
<result column="rName" property="rName"/>
|
<result column="handletype" property="handletype"/>
|
</resultMap>
|
|
|
<select id="selectJingdanPage" resultMap="jingdanResultMap">
|
select * from sys_jingdan where is_deleted = 0
|
</select>
|
|
<select id="selectList" resultMap="jingdanResultMap">
|
SELECT j.id,j.galarmPeople,j.phoneNumber,j.place,j.content,j.galarmTime,j.waringType,j.deviceNumber,j.type,
|
j.handleP,j.handleTime,j.handName,j.level,ST_ASTEXT(j.coordinate) as coordinate,j.jd,j.wd,j.addvcd,j.rName,
|
d.addvnm FROM sys_jingdan j LEFT JOIN sys_district d on d.addvcds=j.addvcd where 1=1
|
<if test="waringType!=null and waringType!=''">
|
and j.waringType=#{waringType}
|
</if>
|
<if test="beginTime!=null and beginTime!=''">
|
and j.galarmTime >=#{beginTime}
|
</if>
|
<if test="endTime!=null and endTime!=''">
|
and j.galarmTime <=#{endTime}
|
</if>
|
<if test="addvcd!=null and addvcd!=''">
|
and j.addvcd=#{addvcd}
|
</if>
|
<if test="type!=null and type!=''">
|
and j.type=#{type}
|
</if>
|
ORDER BY j.type asc,j.galarmTime desc
|
</select>
|
|
<select id="selectdInfo" resultMap="jingdanResultMap">
|
SELECT j.id,j.galarmPeople,j.phoneNumber,j.place,j.content,j.galarmTime,j.waringType,j.deviceNumber,j.type,
|
j.handleP,j.handleTime,j.handName,j.level,ST_ASTEXT(j.coordinate) as coordinate,j.jd,j.wd,j.addvcd,j.rName,j.handletype,
|
d.addvnm FROM sys_jingdan j LEFT JOIN sys_district d on d.addvcds=j.addvcd where 1=1
|
<if test="deviceNumber!=null and deviceNumber!=''">
|
and j.deviceNumber=#{deviceNumber}
|
</if>
|
<if test="id!=null and id!=''">
|
and j.id=#{id}
|
</if>
|
</select>
|
|
<!--APP警单列表-->
|
<select id="selectLists" resultMap="jingdanResultMap">
|
SELECT j.id,j.galarmPeople,j.phoneNumber,j.place,j.content,j.galarmTime,j.waringType,j.deviceNumber,j.type,
|
j.handleP,j.handleTime,j.handName,j.level,ST_ASTEXT(j.coordinate) as coordinate,j.jd,j.wd,j.addvcd,j.rName,j.handletype,
|
d.addvnm FROM sys_jingdan j LEFT JOIN sys_district d on d.addvcds=j.addvcd where 1=1
|
<if test="handleP!=null and handleP!=''">
|
and j.handleP=#{handleP}
|
</if>
|
<if test="type!=null and type!=''">
|
and j.type >=#{type}
|
</if>
|
</select>
|
|
<!-- <insert id="insert">
|
insert into sys_jingdan(galarmPeople,phoneNumber,place,content,galarmTime,waringType,deviceNumber,type,
|
handleP,handleTime,handName,level,coordinate,jd,wd,addvcd)
|
values (#{galarmPeople},#{phoneNumber},#{place},#{content},#{galarmTime}
|
,#{waringType},#{deviceNumber},#{type},#{handleP},#{handleTime},
|
#{handName},#{level},POINT(#{jd},#{wd}),#{jd},#{wd},#{addvcd})
|
</insert>-->
|
|
|
<sql id="key">
|
<trim suffixOverrides=",">
|
<if test="galarmPeople!=null and galarmPeople!=''">
|
galarmPeople,
|
</if>
|
<if test="phoneNumber!=null and phoneNumber!=''">
|
phoneNumber,
|
</if>
|
<if test="place!=null and place!=''">
|
place,
|
</if>
|
<if test="content!=null and content!=''">
|
content,
|
</if>
|
<if test="galarmTime!=null and galarmTime!=''">
|
galarmTime,
|
</if>
|
<if test="waringType!=null and waringType!=''">
|
waringType,
|
</if>
|
<if test="deviceNumber!=null and deviceNumber!=''">
|
deviceNumber,
|
</if>
|
<if test="type!=null and type!=''">
|
type,
|
</if>
|
<if test="handleP!=null and handleP!=''">
|
handleP,
|
</if>
|
<if test="handleTime!=null and handleTime!=''">
|
handleTime,
|
</if>
|
<if test="handName!=null and handName!=''">
|
handName,
|
</if>
|
<if test="level!=null and level!=''">
|
level,
|
</if>
|
<if test="coordinate=null and coordinate=''">
|
coordinate,
|
</if>
|
<if test="jd!=null and jd!=''">
|
jd,
|
</if>
|
<if test="wd!=null and wd!=''">
|
wd,
|
</if>
|
<if test="addvcd!=null and addvcd!=''">
|
addvcd,
|
</if>
|
<if test="rName!=null and rName!=''">
|
rName,
|
</if>
|
<if test="czTime!=null and czTime!=''">
|
czTime,
|
</if>
|
<if test="bz!=null and bz!=''">
|
bz,
|
</if>
|
</trim>
|
</sql>
|
<sql id="value">
|
<trim suffixOverrides=",">
|
<if test="galarmPeople!=null and galarmPeople!=''">
|
#{galarmPeople},
|
</if>
|
<if test="phoneNumber!=null and phoneNumber!=''">
|
#{phoneNumber},
|
</if>
|
<if test="place!=null and place!=''">
|
#{place},
|
</if>
|
<if test="content!=null and content!=''">
|
#{content},
|
</if>
|
<if test="galarmTime!=null and galarmTime!=''">
|
#{galarmTime},
|
</if>
|
<if test="waringType!=null and waringType!=''">
|
#{waringType},
|
</if>
|
<if test="deviceNumber!=null and deviceNumber!=''">
|
#{deviceNumber},
|
</if>
|
<if test="type!=null and type!=''">
|
#{type},
|
</if>
|
<if test="handleP!=null and handleP!=''">
|
#{handleP},
|
</if>
|
<if test="handleTime!=null and handleTime!=''">
|
#{handleTime},
|
</if>
|
<if test="handName!=null and handName!=''">
|
#{handName},
|
</if>
|
<if test="level!=null and level!=''">
|
#{level},
|
</if>
|
<if test="jd!=null and wd!=null">
|
POINT(#{jd},#{wd}),
|
</if>
|
<if test="jd!=null and jd!=''">
|
#{jd},
|
</if>
|
<if test="wd!=null and wd!=''">
|
#{wd},
|
</if>
|
<if test="addvcd!=null and addvcd!=''">
|
#{addvcd},
|
</if>
|
<if test="rName!=null and rName!=''">
|
#{rName},
|
</if>
|
<if test="czTime!=null and czTime!=''">
|
#{czTime},
|
</if>
|
<if test="bz!=null and bz!=''">
|
#{bz},
|
</if>
|
</trim>
|
</sql>
|
<insert id="insert">
|
insert into sys_jingdan(<include refid="key"/>) values(<include refid="value"/>)
|
</insert>
|
|
<delete id="deletejd">
|
delete * from sys_jingdan where id=#{id}
|
</delete>
|
|
|
<update id="updateInfo" >
|
UPDATE sys_jingdan SET handleP=#{handleP},handName=#{handName},handletype=#{handletype},type=#{type} WHERE id=#{id}
|
</update>
|
|
</mapper>
|