wuyouming666
2023-12-26 e7eaa7bb402aae3bb88d9219e50f0e1179f3257f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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">-->
<!--        &lt;!&ndash; 根据你的实际情况定义结果映射 &ndash;&gt;-->
<!--        &lt;!&ndash; 示例中将结果映射到实体类的属性 &ndash;&gt;-->
<!--        <id property="id" column="id"/>-->
<!--        <result property="name" column="device_name"/>-->
<!--        &lt;!&ndash; 其他属性映射 &ndash;&gt;-->
<!--    </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>