HardwareRfidMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.zd.alg.rfid.mapper.HardwareRfidMapper">
  4. <resultMap id="BaseResultMap" type="com.zd.algorithm.api.rfid.domain.entity.HardwareRfid">
  5. <!--@mbg.generated-->
  6. <!--@Table hardware_rfid-->
  7. <id column="id" jdbcType="BIGINT" property="id"/>
  8. <result column="device_name" jdbcType="VARCHAR" property="deviceName"/>
  9. <result column="device_type" jdbcType="TINYINT" property="deviceType"/>
  10. <result column="manufacturer_type" jdbcType="TINYINT" property="manufacturerType"/>
  11. <result column="hardware_num" jdbcType="VARCHAR" property="hardwareNum"/>
  12. <result column="ip_address" jdbcType="VARCHAR" property="ipAddress"/>
  13. <result column="port" jdbcType="INTEGER" property="port"/>
  14. <result column="uniform_power" jdbcType="VARCHAR" property="uniformPower"/>
  15. <result column="session_index" jdbcType="TINYINT" property="sessionIndex"/>
  16. <result column="channels" jdbcType="TINYINT" property="channels"/>
  17. <result column="on_off" jdbcType="TINYINT" property="onOff"/>
  18. <result column="device_status" jdbcType="TINYINT" property="deviceStatus"/>
  19. <result column="subject_id" jdbcType="BIGINT" property="subjectId"/>
  20. <result column="dept_id" jdbcType="BIGINT" property="deptId"/>
  21. <result column="dept_name" jdbcType="VARCHAR" property="deptName"/>
  22. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  23. <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
  24. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  25. <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
  26. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  27. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  28. </resultMap>
  29. <sql id="Base_Column_List">
  30. <!--@mbg.generated-->
  31. id, device_name, device_type, manufacturer_type, hardware_num, ip_address, port,
  32. uniform_power, session_index, channels, switch, device_status, subject_id, dept_id,
  33. dept_name, user_id, create_by, create_time, update_by, update_time, remark
  34. </sql>
  35. <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
  36. <!--@mbg.generated-->
  37. insert into hardware_rfid
  38. (device_name, device_type, manufacturer_type, hardware_num, ip_address, port, uniform_power,
  39. session_index, channels, switch, device_status, subject_id, dept_id, dept_name,
  40. user_id, create_by, create_time, update_by, update_time, remark)
  41. values
  42. <foreach collection="list" item="item" separator=",">
  43. (#{item.deviceName,jdbcType=VARCHAR}, #{item.deviceType,jdbcType=SMALLINT},
  44. #{item.manufacturerType,jdbcType=TINYINT},
  45. #{item.hardwareNum,jdbcType=VARCHAR}, #{item.ipAddress,jdbcType=VARCHAR}, #{item.port,jdbcType=INTEGER},
  46. #{item.uniformPower,jdbcType=VARCHAR}, #{item.sessionIndex,jdbcType=BOOLEAN},
  47. #{item.channels,jdbcType=TINYINT},
  48. #{item.onOff,jdbcType=SMALLINT}, #{item.deviceStatus,jdbcType=SMALLINT}, #{item.subjectId,jdbcType=BIGINT},
  49. #{item.deptId,jdbcType=CHAR}, #{item.deptName,jdbcType=VARCHAR}, #{item.userId,jdbcType=BIGINT},
  50. #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
  51. #{item.updateBy,jdbcType=VARCHAR},
  52. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR})
  53. </foreach>
  54. </insert>
  55. <select id="selectRfidInfo" resultType="com.zd.algorithm.api.rfid.domain.entity.HardwareRfid">
  56. SELECT rfid.*
  57. FROM `hardware_rfid` rfid
  58. LEFT JOIN lab_subject ls ON rfid.subject_id = ls.id
  59. <where>
  60. <if test="hardwareRfidVo.searchValue != null">
  61. rfid.hardware_num LIKE CONCAT('%',#{hardwareRfidVo.searchValue},'%') or
  62. ls.`name` LIKE CONCAT('%',#{hardwareRfidVo.searchValue},'%')
  63. </if>
  64. </where>
  65. ORDER BY rfid.create_time DESC
  66. </select>
  67. </mapper>