|  | <?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.WxThirdPartyApiMapper">
    <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxThirdPartyApi">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
        <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
        <result column="type" jdbcType="INTEGER" property="type"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="app_id" jdbcType="VARCHAR" property="appId"/>
        <result column="app_key" jdbcType="VARCHAR" property="appKey"/>
        <result column="sign_key" jdbcType="VARCHAR" property="signKey"/>
        <result column="api_url" jdbcType="VARCHAR" property="apiUrl"/>
        <result column="token" jdbcType="VARCHAR" property="token"/>
        <result column="token_expired_time" jdbcType="TIMESTAMP" property="tokenExpiredTime"/>
        <result column="user_name" jdbcType="VARCHAR" property="userName"/>
        <result column="password" jdbcType="VARCHAR" property="password"/>
        <result column="version" jdbcType="VARCHAR" property="version"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
        <result column="tp_id" jdbcType="VARCHAR" property="tpId"/>
    </resultMap>
    <sql id="allColumns">
	    `id`,`tenant_id`,`parent_tenant_id`,`type`,`name`,`app_id`,`app_key`,`sign_key`,`api_url`, `token`,`token_expired_time`,`user_name`,`password`,`version`,`remark`,`tp_id`
	</sql>
    <sql id="dynamicWhereConditions">
        where 1 = 1
        <if test=" null != id ">
            and `id` = #{id}
        </if>
        <if test=" null != tenantId and '' != tenantId">
            and `tenant_id` = #{tenantId}
        </if>
        <if test=" null != parentTenantId and '' != parentTenantId">
            and `parent_tenant_id` = #{parentTenantId}
        </if>
        <if test=" null != type ">
            and `type` = #{type}
        </if>
        
         <if test=" null != version and '' != version">
            and `version` = #{version}
        </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.WxThirdPartyApi" resultMap="BaseResultMap">
        select
        <include refid="allColumns"/>
        from wx_third_party_api
        <include refid="dynamicWhereConditions"/>
    </select>
</mapper>
 |