ApkMapper.xml 6.2 KB

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