CameraMapper.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.manage.mapper.ICameraMapper">
  4. <select id="pageList" resultType="com.fdkankan.manage.vo.response.CameraDetailVo">
  5. 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,
  6. d.order_sn,an.id as agentId,an.name as agentName
  7. from t_camera c
  8. left join t_camera_detail d on c.id = d.camera_id
  9. left join t_company co on d.company_id = co.id
  10. left join t_user u on d.user_id = u.id
  11. left join t_agent_new an on d.agent_id = an.id
  12. where c.rec_status = 'A'
  13. <if test="param.userId !=null ">
  14. and d.user_id = #{param.userId}
  15. </if>
  16. <if test="param.outType !=null ">
  17. and d.own = #{param.outType}
  18. </if>
  19. <if test="param.type !=null ">
  20. and d.type = #{param.type}
  21. </if>
  22. <if test="param.snCode !=null and param.snCode != '' ">
  23. and c.sn_code like concat ('%',#{param.snCode},'%')
  24. </if>
  25. <if test="param.companyName !=null and param.companyName != '' ">
  26. and co.company_name like concat('%',#{param.companyName},'%')
  27. </if>
  28. <if test="param.companyId !=null and param.companyId != '' ">
  29. and co.id =#{param.companyId}
  30. </if>
  31. <if test="param.userName !=null and param.userName != '' ">
  32. and u.user_name like concat('%',#{param.userName},'%')
  33. </if>
  34. <if test="param.activatedStartTime !=null and param.activatedStartTime != '' ">
  35. and c.activated_time &gt;= #{param.activatedStartTime}
  36. </if>
  37. <if test="param.activatedEndTime !=null and param.activatedEndTime != '' ">
  38. and c.activated_time &lt;= #{param.activatedEndTime}
  39. </if>
  40. <if test="param.agentName !=null and param.agentName !='' ">
  41. and an.name like concat('%',#{param.agentName},'%')
  42. </if>
  43. order by c.activated_time desc
  44. </select>
  45. <select id="getByOutSnCodes" resultType="com.fdkankan.manage.entity.Camera">
  46. select * from t_camera c left join t_camera_detail d on c.id = d.camera_id
  47. where c.rec_status = 'A' and d.own is not null and c.sn_code in
  48. <foreach collection="snCodeList" item="snCode" open="(" separator="," close=")">
  49. #{snCode}
  50. </foreach>
  51. </select>
  52. </mapper>