后台服务
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WxWeappCodeStatusMapper.xml 5.3 KiB

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