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

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