AppUserLoginMapper.xml 1.2 KB

1234567891011121314151617181920212223242526272829
  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.ytpm.dao.AppUserLoginMapper">
  4. <select id="getLastLoginInfo" resultType="com.ytpm.app.model.YtAppUserLoginRecord">
  5. select
  6. record_id, user_id, app_id, login_time, phone_brand, phone_model, login_ip, communication_operator, ip_addr
  7. from yt_app_user_login_record
  8. where user_id = #{userId} and app_id = #{appId}
  9. order by login_time desc limit 1
  10. </select>
  11. <select id="getIpRepeatCount" resultType="java.lang.Integer">
  12. select
  13. count(distinct login_ip)
  14. from yt_app_user_login_record
  15. where
  16. app_id = #{appId}
  17. and user_id not in (#{userId})
  18. and login_ip = #{loginIp}
  19. </select>
  20. <select id="getDeviceCount" resultType="java.lang.Integer">
  21. select
  22. count(distinct phone_model)
  23. from yt_app_user_login_record
  24. where
  25. app_id = #{appId}
  26. and user_id not in (#{userId})
  27. and phone_model = #{phoneModel}
  28. </select>
  29. </mapper>