<id column="value" property="value"/>报错
时间: 2023-07-21 16:11:03 浏览: 44
非常抱歉,我之前的回答有误。在使用动态SQL片段时,`<id>` 元素是不需要的,因为我们只是想获取一列数据而不是主键。请修改你的代码如下:
```xml
<resultMap id="PinResultMap" type="java.lang.String">
<result column="value" property="value"/>
</resultMap>
<select id="getDistinctPin1" resultMap="PinResultMap" parameterType="com.example.pmp.pojo.dto.sense.senseDataDto">
<include refid="distinctQuery">
<property name="column" value="FAI_26_1_Value"/>
</include>
</select>
<select id="getDistinctPin2" resultMap="PinResultMap" parameterType="com.example.pmp.pojo.dto.sense.senseDataDto">
<include refid="distinctQuery">
<property name="column" value="FAI_26_2_Value"/>
</include>
</select>
<select id="getDistinctPin3" resultMap="PinResultMap" parameterType="com.example.pmp.pojo.dto.sense.senseDataDto">
<include refid="distinctQuery">
<property name="column" value="FAI_26_3_Value"/>
</include>
</select>
```
这样,你就可以正确地将查询结果映射到 `String` 类型的属性 `value` 上,并且不需要 `<id>` 元素。再次对之前的错误表示抱歉,希望这次回答能够解决你的问题。如果还有其他问题,请随时提出。