AiCameraMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhgd.scs.mapper.AiCameraMapper">
  6. <select id="getInfoByCameraId" resultType="com.zhgd.scs.domain.vo.AiCameraVo">
  7. SELECT ac.*, aa.name areaName, act.type typeName
  8. FROM ai_camera ac
  9. LEFT JOIN ai_area aa ON aa.id = ac.area_id
  10. LEFT JOIN ai_camera_type act on ac.type_id = act.id
  11. WHERE ac.in_out_state = 1
  12. AND ac.id = #{id}
  13. </select>
  14. <select id="getUserListByProjectId" resultType="com.zhgd.scs.domain.vo.IdName">
  15. SELECT su.id, su.real_name, aur.project_id aid
  16. FROM ai_user_ref aur
  17. LEFT JOIN sys_user su ON su.id = aur.user_id
  18. WHERE aur.project_id = #{projectId}
  19. AND su.state = 1
  20. </select>
  21. <select id="getList" resultType="com.zhgd.scs.domain.vo.AiCameraVo">
  22. SELECT ac.*, aa.name areaName, act.type typeName
  23. FROM ai_camera ac
  24. LEFT JOIN ai_area aa ON ac.area_id = aa.id
  25. LEFT JOIN ai_camera_type act ON ac.type_id = act.id
  26. WHERE ac.in_out_state = 1
  27. AND ac.project_id = #{projectId}
  28. <if test="name != null and name != ''">
  29. AND ac.name LIKE concat('%', #{name}, '%')
  30. </if>
  31. <if test="state != null and state != ''">
  32. AND ac.state = #{state}
  33. </if>
  34. <if test="inOutState != null">
  35. AND ac.in_out_state = #{inOutState}
  36. </if>
  37. </select>
  38. </mapper>