<?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.zsElectric.boot.business.mapper.ThirdPartyInfoMapper">

    <select id="selectThirdPartyInfoPage" resultType="com.zsElectric.boot.business.model.vo.ThirdPartyInfoVO">
        SELECT
            id,
            ec_name,
            contact_name,
            contact_phone,
            ec_attach,
            app_id,
            auth_code,
            status,
        operator_id,
        api_base_url,
        operator_secret,
        sig_secret,
        data_secret,
        data_secret_iv AS dataSecretIV,
            remark,
            create_time
        FROM c_third_party_info
        <where>
            is_deleted = 0
            <if test="query.ecName != null and query.ecName != ''">
                AND ec_name LIKE CONCAT('%', #{query.ecName}, '%')
            </if>
            <if test="query.contactName != null and query.contactName != ''">
                AND contact_name LIKE CONCAT('%', #{query.contactName}, '%')
            </if>
            <if test="query.contactPhone != null and query.contactPhone != ''">
                AND contact_phone = #{query.contactPhone}
            </if>
            <if test="query.appId != null and query.appId != ''">
                AND app_id = #{query.appId}
            </if>
            <if test="query.status != null">
                AND status = #{query.status}
            </if>
        </where>
        ORDER BY create_time DESC
    </select>

</mapper>
