iBatis UPDATE 的书写 5
<updateid="update"parameterType="com.bus.domain.Transportation">updatetransportation_...
<update id="update" parameterType="com.bus.domain.Transportation">
update transportation_tb
<set>
bus_id = #{busId},
station_id = #{stationId},
bus_direct =#{busDirect},
line_id = #{lineId}
</set>
<where>
device_id = #{deviceId}
and
gps_time_stamp = #{gpsTimeStamp}
</where>
</update>
在set标签里,不用再写set吗?如
<set>
set
bus_id = #{busId},
station_id = #{stationId},
bus_direct =#{busDirect},
line_id = #{lineId}
</set>
谢谢。 展开
update transportation_tb
<set>
bus_id = #{busId},
station_id = #{stationId},
bus_direct =#{busDirect},
line_id = #{lineId}
</set>
<where>
device_id = #{deviceId}
and
gps_time_stamp = #{gpsTimeStamp}
</where>
</update>
在set标签里,不用再写set吗?如
<set>
set
bus_id = #{busId},
station_id = #{stationId},
bus_direct =#{busDirect},
line_id = #{lineId}
</set>
谢谢。 展开
1个回答
展开全部
<update id="editStudent" parameterClass="com.ssi.bean.Students" >
update student
<dynamic prepend="set" >
<isNotEqual prepend="," property="age" compareValue="0">
age = $age$
</isNotEqual>
<isNotNull prepend="," property="name" >
name = '$name$'
</isNotNull>
</dynamic>
where id = $id$
</update>
update student
<dynamic prepend="set" >
<isNotEqual prepend="," property="age" compareValue="0">
age = $age$
</isNotEqual>
<isNotNull prepend="," property="name" >
name = '$name$'
</isNotNull>
</dynamic>
where id = $id$
</update>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询