BluetoothInfoMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.jjt.biz.mapper.BluetoothInfoMapper">
  6. <resultMap type="BluetoothInfo" id="BluetoothInfoResult">
  7. <result property="bInfoId" column="B_INFO_ID" />
  8. <result property="deviceId" column="DEVICE_ID" />
  9. <result property="venueId" column="VENUE_ID" />
  10. <result property="areaId" column="AREA_ID" />
  11. <result property="mac" column="MAC" />
  12. <result property="name" column="NAME" />
  13. <result property="fileName" column="FILE_NAME" />
  14. <result property="filePath" column="FILE_PATH" />
  15. <result property="isIllegal" column="IS_ILLEGAL" />
  16. <result property="keyType" column="KEY_TYPE" />
  17. <result property="time" column="TIME" />
  18. </resultMap>
  19. <sql id="selectBluetoothInfoVo">
  20. select B_INFO_ID, DEVICE_ID, VENUE_ID, AREA_ID, MAC, NAME, FILE_NAME, FILE_PATH, IS_ILLEGAL, KEY_TYPE, TIME from bluetooth_info
  21. </sql>
  22. <select id="selectBluetoothInfoList" parameterType="BluetoothInfo" resultMap="BluetoothInfoResult">
  23. <include refid="selectBluetoothInfoVo"/>
  24. <where>
  25. <if test="deviceId != null and deviceId != ''"> and DEVICE_ID = #{deviceId}</if>
  26. <if test="venueId != null "> and VENUE_ID = #{venueId}</if>
  27. <if test="areaId != null "> and AREA_ID = #{areaId}</if>
  28. <if test="mac != null and mac != ''"> and MAC like concat('%', #{mac}, '%')</if>
  29. <if test="name != null and name != ''"> and NAME like concat('%', #{name}, '%')</if>
  30. <if test="fileName != null and fileName != ''"> and FILE_NAME like concat('%', #{fileName}, '%')</if>
  31. <if test="filePath != null and filePath != ''"> and FILE_PATH = #{filePath}</if>
  32. <if test="isIllegal != null and isIllegal != ''"> and IS_ILLEGAL = #{isIllegal}</if>
  33. <if test="keyType != null and keyType != ''"> and KEY_TYPE like concat('%', #{keyType}, '%')</if>
  34. <if test="time != null "> and TIME = #{time}</if>
  35. </where>
  36. </select>
  37. <select id="selectBluetoothInfoByBInfoId" parameterType="Long" resultMap="BluetoothInfoResult">
  38. <include refid="selectBluetoothInfoVo"/>
  39. where B_INFO_ID = #{bInfoId}
  40. </select>
  41. <insert id="insertBluetoothInfo" parameterType="BluetoothInfo" useGeneratedKeys="true" keyProperty="bInfoId">
  42. insert into bluetooth_info
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="deviceId != null">DEVICE_ID,</if>
  45. <if test="venueId != null">VENUE_ID,</if>
  46. <if test="areaId != null">AREA_ID,</if>
  47. <if test="mac != null and mac != ''">MAC,</if>
  48. <if test="name != null">NAME,</if>
  49. <if test="fileName != null">FILE_NAME,</if>
  50. <if test="filePath != null">FILE_PATH,</if>
  51. <if test="isIllegal != null">IS_ILLEGAL,</if>
  52. <if test="keyType != null">KEY_TYPE,</if>
  53. <if test="time != null">TIME,</if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="deviceId != null">#{deviceId},</if>
  57. <if test="venueId != null">#{venueId},</if>
  58. <if test="areaId != null">#{areaId},</if>
  59. <if test="mac != null and mac != ''">#{mac},</if>
  60. <if test="name != null">#{name},</if>
  61. <if test="fileName != null">#{fileName},</if>
  62. <if test="filePath != null">#{filePath},</if>
  63. <if test="isIllegal != null">#{isIllegal},</if>
  64. <if test="keyType != null">#{keyType},</if>
  65. <if test="time != null">#{time},</if>
  66. </trim>
  67. </insert>
  68. <update id="updateBluetoothInfo" parameterType="BluetoothInfo">
  69. update bluetooth_info
  70. <trim prefix="SET" suffixOverrides=",">
  71. <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
  72. <if test="venueId != null">VENUE_ID = #{venueId},</if>
  73. <if test="areaId != null">AREA_ID = #{areaId},</if>
  74. <if test="mac != null and mac != ''">MAC = #{mac},</if>
  75. <if test="name != null">NAME = #{name},</if>
  76. <if test="fileName != null">FILE_NAME = #{fileName},</if>
  77. <if test="filePath != null">FILE_PATH = #{filePath},</if>
  78. <if test="isIllegal != null">IS_ILLEGAL = #{isIllegal},</if>
  79. <if test="keyType != null">KEY_TYPE = #{keyType},</if>
  80. <if test="time != null">TIME = #{time},</if>
  81. </trim>
  82. where B_INFO_ID = #{bInfoId}
  83. </update>
  84. <delete id="deleteBluetoothInfoByBInfoId" parameterType="Long">
  85. delete from bluetooth_info where B_INFO_ID = #{bInfoId}
  86. </delete>
  87. <delete id="deleteBluetoothInfoByBInfoIds" parameterType="String">
  88. delete from bluetooth_info where B_INFO_ID in
  89. <foreach item="bInfoId" collection="array" open="(" separator="," close=")">
  90. #{bInfoId}
  91. </foreach>
  92. </delete>
  93. </mapper>