AppversionSettingMapper.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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="cn.ubitech.ttc.dao.AppversionSettingMapper">
  4. <!-- 开启二级缓存 -->
  5. <select id="getLastAppVersionSetting" resultType="cn.ubitech.ttc.entity.AppversionSetting">
  6. SELECT
  7. (SELECT
  8. MIN(s1.type) mtype
  9. FROM appversion_setting s1
  10. WHERE s1.createtime > (SELECT
  11. s2.createtime
  12. FROM appversion_setting s2
  13. WHERE s2.version = #{versionno})
  14. <if test='devicetype == "0"'>
  15. AND s1.andriodstatus = 0
  16. </if>
  17. <if test='devicetype == "1"'>
  18. AND s1.iosstatus = 0
  19. </if>
  20. ORDER BY s1.type, s1.createtime DESC) mtype,
  21. s.type,
  22. s.version,
  23. s.size,
  24. s.andriodurl,
  25. s.andriodstatus,
  26. s.iosurl,
  27. s.iosstatus,
  28. s.isexitapp,
  29. s.comment
  30. FROM appversion_setting s
  31. WHERE s.createtime > (SELECT
  32. s3.createtime
  33. FROM appversion_setting s3
  34. WHERE s3.version = #{versionno})
  35. <if test='devicetype == "0"'>
  36. AND s.andriodstatus = 0
  37. </if>
  38. <if test='devicetype == "1"'>
  39. AND s.iosstatus = 0
  40. </if>
  41. ORDER BY s.createtime DESC
  42. LIMIT 0, 1
  43. </select>
  44. <select id="getAppVersionByType" resultType="cn.ubitech.ttc.entity.AppversionSetting">
  45. SELECT
  46. <if test='devicetype == "0"'>
  47. s.andriodurl url,
  48. </if>
  49. <if test='devicetype == "1"'>
  50. s.iosurl url,
  51. </if>
  52. s.version
  53. FROM appversion_setting s
  54. WHERE s.version = #{versionno}
  55. LIMIT 0, 1
  56. </select>
  57. </mapper>