VerManageMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.huaxu.dao.VerManageMapper">
  6. <resultMap type="VerManageEntity" id="VerManageResult">
  7. <result property="id" column="id" />
  8. <result property="verId" column="ver_id" />
  9. <result property="verUrl" column="ver_url" />
  10. <result property="isForcedUpgrade" column="is_forced_upgrade" />
  11. <result property="remark" column="remark" />
  12. <result property="createBy" column="create_by" />
  13. <result property="dateCreate" column="date_create" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="dateUpdate" column="date_update" />
  16. <result property="mobileOS" column="mobile_os" />
  17. <result property="curAppVer" column="cur_app_ver" />
  18. <result property="productType" column="product_type" />
  19. <result property="forcedUpgradeVer" column="forced_upgrade_ver" />
  20. <result property="isNewestVer" column="is_newest_ver" />
  21. <result property="download" column="download" />
  22. </resultMap>
  23. <!-- 实体 -->
  24. <sql id="verManageColumns">
  25. a.id as "id" ,
  26. a.ver_id as "verId" ,
  27. a.ver_url as "verUrl" ,
  28. a.is_forced_upgrade as "isForcedUpgrade" ,
  29. a.remark as "remark" ,
  30. a.date_create as "dateCreate" ,
  31. a.date_update as "dateUpdate" ,
  32. a.create_by as "createBy" ,
  33. a.update_by as "updateBy" ,
  34. a.mobile_os as "mobileOS" ,
  35. a.cur_app_ver as "curAppVer" ,
  36. a.product_type as "productType" ,
  37. a.forced_upgrade_ver as "forcedUpgradeVer" ,
  38. a.is_newest_ver as "isNewestVer" ,
  39. a.download as "download"
  40. </sql>
  41. <!-- 根据主键获取实体 -->
  42. <select id="findVerManage" resultType="com.huaxu.entity.VerManageEntity">
  43. SELECT
  44. <include refid="verManageColumns"/>
  45. FROM uims_ver_manage a
  46. WHERE a.status=1
  47. <if test="verId != null">
  48. and a.cur_app_ver like concat(concat('%',#{verId}) ,'%')
  49. </if>
  50. <if test="productType != null and productType !=''">
  51. and a.product_type = #{productType}
  52. </if>
  53. order by a.DATE_CREATE desc
  54. </select>
  55. <select id="getUpgradeVer" resultType="com.huaxu.entity.VerManageEntity">
  56. SELECT
  57. <include refid="verManageColumns"/>
  58. FROM uims_ver_manage a
  59. WHERE a.status=1
  60. and a.mobile_os='安卓'
  61. <if test="productType != null and productType !=''">
  62. and a.product_type = #{productType}
  63. </if>
  64. order by a.DATE_CREATE desc
  65. limit 1
  66. </select>
  67. <insert id="insertSelective" parameterType="com.huaxu.entity.VerManageEntity" >
  68. insert into uims_ver_manage
  69. <trim prefix="(" suffix=")" suffixOverrides="," >
  70. <if test="verId != null" >
  71. ver_id,
  72. </if>
  73. <if test="verUrl != null" >
  74. ver_url,
  75. </if>
  76. <if test="download != null" >
  77. download,
  78. </if>
  79. <if test="isForcedUpgrade != null" >
  80. is_forced_upgrade,
  81. </if>
  82. <if test="remark != null" >
  83. remark,
  84. </if>
  85. <if test="dateUpdate != null" >
  86. date_update,
  87. </if>
  88. <if test="createBy != null" >
  89. create_by,
  90. </if>
  91. <if test="updateBy != null" >
  92. update_by,
  93. </if>
  94. <if test="mobileOS != null" >
  95. mobile_os,
  96. </if>
  97. <if test="curAppVer != null" >
  98. cur_app_ver,
  99. </if>
  100. <if test="productType != null" >
  101. product_type,
  102. </if>
  103. <if test="forcedUpgradeVer != null" >
  104. forced_upgrade_ver,
  105. </if>
  106. <if test="isNewestVer != null" >
  107. is_newest_ver,
  108. </if>
  109. <if test="status != null" >
  110. status,
  111. </if>
  112. date_create,
  113. </trim>
  114. <trim prefix="values (" suffix=")" suffixOverrides="," >
  115. <if test="verId != null" >
  116. #{verId,jdbcType=VARCHAR},
  117. </if>
  118. <if test="verUrl != null" >
  119. #{verUrl,jdbcType=VARCHAR},
  120. </if>
  121. <if test="download != null" >
  122. #{download,jdbcType=VARCHAR},
  123. </if>
  124. <if test="isForcedUpgrade != null" >
  125. #{isForcedUpgrade,jdbcType=INTEGER},
  126. </if>
  127. <if test="remark != null" >
  128. #{remark,jdbcType=VARCHAR},
  129. </if>
  130. <if test="dateUpdate != null" >
  131. #{dateUpdate,jdbcType=TIMESTAMP},
  132. </if>
  133. <if test="createBy != null" >
  134. #{createBy,jdbcType=VARCHAR},
  135. </if>
  136. <if test="updateBy != null" >
  137. #{updateBy,jdbcType=VARCHAR},
  138. </if>
  139. <if test="mobileOS != null" >
  140. #{mobileOS,jdbcType=VARCHAR},
  141. </if>
  142. <if test="curAppVer != null" >
  143. #{curAppVer,jdbcType=VARCHAR},
  144. </if>
  145. <if test="productType != null" >
  146. #{productType,jdbcType=VARCHAR},
  147. </if>
  148. <if test="forcedUpgradeVer != null" >
  149. #{forcedUpgradeVer,jdbcType=VARCHAR},
  150. </if>
  151. <if test="isNewestVer != null" >
  152. #{isNewestVer,jdbcType=INTEGER},
  153. </if>
  154. <if test="status != null" >
  155. #{status,jdbcType=INTEGER},
  156. </if>
  157. SYSDATE(),
  158. </trim>
  159. </insert>
  160. <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.entity.VerManageEntity" >
  161. update uims_ver_manage
  162. <set >
  163. <if test="verId != null" >
  164. ver_id = #{verId,jdbcType=VARCHAR},
  165. </if>
  166. <if test="verUrl != null" >
  167. ver_url = #{verUrl,jdbcType=VARCHAR},
  168. </if>
  169. <if test="download != null" >
  170. download = #{download,jdbcType=VARCHAR},
  171. </if>
  172. <if test="isForcedUpgrade != null" >
  173. is_forced_upgrade = #{isForcedUpgrade,jdbcType=INTEGER},
  174. </if>
  175. <if test="remark != null" >
  176. remark = #{remark,jdbcType=VARCHAR},
  177. </if>
  178. <if test="dateUpdate != null" >
  179. date_update = #{dateUpdate,jdbcType=TIMESTAMP},
  180. </if>
  181. <if test="updateBy != null" >
  182. create_by = #{updateBy,jdbcType=VARCHAR},
  183. </if>
  184. <if test="mobileOS != null" >
  185. mobile_os = #{mobileOS,jdbcType=VARCHAR},
  186. </if>
  187. <if test="curAppVer != null" >
  188. cur_app_ver = #{curAppVer,jdbcType=VARCHAR},
  189. </if>
  190. <if test="productType != null" >
  191. product_type = #{productType,jdbcType=VARCHAR},
  192. </if>
  193. <if test="forcedUpgradeVer != null" >
  194. forced_upgrade_ver = #{forcedUpgradeVer,jdbcType=VARCHAR},
  195. </if>
  196. <if test="isNewestVer != null" >
  197. is_newest_ver = #{isNewestVer,jdbcType=INTEGER},
  198. </if>
  199. <if test="status != null" >
  200. status = #{status,jdbcType=INTEGER},
  201. </if>
  202. </set>
  203. where id = #{id,jdbcType=INTEGER}
  204. </update>
  205. <delete id="deleteSelective" parameterType="map">
  206. update uims_ver_manage
  207. set status = 0
  208. where id in
  209. <foreach collection="ids" item="item" open="(" close=")" separator=",">
  210. #{item,jdbcType=INTEGER}
  211. </foreach>
  212. </delete>
  213. </mapper>