VideoMonitorMapper.xml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.welampiot.dao.VideoMonitorDao">
  4. <select id="getListByVO" resultType="com.welampiot.dto.VideoMonitorDTO" parameterType="com.welampiot.vo.VideoMonitorVO">
  5. select id,name,image from video_monitor
  6. where lamp_pole_id = 0
  7. <if test="sectionList != null and !sectionList.isEmpty()">
  8. and sectionid in
  9. <foreach item="vo" collection="sectionList" open="(" separator="," close=")">
  10. #{vo}
  11. </foreach>
  12. </if>
  13. order by id desc
  14. <if test="offset != null and limit != null">
  15. limit #{offset},#{limit}
  16. </if>
  17. </select>
  18. <select id="getVideoListBySectionList" resultType="com.welampiot.dto.VideoMonitorDTO">
  19. select v.id,v.name,v.latitude,v.longitude,v.image
  20. from video_monitor v
  21. where 1=1
  22. <if test="sectionList != null and !sectionList.isEmpty()">
  23. and v.sectionid in
  24. <foreach collection="sectionList" item="item" open="(" separator="," close=")">
  25. #{item}
  26. </foreach>
  27. </if>
  28. </select>
  29. <update id="changeVideoMonitorLocationById" parameterType="VideoMonitorDTO">
  30. update
  31. video_monitor v
  32. set
  33. v.longitude = #{longitude},
  34. v.latitude = #{latitude}
  35. where v.id = #{id}
  36. </update>
  37. </mapper>