ScenePlusMapper.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.fdkankan.scene.mapper.IScenePlusMapper">
  4. <select id="selectCleanOrigScene" resultType="com.fdkankan.scene.bean.SceneBean">
  5. select plus.num, ext.data_source
  6. from t_scene_plus plus
  7. left join t_scene_plus_ext ext on plus.id = ext.plus_id
  8. where plus.scene_status in (1,-2) and ext.algorithm_time <![CDATA[ < ]]> #{time}
  9. and ext.data_source is NOT null
  10. and NOT EXISTS (select o.num from t_scene_clean_orig o where o.rec_status = 'A' and o.num = plus.num and ext.algorithm_time <![CDATA[ < ]]> o.create_time)
  11. </select>
  12. <select id="selectCleanOrigSceneDeleted" resultType="com.fdkankan.scene.bean.SceneBean">
  13. select plus.num, ext.data_source
  14. from t_scene_plus plus
  15. left join t_scene_plus_ext ext on plus.id = ext.plus_id
  16. where plus.rec_status = 'I' and plus.update_time <![CDATA[ < ]]> #{time}
  17. and ext.data_source is NOT null
  18. and NOT EXISTS (select o.num from t_scene_clean_orig o where o.rec_status = 'A' and o.num = plus.num and o.type = 2)
  19. </select>
  20. <select id="listCleanOss4TestCamera" resultType="com.fdkankan.scene.bean.SceneBean">
  21. select plus.num, ext.data_source
  22. from t_scene_plus plus
  23. left join t_scene_plus_ext ext on plus.id = ext.plus_id
  24. where plus.scene_status in (1,-2) and plus.rec_status = 'A' and ext.algorithm_time <![CDATA[ < ]]> #{time}
  25. and ext.data_source is NOT null
  26. and plus.camera_id in
  27. <foreach collection="cameraIds" item="cameraId" open="(" close=")" separator=",">
  28. #{cameraId}
  29. </foreach>
  30. and NOT EXISTS (select o.num from t_scene_clean_orig o where o.rec_status = 'A' and o.num = plus.num and o.type = 3 and ext.algorithm_time <![CDATA[ < ]]> o.create_time)
  31. </select>
  32. <select id="selectColdStorageScene" resultType="com.fdkankan.scene.bean.SceneBean">
  33. select plus.num, ext.data_source
  34. from t_scene_plus plus
  35. left join t_scene_plus_ext ext on plus.id = ext.plus_id
  36. where plus.scene_status in (1,-2) and ext.algorithm_time <![CDATA[ < ]]> #{time}
  37. and ext.data_source is NOT null
  38. and NOT EXISTS (select c.num from t_scene_cold_storage_log c where c.rec_status = 'A' and c.num = plus.num and ext.algorithm_time <![CDATA[ < ]]> c.create_time)
  39. and NOT EXISTS (select o.num from t_scene_clean_orig o where o.rec_status = 'A' and o.state != -1 and o.num = plus.num and ext.algorithm_time <![CDATA[ < ]]> o.create_time)
  40. </select>
  41. </mapper>