You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 line
5.8 KiB

  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.iformall.mapper.WxWeappCodeStatusMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappCodeStatus">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="app_id" jdbcType="VARCHAR" property="appId"/>
  8. <result column="type" jdbcType="INTEGER" property="type"/>
  9. <result column="user_version" jdbcType="VARCHAR" property="userVersion"/>
  10. <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/>
  11. <result column="code_status" jdbcType="INTEGER" property="codeStatus"/>
  12. <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode"/>
  13. <result column="code_time" jdbcType="TIMESTAMP" property="codeTime"/>
  14. <result column="plat" jdbcType="INTEGER" property="plat"/>
  15. </resultMap>
  16. <sql id="allColumns">
  17. `id`,`tenant_id`,`app_id`,`type`,`user_version`,`version_desc`,`code_status`,`code_err_code`,`code_time`,`plat`
  18. </sql>
  19. <sql id="dynamicWhereConditions">
  20. where 1 = 1
  21. <if test=" null != id ">
  22. and `id` = #{id}
  23. </if>
  24. <if test=" null != tenantId ">
  25. and `tenant_id` = #{tenantId}
  26. </if>
  27. <if test=" null != appId ">
  28. and `app_id` = #{appId}
  29. </if>
  30. <if test=" null != type ">
  31. and `type` = #{type}
  32. </if>
  33. <if test=" null != plat ">
  34. and `plat` = #{plat}
  35. </if>
  36. <if test=" null != userVersion ">
  37. and `user_version` = #{userVersion}
  38. </if>
  39. <if test=" null != codeStatus ">
  40. and `code_status` = #{codeStatus}
  41. </if>
  42. <if test=" null != codeTime ">
  43. and `code_time` = #{codeTime}
  44. </if>
  45. <if test=" null != ids ">
  46. and id in
  47. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  48. #{idItem}
  49. </foreach>
  50. </if>
  51. <if test=" null != sortColumns">order by ${sortColumns}</if>
  52. </sql>
  53. <select id="findList" parameterType="com.iformall.domain.po.WxWeappCodeStatus" resultMap="BaseResultMap">
  54. select
  55. <include refid="allColumns"/>
  56. from wx_weapp_code_status
  57. <include refid="dynamicWhereConditions"/>
  58. </select>
  59. <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappCodeStatus">
  60. update wx_weapp_code_status
  61. set `user_version` = #{userVersion}, `version_desc`= #{versionDesc},
  62. `code_status` = #{codeStatus}, `code_err_code` = #{codeErrCode}, `code_time` = #{codeTime}
  63. where `app_id` = #{appId} and `type` = #{type}
  64. </update>
  65. <select id="findUserVersions" resultType="hashmap">
  66. select user_version as version
  67. from wx_weapp_code_status
  68. where 1=1
  69. <if test=" null != type ">
  70. and `type` = #{type}
  71. </if>
  72. <if test=" null != plat ">
  73. and `plat` = #{plat}
  74. </if>
  75. group by user_version
  76. </select>
  77. <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappCodeStatusVo">
  78. <id column="id" jdbcType="BIGINT" property="id"/>
  79. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  80. <result column="app_id" jdbcType="VARCHAR" property="appId"/>
  81. <result column="type" jdbcType="INTEGER" property="type"/>
  82. <result column="plat" jdbcType="INTEGER" property="plat"/>
  83. <result column="user_version" jdbcType="VARCHAR" property="userVersion"/>
  84. <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/>
  85. <result column="code_status" jdbcType="INTEGER" property="codeStatus"/>
  86. <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode"/>
  87. <result column="code_time" jdbcType="TIMESTAMP" property="codeTime"/>
  88. <result column="name" jdbcType="VARCHAR" property="name"/>
  89. </resultMap>
  90. <sql id="allVoColumns">
  91. c.`id`,c.`tenant_id` as `tenant_id`,c.`app_id`,c.`type` as `type`,c.`plat` as `plat`,c.`user_version` as `user_version`,c.`version_desc`,c.`code_status`,c.`code_err_code`,c.`code_time` as `code_time`, a.`name`
  92. </sql>
  93. <sql id="dynamicVoWhereConditions">
  94. where 1 = 1
  95. <if test=" null != id ">
  96. and c.`id` = #{id}
  97. </if>
  98. <if test=" null != tenantId ">
  99. and c.`tenant_id` = #{tenantId}
  100. </if>
  101. <if test=" null != appId ">
  102. and c.`app_id` = #{appId}
  103. </if>
  104. <if test=" null != type ">
  105. and c.`type` = #{type}
  106. </if>
  107. <if test=" null != plat ">
  108. and c.`plat` = #{plat}
  109. </if>
  110. <if test=" null != userVersion ">
  111. and c.`user_version` = #{userVersion}
  112. </if>
  113. <if test=" null != codeStatus ">
  114. and c.`code_status` = #{codeStatus}
  115. </if>
  116. <if test=" null != name ">
  117. and a.`name` like concat('%', #{name},'%')
  118. </if>
  119. <if test=" null != ids ">
  120. and id in
  121. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  122. #{idItem}
  123. </foreach>
  124. </if>
  125. <if test=" null != sortColumns">order by ${sortColumns}</if>
  126. </sql>
  127. <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappCodeStatusVo" resultMap="VBaseResultMap">
  128. select
  129. <include refid="allVoColumns"/>
  130. from wx_weapp_code_status c
  131. left join wx_appinfo a on c.`app_id` = a.`app_id`
  132. <include refid="dynamicVoWhereConditions"/>
  133. </select>
  134. </mapper>