| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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="com.zd.alg.rfid.mapper.HardwareRfidMapper">
- <resultMap id="BaseResultMap" type="com.zd.algorithm.api.rfid.domain.entity.HardwareRfid">
- <!--@mbg.generated-->
- <!--@Table hardware_rfid-->
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="device_name" jdbcType="VARCHAR" property="deviceName"/>
- <result column="device_type" jdbcType="TINYINT" property="deviceType"/>
- <result column="manufacturer_type" jdbcType="TINYINT" property="manufacturerType"/>
- <result column="hardware_num" jdbcType="VARCHAR" property="hardwareNum"/>
- <result column="ip_address" jdbcType="VARCHAR" property="ipAddress"/>
- <result column="port" jdbcType="INTEGER" property="port"/>
- <result column="uniform_power" jdbcType="VARCHAR" property="uniformPower"/>
- <result column="session_index" jdbcType="TINYINT" property="sessionIndex"/>
- <result column="channels" jdbcType="TINYINT" property="channels"/>
- <result column="on_off" jdbcType="TINYINT" property="onOff"/>
- <result column="device_status" jdbcType="TINYINT" property="deviceStatus"/>
- <result column="subject_id" jdbcType="BIGINT" property="subjectId"/>
- <result column="dept_id" jdbcType="BIGINT" property="deptId"/>
- <result column="dept_name" jdbcType="VARCHAR" property="deptName"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id, device_name, device_type, manufacturer_type, hardware_num, ip_address, port,
- uniform_power, session_index, channels, switch, device_status, subject_id, dept_id,
- dept_name, user_id, create_by, create_time, update_by, update_time, remark
- </sql>
- <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
- <!--@mbg.generated-->
- insert into hardware_rfid
- (device_name, device_type, manufacturer_type, hardware_num, ip_address, port, uniform_power,
- session_index, channels, switch, device_status, subject_id, dept_id, dept_name,
- user_id, create_by, create_time, update_by, update_time, remark)
- values
- <foreach collection="list" item="item" separator=",">
- (#{item.deviceName,jdbcType=VARCHAR}, #{item.deviceType,jdbcType=SMALLINT},
- #{item.manufacturerType,jdbcType=TINYINT},
- #{item.hardwareNum,jdbcType=VARCHAR}, #{item.ipAddress,jdbcType=VARCHAR}, #{item.port,jdbcType=INTEGER},
- #{item.uniformPower,jdbcType=VARCHAR}, #{item.sessionIndex,jdbcType=BOOLEAN},
- #{item.channels,jdbcType=TINYINT},
- #{item.onOff,jdbcType=SMALLINT}, #{item.deviceStatus,jdbcType=SMALLINT}, #{item.subjectId,jdbcType=BIGINT},
- #{item.deptId,jdbcType=CHAR}, #{item.deptName,jdbcType=VARCHAR}, #{item.userId,jdbcType=BIGINT},
- #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
- #{item.updateBy,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR})
- </foreach>
- </insert>
- <select id="selectRfidInfo" resultType="com.zd.algorithm.api.rfid.domain.entity.HardwareRfid">
- SELECT rfid.*
- FROM `hardware_rfid` rfid
- LEFT JOIN lab_subject ls ON rfid.subject_id = ls.id
- <where>
- <if test="hardwareRfidVo.searchValue != null">
- rfid.hardware_num LIKE CONCAT('%',#{hardwareRfidVo.searchValue},'%') or
- ls.`name` LIKE CONCAT('%',#{hardwareRfidVo.searchValue},'%')
- </if>
- </where>
- ORDER BY rfid.create_time DESC
- </select>
- </mapper>
|