<?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.example.springboot.mapper.device.DeviceMapper">
|
|
<!-- <resultMap id="myResultMap" type="com.example.springboot.entity.device.DeviceEntity">-->
|
<!-- <!– 根据你的实际情况定义结果映射 –>-->
|
<!-- <!– 示例中将结果映射到实体类的属性 –>-->
|
<!-- <id property="id" column="id"/>-->
|
<!-- <result property="name" column="device_name"/>-->
|
<!-- <!– 其他属性映射 –>-->
|
<!-- </resultMap>-->
|
|
<!-- <select id="selectAllDevices" resultMap="myResultMap">-->
|
<!-- SELECT *-->
|
<!-- FROM device-->
|
<!-- </select>-->
|
|
<!-- <select id="callStoredProc" statementType="CALLABLE" resultMap="myResultMap">-->
|
<!-- { call Your_Stored_Procedure(-->
|
<!-- #{id, mode=IN, jdbcType=VARCHAR},-->
|
<!-- #{name, mode=IN, jdbcType=VARCHAR}-->
|
|
<!-- ) }-->
|
<!-- </select>-->
|
|
<!-- <update id="updateDeviceName">-->
|
<!-- UPDATE device SET-->
|
<!-- device_name = #{deviceName},-->
|
<!-- address = #{address}-->
|
<!-- WHERE id = #{id}-->
|
<!-- </update>-->
|
<!-- <update id="updateMultipleDevices" parameterType="java.util.List">-->
|
<!-- <foreach collection="list" item="device" separator=";">-->
|
<!-- UPDATE device SET-->
|
<!-- device_name = #{device.deviceName},-->
|
<!-- address = #{device.address}-->
|
<!-- WHERE id = #{device.id}-->
|
<!-- </foreach>-->
|
<!-- </update>-->
|
</mapper>
|