|
@@ -1,48 +1,63 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.jjt.biz.mapper.BluetoothInfoMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="BluetoothInfo" id="BluetoothInfoResult">
|
|
|
- <result property="bInfoId" column="B_INFO_ID" />
|
|
|
- <result property="deviceId" column="DEVICE_ID" />
|
|
|
- <result property="venueId" column="VENUE_ID" />
|
|
|
- <result property="areaId" column="AREA_ID" />
|
|
|
- <result property="mac" column="MAC" />
|
|
|
- <result property="name" column="NAME" />
|
|
|
- <result property="fileName" column="FILE_NAME" />
|
|
|
- <result property="filePath" column="FILE_PATH" />
|
|
|
- <result property="isIllegal" column="IS_ILLEGAL" />
|
|
|
- <result property="keyType" column="KEY_TYPE" />
|
|
|
- <result property="time" column="TIME" />
|
|
|
+ <result property="bInfoId" column="B_INFO_ID"/>
|
|
|
+ <result property="deviceId" column="DEVICE_ID"/>
|
|
|
+ <result property="venueId" column="VENUE_ID"/>
|
|
|
+ <result property="areaId" column="AREA_ID"/>
|
|
|
+ <result property="mac" column="MAC"/>
|
|
|
+ <result property="name" column="NAME"/>
|
|
|
+ <result property="fileName" column="FILE_NAME"/>
|
|
|
+ <result property="filePath" column="FILE_PATH"/>
|
|
|
+ <result property="isIllegal" column="IS_ILLEGAL"/>
|
|
|
+ <result property="keyType" column="KEY_TYPE"/>
|
|
|
+ <result property="time" column="TIME"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectBluetoothInfoVo">
|
|
|
- select B_INFO_ID, DEVICE_ID, VENUE_ID, AREA_ID, MAC, NAME, FILE_NAME, FILE_PATH, IS_ILLEGAL, KEY_TYPE, TIME from bluetooth_info
|
|
|
+ select B_INFO_ID,
|
|
|
+ DEVICE_ID,
|
|
|
+ VENUE_ID,
|
|
|
+ AREA_ID,
|
|
|
+ MAC,
|
|
|
+ NAME,
|
|
|
+ FILE_NAME,
|
|
|
+ FILE_PATH,
|
|
|
+ IS_ILLEGAL,
|
|
|
+ KEY_TYPE, TIME
|
|
|
+ from bluetooth_info
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectBluetoothInfoList" parameterType="BluetoothInfo" resultMap="BluetoothInfoResult">
|
|
|
- <include refid="selectBluetoothInfoVo"/>
|
|
|
- <where>
|
|
|
- <if test="deviceId != null and deviceId != ''"> and DEVICE_ID = #{deviceId}</if>
|
|
|
- <if test="venueId != null "> and VENUE_ID = #{venueId}</if>
|
|
|
- <if test="areaId != null "> and AREA_ID = #{areaId}</if>
|
|
|
- <if test="mac != null and mac != ''"> and MAC like concat('%', #{mac}, '%')</if>
|
|
|
- <if test="name != null and name != ''"> and NAME like concat('%', #{name}, '%')</if>
|
|
|
- <if test="fileName != null and fileName != ''"> and FILE_NAME like concat('%', #{fileName}, '%')</if>
|
|
|
- <if test="filePath != null and filePath != ''"> and FILE_PATH = #{filePath}</if>
|
|
|
- <if test="isIllegal != null and isIllegal != ''"> and IS_ILLEGAL = #{isIllegal}</if>
|
|
|
- <if test="keyType != null and keyType != ''"> and KEY_TYPE like concat('%', #{keyType}, '%')</if>
|
|
|
- <if test="time != null "> and TIME = #{time}</if>
|
|
|
+ select * from (select B_INFO_ID, DEVICE_ID, a.VENUE_ID,b.VENUE_NAME, a.AREA_ID,c.area_name, MAC, NAME,
|
|
|
+ FILE_NAME, FILE_PATH, IS_ILLEGAL, KEY_TYPE, TIME from bluetooth_info a left join venue_info b on
|
|
|
+ a.venue_id=b.venue_id left join venue_area
|
|
|
+ c on a.AREA_ID=c.area_id ) t
|
|
|
+ <where>
|
|
|
+ <if test="deviceId != null and deviceId != ''">and DEVICE_ID = #{deviceId}</if>
|
|
|
+ <if test="venueId != null ">and VENUE_ID = #{venueId}</if>
|
|
|
+ <if test="areaId != null ">and AREA_ID = #{areaId}</if>
|
|
|
+ <if test="mac != null and mac != ''">and MAC like concat('%', #{mac}, '%')</if>
|
|
|
+ <if test="name != null and name != ''">and NAME like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="fileName != null and fileName != ''">and FILE_NAME like concat('%', #{fileName}, '%')</if>
|
|
|
+ <if test="filePath != null and filePath != ''">and FILE_PATH = #{filePath}</if>
|
|
|
+ <if test="isIllegal != null and isIllegal != ''">and IS_ILLEGAL = #{isIllegal}</if>
|
|
|
+ <if test="keyType != null and keyType != ''">and KEY_TYPE like concat('%', #{keyType}, '%')</if>
|
|
|
+ <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
|
|
+ and TIME between #{params.beginTime} and #{params.endTime}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectBluetoothInfoByBInfoId" parameterType="Long" resultMap="BluetoothInfoResult">
|
|
|
<include refid="selectBluetoothInfoVo"/>
|
|
|
where B_INFO_ID = #{bInfoId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertBluetoothInfo" parameterType="BluetoothInfo" useGeneratedKeys="true" keyProperty="bInfoId">
|
|
|
insert into bluetooth_info
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -56,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isIllegal != null">IS_ILLEGAL,</if>
|
|
|
<if test="keyType != null">KEY_TYPE,</if>
|
|
|
<if test="time != null">TIME,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="deviceId != null">#{deviceId},</if>
|
|
|
<if test="venueId != null">#{venueId},</if>
|
|
@@ -68,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isIllegal != null">#{isIllegal},</if>
|
|
|
<if test="keyType != null">#{keyType},</if>
|
|
|
<if test="time != null">#{time},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateBluetoothInfo" parameterType="BluetoothInfo">
|
|
@@ -89,11 +104,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteBluetoothInfoByBInfoId" parameterType="Long">
|
|
|
- delete from bluetooth_info where B_INFO_ID = #{bInfoId}
|
|
|
+ delete
|
|
|
+ from bluetooth_info
|
|
|
+ where B_INFO_ID = #{bInfoId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteBluetoothInfoByBInfoIds" parameterType="String">
|
|
|
- delete from bluetooth_info where B_INFO_ID in
|
|
|
+ delete from bluetooth_info where B_INFO_ID in
|
|
|
<foreach item="bInfoId" collection="array" open="(" separator="," close=")">
|
|
|
#{bInfoId}
|
|
|
</foreach>
|