ApkMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.middle.dao.ApkMapper">
  4. <select id="searchAppList" resultType="com.ytpm.agent.view.AgentAppView">
  5. SELECT
  6. ya.app_id,
  7. ya.app_key,
  8. ya.app_name,
  9. ya.superior_id,
  10. pua.app_name superiorName,
  11. ya.user_id,
  12. ya.app_type,
  13. ya.apk_url,
  14. ya.qr_code,
  15. ya.version_code,
  16. ya.update_tips,
  17. ya.enabled,
  18. ya.store_on_sale,
  19. ya.store_type,
  20. ya.store_url,
  21. ya.package_name,
  22. ya.domain,
  23. ya.category,
  24. ya.sub_category,
  25. ya.coppa,
  26. ya.ccpa,
  27. ya.screen_orientation,
  28. ya.ditch_name,
  29. ya.ditch_id,
  30. u.nick_name
  31. FROM
  32. yt_app ya
  33. JOIN yt_platform_user_app pua on ya.superior_id = pua.app_id
  34. LEFT JOIN yt_app_channel_relative acr ON ya.app_id = acr.app_id
  35. LEFT JOIN yt_platform_user u ON ya.user_id = u.user_id
  36. <where>
  37. <if test="channelName !=null and channelName != ''">
  38. and ya.ditch_name like concat('%', #{channelName} ,'%')
  39. </if>
  40. <if test="appName !=null and appName != ''">
  41. and ya.app_name like concat('%', #{appName} ,'%')
  42. </if>
  43. <if test="appType !=null">
  44. and ya.app_type = #{appType}
  45. </if>
  46. <if test="superiorId !=null and superiorId != ''">
  47. and ya.superior_id = #{superiorId}
  48. </if>
  49. </where>
  50. GROUP BY
  51. ya.app_id
  52. </select>
  53. <select id="countApk" resultType="java.lang.Integer">
  54. select
  55. count(app_id)
  56. from yt_app
  57. where apk_url is not null
  58. </select>
  59. <select id="getAppIds" resultType="java.lang.String">
  60. select
  61. group_concat(app_id)
  62. from yt_app
  63. where apk_url is not null
  64. </select>
  65. <select id="queryAll" resultType="com.ytpm.agent.view.AgentAppView">
  66. select
  67. app_id, app_key, app_name, user_id, app_type, apk_url, qr_code, version_code, update_tips, enabled, store_on_sale, store_type, store_url, package_name, domain, category, sub_category, coppa, screen_orientation, ccpa, feign_path, ditch_id, ditch_name, superior_id
  68. from yt_app
  69. where enabled = 1
  70. </select>
  71. <select id="queryBySuperiorId" resultType="com.ytpm.agent.view.AgentAppView">
  72. select
  73. app_id, app_key, app_name, user_id, app_type, apk_url, qr_code, version_code, update_tips, enabled, store_on_sale, store_type, store_url, package_name, domain, category, sub_category, coppa, screen_orientation, ccpa, feign_path, ditch_id, ditch_name, superior_id
  74. from yt_app
  75. where enabled = 1 and superior_id = #{superiorId}
  76. </select>
  77. <insert id="insertOne">
  78. insert into yt_app
  79. (
  80. app_id,
  81. app_key,
  82. app_name,
  83. user_id,
  84. app_type,
  85. apk_url,
  86. qr_code,
  87. version_code,
  88. update_tips,
  89. store_on_sale,
  90. store_type,
  91. package_name,
  92. domain,
  93. category,
  94. sub_category,
  95. coppa,
  96. screen_orientation,
  97. ccpa,
  98. store_url,
  99. ditch_id,
  100. ditch_name,
  101. superior_id,
  102. enabled
  103. )
  104. values
  105. (
  106. #{appId},
  107. #{appKey},
  108. #{appName},
  109. #{userId},
  110. #{appType},
  111. #{apkUrl},
  112. #{qrCode},
  113. #{versionCode},
  114. #{updateTips},
  115. #{storeOnSale},
  116. #{storeType},
  117. #{packageName},
  118. #{domain},
  119. #{category},
  120. #{subCategory},
  121. #{coppa},
  122. #{screenOrientation},
  123. #{ccpa},
  124. #{storeUrl},
  125. #{ditchId},
  126. #{ditchName},
  127. #{superiorId},
  128. #{enabled}
  129. )
  130. </insert>
  131. <update id="updateOne">
  132. update yt_app
  133. <set>
  134. <if test="appKey != null">
  135. app_key = #{appKey},
  136. </if>
  137. <if test="appName != null">
  138. app_name = #{appName},
  139. </if>
  140. <if test="appType != null">
  141. app_type = #{appType},
  142. </if>
  143. <if test="versionCode != null">
  144. version_code = #{versionCode},
  145. </if>
  146. <if test="updateTips != null">
  147. update_tips = #{updateTips},
  148. </if>
  149. <if test="enabled != null">
  150. enabled = #{enabled},
  151. </if>
  152. <if test="storeOnSale != null">
  153. store_on_sale = #{storeOnSale},
  154. </if>
  155. <if test="storeType != null">
  156. store_type = #{storeType},
  157. </if>
  158. <if test="storeUrl != null">
  159. store_url = #{storeUrl},
  160. </if>
  161. <if test="packageName != null">
  162. package_name = #{packageName},
  163. </if>
  164. <if test="domain != null">
  165. domain = #{domain},
  166. </if>
  167. <if test="category != null">
  168. category = #{category},
  169. </if>
  170. <if test="subCategory != null">
  171. sub_category = #{subCategory},
  172. </if>
  173. <if test="coppa != null">
  174. coppa = #{coppa},
  175. </if>
  176. <if test="screenOrientation != null">
  177. screen_orientation = #{screenOrientation},
  178. </if>
  179. <if test="ccpa != null">
  180. ccpa = #{ccpa},
  181. </if>
  182. <if test=" apkUrl != null">
  183. apk_url = #{apkUrl},
  184. </if>
  185. <if test="qrCode != null">
  186. qr_code = #{qrCode},
  187. </if>
  188. <if test="ditchId != null">
  189. ditch_id = #{ditchId},
  190. </if>
  191. <if test="ditchName != null">
  192. ditch_name = #{ditchName},
  193. </if>
  194. <if test="superiorId != null">
  195. superior_id = #{superiorId}
  196. </if>
  197. </set>
  198. where app_id = #{appId}
  199. </update>
  200. </mapper>