后台服务
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.

127 lines
4.7 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. </resultMap>
  27. <sql id="allColumns">
  28. `id`,`tenant_id`,`app_id`,`parent_app_id`,`name`,
  29. `secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`,
  30. `pay_id`,`type`,`mould_type`,`enable`,`plat`,`sort_url`,`business_license`,`icp`
  31. </sql>
  32. <sql id="dynamicWhereConditions">
  33. where 1 = 1
  34. <if test=" null != id ">
  35. and `id` = #{id}
  36. </if>
  37. <if test=" null != tenantId ">
  38. and `tenant_id` = #{tenantId}
  39. </if>
  40. <if test=" null != appId ">
  41. and `app_id` = #{appId}
  42. </if>
  43. <if test=" null != parentAppId ">
  44. and `parent_app_id` like concat('%', #{parentAppId},'%')
  45. </if>
  46. <if test=" null != name ">
  47. and `name` like concat('%', #{name},'%')
  48. </if>
  49. <if test=" null != secret ">
  50. and `secret` like concat('%', #{secret},'%')
  51. </if>
  52. <if test=" null != token ">
  53. and `token` like concat('%', #{token},'%')
  54. </if>
  55. <if test=" null != aesKey ">
  56. and `aes_key` like concat('%', #{aesKey},'%')
  57. </if>
  58. <if test=" null != msgDataFormat ">
  59. and `msg_data_format` like concat('%', #{msgDataFormat},'%')
  60. </if>
  61. <if test=" null != accessToken ">
  62. and `access_token` like concat('%', #{accessToken},'%')
  63. </if>
  64. <if test=" null != lastTokenTime ">
  65. and `last_token_time` = #{lastTokenTime}
  66. </if>
  67. <if test=" null != expiresIn ">
  68. and `expires_in` = #{expiresIn}
  69. </if>
  70. <if test=" null != payId ">
  71. and `pay_id` = #{payId}
  72. </if>
  73. <if test=" null != type ">
  74. and `type` = #{type}
  75. </if>
  76. <if test=" null != plat ">
  77. and `plat` = #{plat}
  78. </if>
  79. <if test=" null != ids ">
  80. and id in
  81. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  82. #{idItem}
  83. </foreach>
  84. </if>
  85. <if test=" null != sortColumns">order by ${sortColumns}</if>
  86. </sql>
  87. <select id="findList" parameterType="com.iformall.domain.po.WxAppinfo" resultMap="BaseResultMap">
  88. select
  89. <include refid="allColumns"/>
  90. from wx_appinfo
  91. <include refid="dynamicWhereConditions"/>
  92. </select>
  93. <select id="findByAppId" parameterType="java.lang.String" resultMap="BaseResultMap">
  94. SELECT *
  95. FROM wx_appinfo
  96. WHERE `app_id` = #{appId}
  97. <if test=" null != tenantId ">
  98. and `tenant_id` = #{tenantId}
  99. </if>
  100. limit 1
  101. </select>
  102. <update id="updateAccessToken" parameterType="com.iformall.domain.po.WxAppinfo">
  103. update wx_appinfo set
  104. `access_token` = #{accessToken}, `last_token_time` = #{lastTokenTime}, `expires_in` = #{expiresIn}
  105. where `app_id` = #{appId}
  106. </update>
  107. </mapper>