1 <insert id="listModelInsert" parameterType="list"> 2 INSERT INTO NM_DEVICE_DATA 3 (ID, DEVICE_ID, TARGET, VALUE, CREATE_TIME,DETAIL) 4 <foreach collection="list" item="model" index="index" separator="union all"> 5 select #{model.id},#{model.deviceId}, #{model.target},#{model.value},sysdate, 6 <if test="model.detail == null"> 7 ‘‘ from dual 8 </if> 9 <if test="model.detail != null"> 10 #{model.detail} from dual 11 </if> 12 </foreach> 13 </insert>
小弟不才,若能用当上,万分荣幸
时间: 2024-10-16 00:18:07