<?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="cn.freemud.manager.dao.PartnerWxappDao">

    <sql id="all_column">
         id,
         partner_id as partnerId,
         pay_partner_id as payPartnerId,
         pay_store_id as payStoreId,
         wx_appid as wxAppid,
         wx_appsecret as wxAppsecret,
         wx_appname as wxAppname,
         appid as appid,
         status,
         email,
         email_password as emailPassward,
         gmt_created as gmtCreated,
         gmt_modified as gmtModified
    </sql>

    <select id="selectByPartnerIdAndAppid" resultType="PartnerWxapp">
        SELECT
        <include refid="all_column"/>
        FROM partner_wxapp WHERE appid=#{appid} and partner_id= #{partnerId}
    </select>

    <select id="selectByPartnerIdAndWxAppid" resultType="PartnerWxapp">
        SELECT
        <include refid="all_column"/>
        FROM partner_wxapp WHERE wx_appid=#{wxAppid} and partner_id= #{partnerId}
    </select>
</mapper>