Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

129 wiersze
4.9 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.WxAppinfoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAppinfo">
  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="parent_app_id" jdbcType="VARCHAR" property="parentAppId"/>
  9. <result column="name" jdbcType="VARCHAR" property="name"/>
  10. <result column="secret" jdbcType="VARCHAR" property="secret"/>
  11. <result column="token" jdbcType="VARCHAR" property="token"/>
  12. <result column="aes_key" jdbcType="VARCHAR" property="aesKey"/>
  13. <result column="msg_data_format" jdbcType="VARCHAR" property="msgDataFormat"/>
  14. <result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
  15. <result column="last_token_time" jdbcType="TIMESTAMP" property="lastTokenTime"/>
  16. <result column="expires_in" jdbcType="INTEGER" property="expiresIn"/>
  17. <result column="pay_id" jdbcType="BIGINT" property="payId"/>
  18. <result column="type" jdbcType="INTEGER" property="type"/>
  19. <result column="mould_type" jdbcType="INTEGER" property="mouldType"/>
  20. <result column="enable" jdbcType="INTEGER" property="enable"/>
  21. <result column="plat" jdbcType="INTEGER" property="plat"/>
  22. <result column="sort_url" jdbcType="VARCHAR" property="sortUrl"/>
  23. <!-- <result column="group_support" jdbcType="INTEGER" property="groupSupport"/>-->
  24. <result column="business_license" jdbcType="VARCHAR" property="businessLicense"/>
  25. <result column="icp" jdbcType="VARCHAR" property="icp"/>
  26. <result column="laike_id" jdbcType="VARCHAR" property="laikeId"/>
  27. <result column="company_name" jdbcType="VARCHAR" property="companyName"/>
  28. </resultMap>
  29. <sql id="allColumns">
  30. `id`,`tenant_id`,`app_id`,`parent_app_id`,`name`,
  31. `secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`,
  32. `pay_id`,`type`,`mould_type`,`enable`,`plat`,`sort_url`,`business_license`,`icp`,`laike_id`,`company_name`
  33. </sql>
  34. <sql id="dynamicWhereConditions">
  35. where 1 = 1
  36. <if test=" null != id ">
  37. and `id` = #{id}
  38. </if>
  39. <if test=" null != tenantId ">
  40. and `tenant_id` = #{tenantId}
  41. </if>
  42. <if test=" null != appId ">
  43. and `app_id` = #{appId}
  44. </if>
  45. <if test=" null != parentAppId ">
  46. and `parent_app_id` like concat('%', #{parentAppId},'%')
  47. </if>
  48. <if test=" null != name ">
  49. and `name` like concat('%', #{name},'%')
  50. </if>
  51. <if test=" null != secret ">
  52. and `secret` like concat('%', #{secret},'%')
  53. </if>
  54. <if test=" null != token ">
  55. and `token` like concat('%', #{token},'%')
  56. </if>
  57. <if test=" null != aesKey ">
  58. and `aes_key` like concat('%', #{aesKey},'%')
  59. </if>
  60. <if test=" null != msgDataFormat ">
  61. and `msg_data_format` like concat('%', #{msgDataFormat},'%')
  62. </if>
  63. <if test=" null != accessToken ">
  64. and `access_token` like concat('%', #{accessToken},'%')
  65. </if>
  66. <if test=" null != lastTokenTime ">
  67. and `last_token_time` = #{lastTokenTime}
  68. </if>
  69. <if test=" null != expiresIn ">
  70. and `expires_in` = #{expiresIn}
  71. </if>
  72. <if test=" null != payId ">
  73. and `pay_id` = #{payId}
  74. </if>
  75. <if test=" null != type ">
  76. and `type` = #{type}
  77. </if>
  78. <if test=" null != plat ">
  79. and `plat` = #{plat}
  80. </if>
  81. <if test=" null != ids ">
  82. and id in
  83. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  84. #{idItem}
  85. </foreach>
  86. </if>
  87. <if test=" null != sortColumns">order by ${sortColumns}</if>
  88. </sql>
  89. <select id="findList" parameterType="com.iformall.domain.po.WxAppinfo" resultMap="BaseResultMap">
  90. select
  91. <include refid="allColumns"/>
  92. from wx_appinfo
  93. <include refid="dynamicWhereConditions"/>
  94. </select>
  95. <select id="findByAppId" parameterType="java.lang.String" resultMap="BaseResultMap">
  96. SELECT <include refid="allColumns"/>
  97. FROM wx_appinfo
  98. WHERE `app_id` = #{appId}
  99. <if test=" null != tenantId ">
  100. and `tenant_id` = #{tenantId}
  101. </if>
  102. limit 1
  103. </select>
  104. <update id="updateAccessToken" parameterType="com.iformall.domain.po.WxAppinfo">
  105. update wx_appinfo set
  106. `access_token` = #{accessToken}, `last_token_time` = #{lastTokenTime}, `expires_in` = #{expiresIn}
  107. where `app_id` = #{appId}
  108. </update>
  109. </mapper>