12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?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.fdkankan.manage.mapper.ICameraMapper">
- <select id="pageList" resultType="com.fdkankan.manage.vo.response.CameraDetailVo">
- select c.id ,c.sn_code,c.activated_time ,d.create_time as outTime ,d.type,d.own as outType ,co.company_name ,u.user_name, c.wifi_name,
- d.order_sn,an.id as agentId,an.name as agentName
- from t_camera c
- left join t_camera_detail d on c.id = d.camera_id
- left join t_company co on d.company_id = co.id
- left join t_user u on d.user_id = u.id
- left join t_agent_new an on d.agent_id = an.id
- where c.rec_status = 'A'
- <if test="param.userId !=null ">
- and d.user_id = #{param.userId}
- </if>
- <if test="param.outType !=null ">
- and d.own = #{param.outType}
- </if>
- <if test="param.type !=null ">
- and d.type = #{param.type}
- </if>
- <if test="param.snCode !=null and param.snCode != '' ">
- and c.sn_code like concat ('%',#{param.snCode},'%')
- </if>
- <if test="param.companyName !=null and param.companyName != '' ">
- and co.company_name like concat('%',#{param.companyName},'%')
- </if>
- <if test="param.companyId !=null and param.companyId != '' ">
- and co.id =#{param.companyId}
- </if>
- <if test="param.userName !=null and param.userName != '' ">
- and u.user_name like concat('%',#{param.userName},'%')
- </if>
- <if test="param.activatedStartTime !=null and param.activatedStartTime != '' ">
- and c.activated_time >= #{param.activatedStartTime}
- </if>
- <if test="param.activatedEndTime !=null and param.activatedEndTime != '' ">
- and c.activated_time <= #{param.activatedEndTime}
- </if>
- <if test="param.agentName !=null and param.agentName !='' ">
- and an.name like concat('%',#{param.agentName},'%')
- </if>
- order by c.activated_time desc
- </select>
- <select id="getByOutSnCodes" resultType="com.fdkankan.manage.entity.Camera">
- select * from t_camera c left join t_camera_detail d on c.id = d.camera_id
- where c.rec_status = 'A' and d.own is not null and c.sn_code in
- <foreach collection="snCodeList" item="snCode" open="(" separator="," close=")">
- #{snCode}
- </foreach>
- </select>
- </mapper>
|