GZMachinesWeb/build/classes/mybatis/ma/MachineRfidInfoMapper.xml

58 lines
1.4 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="com.bonus.ma.dao.MachineRfidInfoDao" >
<resultMap id="rfid" type="com.bonus.ma.beans.MachineRfidInfoBean"></resultMap>
<resultMap id="ZNode" type="com.bonus.sys.beans.ZNode"></resultMap>
<select id="findMachineByEpcCode" parameterType="com.bonus.ma.beans.MachineRfidInfoBean" resultMap="rfid">
SELECT
mr.rfid_code as epcCode
FROM
mm_rfid_enter mr
where mr.rfid_code = #{epcCode}
</select>
<insert id="insertRfidEnter" parameterType="com.bonus.ma.beans.MachineRfidInfoBean">
INSERT into mm_rfid_enter
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="epcCode !=null">
rfid_code,
</if>
<if test="deviceCode !=null">
ma_info
</if>
</trim>
<trim prefix="VALUES(" suffix=")" suffixOverrides=",">
<if test="epcCode !=null">
#{epcCode},
</if>
<if test="deviceCode !=null">
#{deviceCode}
</if>
</trim>
</insert>
<select id="findListByEpcCode" parameterType="com.bonus.ma.beans.MachineRfidInfoBean" resultMap="rfid">
SELECT
mr.id as maId,
mr.rfid_code as epcCode,
mr.ma_info as deviceCode
FROM
mm_rfid_enter mr
where mr.rfid_code = #{epcCode}
</select>
</mapper>