PushDao.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.yx.face.dao.PushDao">
  4. <select id="getPushUrl" resultType="java.lang.String">
  5. SELECT spc.push_url
  6. FROM face_device as fd
  7. LEFT JOIN system_push_config as spc
  8. on fd.admin_id = spc.account_id
  9. WHERE fd.sn = #{deviceSn}
  10. and spc.`status` = '1'
  11. and spc.type = '1'
  12. </select>
  13. <select id="getUserVisitorPushUrl" resultType="java.lang.String">
  14. SELECT spc.push_url
  15. FROM user_visitor_list as uvl
  16. LEFT JOIN system_push_config as spc
  17. on uvl.admin_id = spc.account_id
  18. WHERE spc.`status` = '1'
  19. and spc.type = '1'
  20. and uvl.admin_id = #{adminId}
  21. and uvl.phone = #{phone}
  22. </select>
  23. <select id="selectList" resultType="com.yx.face.entity.SystemPushConfig">
  24. SELECT account_id as accountId, push_url as pushUrl
  25. FROM system_push_config
  26. WHERE type = #{type}
  27. AND `status` = '1'
  28. </select>
  29. <select id="getAdmin" resultType="com.yx.face.entity.Admin">
  30. SELECT province_id as provinceId, city_id as cityId, tag_id as tagId, type as type, id
  31. FROM admin
  32. WHERE id = #{id}
  33. </select>
  34. <select id="checkSn" resultType="java.lang.String">
  35. SELECT
  36. fd.sn
  37. FROM face_device fd
  38. left join admin a on a.id = fd.admin_id
  39. <where>
  40. <if test="admin.type == 1">
  41. </if>
  42. <if test="admin.type == 2">
  43. and a.province_id = #{admin.provinceId}
  44. and a.type in (3 ,4 ,5)
  45. </if>
  46. <if test="admin.type == 3">
  47. and a.province_id = #{admin.provinceId}
  48. and a.type in (4 , 5)
  49. and a.tag_id = #{admin.tagId}
  50. </if>
  51. <if test="admin.type == 4">
  52. and a.city_id = #{admin.cityId}
  53. and a.type = 5
  54. and a.tag_id = #{admin.tagId}
  55. </if>
  56. <if test="admin.type == 5">
  57. and a.id =#{admin.id}
  58. </if>
  59. <if test="sn != null and sn !=''">
  60. and fd.sn = #{sn}
  61. </if>
  62. </where>
  63. </select>
  64. <select id="checkPhone" resultType="java.lang.String">
  65. select
  66. uw.phone
  67. from
  68. user_visitor_list uw left join admin a on a.id =uw.admin_id
  69. <where>
  70. <if test="admin.type == 2">
  71. and a.province_id = #{admin.provinceId}
  72. and a.type in (3 ,4 ,5)
  73. </if>
  74. <if test="admin.type == 3">
  75. and a.province_id = #{admin.provinceId}
  76. and a.type in (4 , 5)
  77. and a.tag_id = #{admin.tagId}
  78. </if>
  79. <if test="admin.type == 4">
  80. and a.city_id = #{admin.cityId}
  81. and a.type = 5
  82. and a.tag_id = #{admin.tagId}
  83. </if>
  84. <if test="admin.type == 5">
  85. and a.id =#{admin.id}
  86. </if>
  87. <if test="phone != null and phone !=''">
  88. AND uw.phone = #{phone}
  89. </if>
  90. </where>
  91. </select>
  92. </mapper>