123456789101112131415161718192021222324252627282930313233343536373839 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.zhgd.scs.mapper.AiCameraMapper">
- <select id="getInfoByCameraId" resultType="com.zhgd.scs.domain.vo.AiCameraVo">
- SELECT ac.*, aa.name areaName, act.type typeName
- FROM ai_camera ac
- LEFT JOIN ai_area aa ON aa.id = ac.area_id
- LEFT JOIN ai_camera_type act on ac.type_id = act.id
- WHERE ac.in_out_state = 1
- AND ac.id = #{id}
- </select>
- <select id="getUserListByProjectId" resultType="com.zhgd.scs.domain.vo.IdName">
- SELECT su.id, su.real_name, aur.project_id aid
- FROM ai_user_ref aur
- LEFT JOIN sys_user su ON su.id = aur.user_id
- WHERE aur.project_id = #{projectId}
- AND su.state = 1
- </select>
- <select id="getList" resultType="com.zhgd.scs.domain.vo.AiCameraVo">
- SELECT ac.*, aa.name areaName, act.type typeName
- FROM ai_camera ac
- LEFT JOIN ai_area aa ON ac.area_id = aa.id
- LEFT JOIN ai_camera_type act ON ac.type_id = act.id
- WHERE ac.in_out_state = 1
- AND ac.project_id = #{projectId}
- <if test="name != null and name != ''">
- AND ac.name LIKE concat('%', #{name}, '%')
- </if>
- <if test="state != null and state != ''">
- AND ac.state = #{state}
- </if>
- <if test="inOutState != null">
- AND ac.in_out_state = #{inOutState}
- </if>
- </select>
- </mapper>
|