Stwzhj-Cloud-Plus/stwzhj-modules/wzhj-extract/src/main/resources/mapper/DeviceMapper.xml

74 lines
3.8 KiB
XML

<?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.dromara.extract.mapper.DeviceMapper">
<resultMap type="org.dromara.extract.domain.Device" id="DeviceRes">
<result property="id" column="id" />
<result property="deviceCode" column="device_code" />
<result property="deviceType" column="device_type" />
<result property="policeNo" column="police_no" />
<result property="policeName" column="police_name" />
<result property="phoneNum" column="phone_num" />
<result property="carNum" column="car_num" />
<result property="zzjgdm" column="zzjgdm" />
<result property="zzjgmc" column="zzjgmc" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="valid" column="valid" />
<result property="remark1" column="remark1" />
<result property="remark2" column="remark2" />
</resultMap>
<select id="selectPDT" parameterType="org.dromara.extract.domain.Device" resultMap="DeviceRes">
select hh device_code,'3' device_type, zzjgdm, sjjg zzjgmc, creatime create_time, syr policeName, username policeNo, lxfs phoneNum from T_PDT_MESSAGE
<where>
yxx = '1'
<if test="createTime != null "> and creatime >= #{createTime}</if>
</where>
</select>
<select id="selectYDJW" parameterType="org.dromara.extract.domain.Device" resultMap="DeviceRes">
select zdid device_code,'4' device_type, ssdw zzjgdm, to_timestamp(zdcjsj / 1000)::timestamp create_time,
jyxm police_name, jyjh police_no, jylxfs phone_num,to_char(gxsj,'yyyy-MM-dd HH24:mi:ss') update_time,sfyx as valid from v_jwt
<where>
ssdw != '' and ssdw != '341600000000'
<if test="updateTime != null "> and gxsj > #{updateTime}</if>
</where>
order by gxsj desc
</select>
<select id="selectBDGC" parameterType="org.dromara.extract.domain.Device" resultMap="DeviceRes">
select gpsid device_code,'2' device_type, zzjgdm, remark2 zzjgmc,updatetime update_time, carno car_num from v_t_gc_sbxx
<where>
valid = '1'
<if test="updateTime != null "> and updatetime >= #{updateTime}</if>
</where>
</select>
<select id="selectJly" parameterType="org.dromara.extract.domain.Device" resultMap="DeviceRes">
select zdbh device_code,'5' device_type,'341300250000' zzjgdm, '交通警察支队' zzjgmc,gxsj update_time, sbmc policeName,byzd4 policeNo from bas_device
<where>
<if test="updateTime != null "> and gxsj >= #{updateTime}</if>
</where>
order by gxsj desc
</select>
<select id="deviceByCode" parameterType="String" resultMap="DeviceRes">
select * from t_device where device_code = #{deviceCode}
</select>
<insert id="insertOrUpdateByCodeAndType">
insert into t_device (device_code, device_type, zzjgdm, zzjgmc, police_no, police_name, phone_num, car_num, valid,
remark1, remark2, card_num, create_time, update_time)
values (#{deviceCode},#{deviceType},#{zzjgdm},#{zzjgmc},#{policeNo},#{policeName},#{phoneNum},#{carNum},#{valid},
#{remark1},#{remark2},#{cardNum},#{createTime},#{updateTime})
ON DUPLICATE KEY UPDATE
police_no = values(police_no),police_name = values(police_name),phone_num = values(phone_num),
car_num = values(car_num),valid = values(valid),remark1 = values(remark1),remark2 = values(remark2),card_num = values(card_num),
update_time = values(update_time)
</insert>
</mapper>