|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxAppinfoMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAppinfo">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="app_id" jdbcType="VARCHAR" property="appId"/>
- <result column="parent_app_id" jdbcType="VARCHAR" property="parentAppId"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="secret" jdbcType="VARCHAR" property="secret"/>
- <result column="token" jdbcType="VARCHAR" property="token"/>
- <result column="aes_key" jdbcType="VARCHAR" property="aesKey"/>
- <result column="msg_data_format" jdbcType="VARCHAR" property="msgDataFormat"/>
- <result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
- <result column="last_token_time" jdbcType="TIMESTAMP" property="lastTokenTime"/>
- <result column="expires_in" jdbcType="INTEGER" property="expiresIn"/>
- <result column="pay_id" jdbcType="BIGINT" property="payId"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="mould_type" jdbcType="INTEGER" property="mouldType"/>
- <result column="enable" jdbcType="INTEGER" property="enable"/>
- <result column="plat" jdbcType="INTEGER" property="plat"/>
- <result column="sort_url" jdbcType="VARCHAR" property="sortUrl"/>
- <!-- <result column="group_support" jdbcType="INTEGER" property="groupSupport"/>-->
-
- <result column="business_license" jdbcType="VARCHAR" property="businessLicense"/>
- <result column="icp" jdbcType="VARCHAR" property="icp"/>
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`app_id`,`parent_app_id`,`name`,
- `secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`,
- `pay_id`,`type`,`mould_type`,`enable`,`plat`,`sort_url`,`business_license`,`icp`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId ">
- and `tenant_id` = #{tenantId}
- </if>
-
- <if test=" null != appId ">
- and `app_id` = #{appId}
- </if>
- <if test=" null != parentAppId ">
- and `parent_app_id` like concat('%', #{parentAppId},'%')
- </if>
-
- <if test=" null != name ">
- and `name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != secret ">
- and `secret` like concat('%', #{secret},'%')
- </if>
-
- <if test=" null != token ">
- and `token` like concat('%', #{token},'%')
- </if>
-
- <if test=" null != aesKey ">
- and `aes_key` like concat('%', #{aesKey},'%')
- </if>
-
- <if test=" null != msgDataFormat ">
- and `msg_data_format` like concat('%', #{msgDataFormat},'%')
- </if>
-
- <if test=" null != accessToken ">
- and `access_token` like concat('%', #{accessToken},'%')
- </if>
-
- <if test=" null != lastTokenTime ">
- and `last_token_time` = #{lastTokenTime}
- </if>
-
- <if test=" null != expiresIn ">
- and `expires_in` = #{expiresIn}
- </if>
-
- <if test=" null != payId ">
- and `pay_id` = #{payId}
- </if>
- <if test=" null != type ">
- and `type` = #{type}
- </if>
- <if test=" null != plat ">
- and `plat` = #{plat}
- </if>
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxAppinfo" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_appinfo
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findByAppId" parameterType="java.lang.String" resultMap="BaseResultMap">
- SELECT *
- FROM wx_appinfo
- WHERE `app_id` = #{appId}
- <if test=" null != tenantId ">
- and `tenant_id` = #{tenantId}
- </if>
- limit 1
- </select>
-
- <update id="updateAccessToken" parameterType="com.iformall.domain.po.WxAppinfo">
- update wx_appinfo set
- `access_token` = #{accessToken}, `last_token_time` = #{lastTokenTime}, `expires_in` = #{expiresIn}
- where `app_id` = #{appId}
- </update>
- </mapper>
|